Live data from Hacker News

Zig 0.15.1

ziglang.org

11–18 of 18 posts

Re: Zig 0.15.1

#11
post #7

Can anyone sell me on learning Zig vs Rust? Not for work, just some personal projects I thought about doing in Go but decided learning Rust instead might be fun.

I'm in the same spot as you, just started Zig a month back, but the lack of starter-level guides is quite rough IME. And just when I got a hang of some of stdlib there were major changes. I guess that's the life is learning a work in progress <1.0 language :(

Re: Zig 0.15.1

#12
Sort of off topic but I really wish Zig would put Date in their release notes.

For instance I didn't know if 0.15 is new, or from a few months ago. Every time a new release I had to go to Github and check the release date. It doesn't even need to be exact but something like August 2025 would have been fine to give some context of when this was released.

> - async and await keywords removed

I think by all accounts Andrew has continue to show he is extremely pragmatic with every decision, trying to test new and old theories to the limit and pick what is most coherent and best for Zig. Cant wait for 1.0

Re: Zig 0.15.1

#13
post #7

Can anyone sell me on learning Zig vs Rust? Not for work, just some personal projects I thought about doing in Go but decided learning Rust instead might be fun.

I'm in the same spot as you, just started Zig a month back, but the lack of starter-level guides is quite rough IME. And just when I got a hang of some of stdlib there were major changes. I guess that's the life is learning a work in progress <1.0 language :(

That's a good point I didn't think of, Zig is more likely to have breaking or at least major changes. I guess it doesn't matter too much for personal stuff, but I probably am less likely to want to go back and update things unless I use them often.

What'd you think of Zig with what you've done so far?

Re: Zig 0.15.1

#14
post #9
post #7

Can anyone sell me on learning Zig vs Rust? Not for work, just some personal projects I thought about doing in Go but decided learning Rust instead might be fun.

Try a few different languages to see what fits your style. I'm a fan of both Rust and Zig, but I've been really enjoying Zig lately. Rust has a cool concept called ownership to prevent memory bugs. This means you have to learn new ideas like lifetimes. For instance, an array doesn't just hold objects; it has a lifetime of its own, so you can only store references that will last at least as long as the array. It's mos…

Thanks! I probably will end up trying both at least a little bit.

Rust's memory management did sound neat when I was reading about it. Rust is also more mature, so probably more useful for now. I really like Go's simplicity though, which makes Zig sound interesting too.

I also just remembered Nim. I didn't get very far with it, but it also seemed cool.

Re: Zig 0.15.1

#15
post #7

Can anyone sell me on learning Zig vs Rust? Not for work, just some personal projects I thought about doing in Go but decided learning Rust instead might be fun.

Very roughly, Zig is much closer to Go in terms of philosophy of language design, where as Rust is much closer to Go in terms of the kind of software people write with it. Go and Zig are both aggressively small and portable languages, and e.g. prefer explicit `defer` where Rust would handle cleanup implicitly. Unlike Zig, Go and Rust are both widely used and mature ~tier-1 languages with a deep bench of native librar…

Thanks for the explanations!

I do really like Go's simplicity which is part of why Zig sounded interesting to me. Rust is definitely more mature though and "feels" more useful from the outside, but that could also just be all of the "I rewrote X in Rust" projects out there.

I'm surprised to see that Zig is closer to C than Rust, and also surprised that rust isn't _more_ like go. I'll probably start with rust just to try something different.

Like another commenter mentioned, I'm probably going to end up making a couple toy projects in both just to try them out. I don't have much of a reason for either of them at work, so it's just for personal projects and knowledge.

Re: Zig 0.15.1

#16
I don't follow Zig's development. https://ziglang.org/download/0.15.1/release-notes.html#Motiv... feels vague to me, and linking to a lengthy video isn't very clarifying. Still, I skimmed through it to get a sense of it.

Zig's approach seems to require users to explicitly call flush for any writes. This reminds me of a similar issue in LLVM's `raw_svector_ostream`. Before a 2015 commit https://github.com/llvm/llvm-project/commit/3d1173ba1a53cab0... , it only called flush at the end, which was efficient. That commit changed this, leading to unnecessarily slow performance. To not break existing users, the 2024 pull request https://github.com/llvm/llvm-project/pull/97704 tries to implement a new interface, but the changes would cause significant churn. @aengelke

Re: Zig 0.15.1

#17
post #7

Can anyone sell me on learning Zig vs Rust? Not for work, just some personal projects I thought about doing in Go but decided learning Rust instead might be fun.

Coming from webdev land, I had to closely work with Rust to appreciate the design of Zig. Try both and see what sticks.

Re: Zig 0.15.1

#18
post #7

Can anyone sell me on learning Zig vs Rust? Not for work, just some personal projects I thought about doing in Go but decided learning Rust instead might be fun.

Very roughly, Zig is much closer to Go in terms of philosophy of language design, where as Rust is much closer to Go in terms of the kind of software people write with it. Go and Zig are both aggressively small and portable languages, and e.g. prefer explicit `defer` where Rust would handle cleanup implicitly. Unlike Zig, Go and Rust are both widely used and mature ~tier-1 languages with a deep bench of native librar…

Other languages are much closer to Go than Zig. A few are Vlang (highest percentage), Odin, and C3 (in terms of how Zig is compared). In terms of C interoperability, C3 (highest percentage) and Vlang make this a strong feature of their languages too. All, in this group, have aspirations of being used "closer to the metal". For instance, there is the Vinix OS[1], from Vlang.

Rust coming across as a bit different, from those used to C family languages, has arguably a lot to do with its OCaml[2] (ML) roots.

[1]: https://github.com/vlang/vinix

[2]: https://en.wikipedia.org/wiki/OCaml

Post reply on HN