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.
Zig 0.15.1
11–18 of 18 posts
Re: Zig 0.15.1
#12For 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
#13Can 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 :(
What'd you think of Zig with what you've done so far?
Re: Zig 0.15.1
#14Can 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…
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
#15Can 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…
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
#16Zig'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
#17Can 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.
Re: Zig 0.15.1
#18Can 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…
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.