2 ms·
Zig doesn't seem like a bad language, but I also don't see anything to make it hands down better than Rust for systems programming. So it kind of fails my "why
by api 11mo ago
Zig doesn't seem like a bad language, but I also don't see anything to make it hands down better than Rust for systems programming. So it kind of fails my "why yet another language?" test. I don't think another language can be justified by marginal improvements.
Rust passes that test because it's categorically better than C and C++ in several ways: much better type system, safety, better modules and code reuse, etc. It's complex, but as far as I can tell most of its complexity is required to offer its level of safety guarantees in a pure systems language without a garbage collector or any kind of true dynamic typing. To make a safe systems language you need to have a very rich type system that can prove safety across a wide array of situations. Either that or you'd have to go to the other far end of the simplicity-complexity spectrum and have a language with virtually no features, which would result in very verbose code and probably a lot of boilerplate.
Zig's coolest feature to me seems like "comptime" and the lack of a weird macro side-language, which is one of Rust's anti-features that feels bolted on. Don't make me learn yet another language. Of course sophisticated macros in Rust are usually instead written in Rust itself via procedural macros, but that is more unwieldy than "comptime."
Still not enough to justify a whole new language and ecosystem though. Again: don't make me learn yet another language unless there's a big payoff.