3 ms·
> Rust favors correctness while Zig doesn't necessarily I wouldn't pin this on the language, see TigerBeetle as a counter example. https://github.com/tigerbee
by kristoff_it 3y ago
> Rust favors correctness while Zig doesn't necessarily
I wouldn't pin this on the language, see TigerBeetle as a counter example.
https://github.com/tigerbeetle https://github.com/tigerbeetle
- satvikpendem 3y agoWhy not on the language? Rust has a borrow checker explicitly to avoid problems that are present in C, C++, and even Zig, such as using after free. Just because you can write mission critical software in a language doesn't mean that that language favors correctness. The language must be designed to do so.
- jorangreef 3y agoTo be clear, the domain of correctness is broader than memory safety. For example, TigerBeetle follows NASA's The Power of Ten Rules for Safety-Critical Code. We require that memory allocation failure be explicitly handled in the control flow, and that no dynamic memory allocation be used after initialization, that all resources (including memory) be explicitly limited, with no hidden allocations. Our language choices then came down to C or Zig. Zig made most sense. Zig's correctness philosophy (e.g. extremely explicit control flow) may be different to other languages. But Zig resonated with our own philosophy—in addition to the big examples already given above, we also noticed the little things (e.g. checked arithmetic enabled by default in safe builds).