5 ms·
I program in Rust and dabbled in Zig. Rust has many more advantages than memory safety, including: * Great error messages (at least since I don't do async stuff
by jakobnissen 2y ago
I program in Rust and dabbled in Zig. Rust has many more advantages than memory safety, including:
* Great error messages (at least since I don't do async stuff) and a helpful linter and compiler
* Relatively high-level APIs, especially compared to Zig. I can do much more in fewer lines of code in Rust
* Larger ecosystem, including more available packages and tutorials/learning materials
* More stability, since Zig is not at 1.0
- sedatk 2y agoAbout Rust's friendly error messages: that's pretty much a self-fulfilled prophecy because compiler errors in Rust are way more prevalent due to stricter constraints imposed by the language. Therefore, Rust must show much better error messages to compensate for its ergonomical disadvantages. So, I don't see that as an absolute win. All the remaining arguments are about maturity. Nothing prevents Zig from attaining them in the future. As a final note: I love writing code in Rust and never used Zig, but I can relate to the demand of ergonomics from a programming language and Rust is quite handicapped on that front, IMHO.
- estebank 2y agoThere are more error cases for invalid Rust code than for other languages, that might be true, but the friendliness of the errors is a consequence of project phylosophy and engineering effort, not a foregone concussion. Some errors fill in on ergonomic holes, but on the whole they are an attempt to make the DX as good as it can be and making the compiler part of the learning experience, not an inscrutable tool that you need a mentor and experience to even have a chance of understanding.