News for hackers. Stuff that matters.
Re:Some mistakes Rust doesn't catch by sgt on Tuesday February 08, 2022 @07:21AM (#30257584)
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?
Re:Some mistakes Rust doesn't catch by zozbot234 on Tuesday February 08, 2022 @10:24AM (#30259460)
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.
Re:Some mistakes Rust doesn't catch by sgt on Tuesday February 08, 2022 @12:54PM (#30261835)
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.
Re:Some mistakes Rust doesn't catch by kaba0 on Wednesday February 09, 2022 @12:45AM (#30269349)
Is C a toy?

Zig just provides different guarantees.

Re:Some mistakes Rust doesn't catch by wyldfire on Tuesday February 08, 2022 @08:12AM (#30257953)
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.
Re:Some mistakes Rust doesn't catch by rthomas6 on Tuesday February 08, 2022 @09:02AM (#30258445)
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.
Re:Some mistakes Rust doesn't catch by sgt on Tuesday February 08, 2022 @10:13AM (#30259295)
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.
Re:Some mistakes Rust doesn't catch by mamcx on Tuesday February 08, 2022 @10:44AM (#30259746)
> 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..

Re:Some mistakes Rust doesn't catch by sgt on Tuesday February 08, 2022 @12:28PM (#30261381)
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.
Re:Some mistakes Rust doesn't catch by mamcx on Wednesday February 09, 2022 @07:33AM (#30271878)
> 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.