What does HackerNews think of ziglings?
Learn the Zig programming language by fixing tiny broken programs.
There is "Ziglings", but those are a collection of small exercises with answers rather than a full guide.
https://github.com/ratfactor/ziglings
If you know of better resources than these two, please do share (not being passive aggressive here).
I admittedly know C very well, but assuming you already know a language with a C-like syntax (C++, Java, JavaScript, C#, Rust, etc.) most things like functions, control flow, variables, statements map to Zig with only small syntactic differences.
One thing that may be difficult to learn not knowing C is working with strings, since they are just arrays of bytes. Most other languages have a string type, but Zig is much more like C in that strings are null-terminated fixed-sized arrays of bytes.
> * no (official) package manager yet, though this is aparently being worked on
It's the next item on the roadmap as soon as the self-hosted compiler is good enough.
> * documentation is often incomplete and lacking
The language reference is good, but for the stdlib it's best to just read the source code. For other miscellaneous learning materials:
https://github.com/ratfactor/ziglings
https://www.youtube.com/c/ZigSHOWTIME
> * error handling with inferred error sets and `try` is very nice! But for now errors can't hold any data, they are just identifiers, which is often insufficient for good error reporting or handling.
It's still under debate and I'm personally in the camp that errors should not have a payload, so I would avoid assuming that it's definitely the preferable choice. We already have a couple of existing patterns for when diagnostics are needed. That said proposals about adding support for error payloads are still open, so who knows.
https://github.com/ziglang/zig/issues/2647
https://github.com/ziglang/zig/issues/7812
Existing pattern: https://github.com/ziglang/zig/issues/2647#issuecomment-5898...
> * No closures! (big gotcha)
It's possible to create closures already (by declaring a struct type with a method (the closure) and instantiating it immediately after), but it's a clunky solution. We also have an open proposal in this space: