So why is Zig being dwarfed by Rust in this arena? Shouldn't Zig be more popular or is it still too small and immature?
Rust is built to be 100% memory safe, not just "hard to misuse in practice". Of course the claim comes with some provisos about how you're always relying on 'unsafe' code, but there is real value to it. Zig is interesting but doesn't have that USP.
So basically Zig is a toy, Rust is for serious stuff.
Re:Some mistakes Rust doesn't catch
by catlifeonmars on Tuesday February 08, 2022 @01:47PM
(#30262633)
That’s an oversimplification. There are many reasons to choose one programming language over another. Strong guarantees of memory safety is only one design parameter.
Is C a toy?
Zig just provides different guarantees.
Zig refers to itself with a version number < 1 and says that the language is not yet stable. That's going to filter the less adventurous crowd out right away. And that's probably ideal - zig can work out the kinks with the adventurous crowd and be better prepared for its post-1.0 life.
I haven't used Zig, but my understanding is that Zig is more comparable to C, whereas Rust is more comparable to C++. Zig is a much smaller and simpler language, but Rust has more high level constructs and abstractions.
I can't comment on either, but I do enjoy C and you can build relatively safe C programs using tools like Valgrind and static analysis. So unless you are building the next OpenSSL it could very well be worth sticking to C11.
> whereas Rust is more comparable to C++
That only in matter of complexity. If rust were actually comparable to C++ it will a major mess.
Rust is actually a ML + C + Haskell-ish lang..
And that's exactly why I am a bit worried about learning it. I am not looking for a language that is too theoretical, like Haskell.
> I am not looking for a language that is too theoretical, like Haskell.
Rust is not "theoretical", but have some theory applied to great effect. The comparison to Haskell is more in the use functional idioms, algebraic types, pattern matching and bits here and there...
Re:Some mistakes Rust doesn't catch
by programmer_dude on Tuesday February 08, 2022 @09:26PM
(#30267933)
It's a very practical language (more than C or C++). But it does have a challenging learning curve.
Pay no attention to how the language was derived. Just dive into it.
Zig would be one such example.