←back to thread

200 points jorangreef | 1 comments | | HN request time: 0s | source
Show context
andi999 ◴[] No.24293266[source]
What is the best way to start with zig, if you know C by heart? I had a look a while ago, but I feel I miss out how the concepts are to be used in practice.
replies(2): >>24293497 #>>24294268 #
kristoff_it ◴[] No.24293497[source]
If you want to be eased into the language, start by checking out https://ziglearn.org. Otherwise just take a look at the overview on the homepage of https://ziglang.org, then the docs.

After that you should already be in great shape and you can read the standard library for examples of useful patterns.

replies(2): >>24295225 #>>24302354 #
Oreb ◴[] No.24302354[source]
Is the https://ziglearn.org site up to date with the latest versions of the language and standard library? The initial "Hello, World" example fails to compile for me. I get:

Semantic Analysis [533/803] ./main.zig:4:14: error: container 'std.debug' has no member called 'print' std.debug.print("Hello, {}!\n", .{"World"});

replies(1): >>24313059 #
1. pfg_ ◴[] No.24313059[source]
It's the opposite - you have version 0.6.0, but the hello world there is for the latest master version of zig which can be downloaded at https://ziglang.org/download