As someone who has used both (but not for any serious, large projects), I’d say they target different audiences. First and foremost, Zig is not memory-safe in the way Rust is. On the other hand, Zig is way easier to write than unsafe Rust. Rust comes with a lot of features and libraries, while Zig is an intentionally small language, almost minimalistic (kind of like C, but modern).
There are lots of different tradeoffs being made, so yes, I’ll give the boring answer and say they are good for different kinds of projects :)
If it’s specifically low level programming (I’m envisioning programs where you need fairly direct control over memory, IO, etc.), you’d probably quickly need a lot of unsafe in Rust, which can quickly get very complicated to use safely. So I’d probably recommend Zig for that purpose.
It’s easier than C, it’s safer than C, the compiler is more helpful than GCC
I think it’s fun
Less verbose? I don’t think so
Lines of code about the same
For someone starting out as a programmer for low level programming I would recommend rust
For the same purpose, would you recommend Rust over Zig?
As someone who has used both (but not for any serious, large projects), I’d say they target different audiences. First and foremost, Zig is not memory-safe in the way Rust is. On the other hand, Zig is way easier to write than
unsafeRust. Rust comes with a lot of features and libraries, while Zig is an intentionally small language, almost minimalistic (kind of like C, but modern).There are lots of different tradeoffs being made, so yes, I’ll give the boring answer and say they are good for different kinds of projects :)
If it’s specifically low level programming (I’m envisioning programs where you need fairly direct control over memory, IO, etc.), you’d probably quickly need a lot of
unsafein Rust, which can quickly get very complicated to use safely. So I’d probably recommend Zig for that purpose.I should’ve known it’s a “it depends” answer. 😆 It’s programming languages after all. 😉
Thanks for the insight though, I appreciate it! 🙏
I know nothing about Zig
Alright, thank you.