4 ms·
Well 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 appr
by jleahy 7y ago
Well 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.