Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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.


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"});


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


Is there something in between homepage and docs? Like 30-50 line workout programs?


I was very rusty with c and found learning zig to be a breeze. If you know c by heart you'll do great!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: