5 ms·
There seem to be a ballooning number of entrants to the space of C-level languages recently (which is a fantastic thing after two decades with little going on).
by jleahy 7y ago
There seem to be a ballooning number of entrants to the space of C-level languages recently (which is a fantastic thing after two decades with little going on).
Zig and Odin are the two others that have appeared recently, at least of the ones I can immediately recollect (in addition to Rust, of course). I'll discount Jai as it's currently vaporware. Zig seems to be doing some really impressive stuff especially around target/libc management.
- the_hoser 7y agoAgreed twice. Zig is doing some really neat stuff, and Jai is... an idea.
- ironmagma 7y agoI would love to see a Zig vs. ZZ vs. Rust vs. Odin comparison sometime.
- jleahy 7y agoWell Rust and ZZ are both trying to prove safety, Rust does it via the borrow checker and ZZ does it by formal verification. I would be surprised if the ZZ approach would scale beyond trivial examples (you're going to end up with programs that it can't give a yes/no answer to, that's always the issue with formal), but I'd be happy to be proven wrong. Zig and Odin are both trying to be a "better C", they don't try to prove safety (that's up to you) but they try to make it harder to shoot yourself in the foot (and may end up being simpler than Rust as a result). I don't know much about Odin, but Zig has some very nice features to help embedded development: - All standard library containers allow you to provide your own allocator (there is no magical central allocator, ie. the dreaded 'malloc'). - All errors must be handled, including running out of memory. - It's easy to just not use the standard library at all. - Cross-compiling is a breeze (eg. you can just build a Windows .exe on Linux as easily as building a Linux executable). - You can measure frame sizes so you know how large your stack needs to be (and thus guarantee your stack will never overflow). Certainly I'd be interested in anyone's 'Zig vs Odin' if they've used both.
- ironmagma 7y agoThanks for the comparison! Another one in the fray I forgot to mention is Nim. With all these new languages marketing themselves in roughly the same way albeit with slightly different vocabulary and with similar syntax, it's difficult to iron out what exactly the differences are.