Live data from Hacker News

Failing to Learn Zig via Advent of Code

forrestthewoods.com

1–10 of 338 posts

Re: Failing to Learn Zig via Advent of Code

#2
I see what went wrong here. You tried to lean on documentation and Google, you should have just go for the source code. It's quite readable, and it's the recommended way to learn for now. Zig has a few peculiarities, it's not stable yet, you kind of have to follow it's development.

https://github.com/ziglang/zig/tree/master/lib/std

Re: Failing to Learn Zig via Advent of Code

#3
post #2

I see what went wrong here. You tried to lean on documentation and Google, you should have just go for the source code. It's quite readable, and it's the recommended way to learn for now. Zig has a few peculiarities, it's not stable yet, you kind of have to follow it's development. https://github.com/ziglang/zig/tree/master/lib/std

>I see what went wrong here. You tried to lean on documentation and Google, you should have just go for the source code.

That sounds rather like a different thing was wrong - not where the author tried to lean: Zig has crap documentation.

Re: Failing to Learn Zig via Advent of Code

#5
post #3
post #2

I see what went wrong here. You tried to lean on documentation and Google, you should have just go for the source code. It's quite readable, and it's the recommended way to learn for now. Zig has a few peculiarities, it's not stable yet, you kind of have to follow it's development. https://github.com/ziglang/zig/tree/master/lib/std

> I see what went wrong here. You tried to lean on documentation and Google, you should have just go for the source code. That sounds rather like a different thing was wrong - not where the author tried to lean: Zig has crap documentation.

Zig documentation isn't crap; the documentation *does not exist* yet. There's an important difference between the two which seems to be ignored.

Zig is young. They're spending their time maturing the core ecosystem --- the compiler, the standard library, and so forth. It's perfectly reasonable to expect early adopters to "RTFS/read the fucking source". *When* they start writing documentation, I'd be perfectly happy to hear comments like "The zig documentation is crap".

At this stage of the project, I'll be honest, I find it upsetting to read comments like this.

Re: Failing to Learn Zig via Advent of Code

#6
Yes, error messages in zig needs improving but that's not surprising. Rust error messages where pretty terrible back in the day.

I found zig language reference pretty good[0]. It is simple, lot of example. I would find 80% on there and had to google the rest. And as another commenter said, looking at zig source code is actually not a bad idea. The std lib is pretty clear and with comments.

My biggest beef with zig is a lack of a package manager. But apparently, it is high in the list of priority for the author so...

[0] https://ziglang.org/documentation/master/

Re: Failing to Learn Zig via Advent of Code

#7
post #2

I see what went wrong here. You tried to lean on documentation and Google, you should have just go for the source code. It's quite readable, and it's the recommended way to learn for now. Zig has a few peculiarities, it's not stable yet, you kind of have to follow it's development. https://github.com/ziglang/zig/tree/master/lib/std

Yeah I did AoC a few years ago in Zig and found sticking the std path in my project so I could quickly search it was the best tool to figuring out how to do various bits and pieces.

Re: Failing to Learn Zig via Advent of Code

#8
post #5
post #3

Earlier quoted context omitted.

> I see what went wrong here. You tried to lean on documentation and Google, you should have just go for the source code. That sounds rather like a different thing was wrong - not where the author tried to lean: Zig has crap documentation.

Zig documentation isn't crap; the documentation *does not exist* yet. There's an important difference between the two which seems to be ignored. Zig is young. They're spending their time maturing the core ecosystem --- the compiler, the standard library, and so forth. It's perfectly reasonable to expect early adopters to "RTFS/read the fucking source". *When* they start writing documentation, I'd be perfectly happy t…

Zig absolutely has documentation: https://ziglang.org/documentation/master/
Post reply on HN