3 ms·
> Somewhat ironically, idiomatic code in Zig can easily be more correct than unsafe code in Rust. If you worry about unsafety in Rust, then you should know you
by Ygg2 4y ago
> Somewhat ironically, idiomatic code in Zig can easily be more correct than unsafe code in Rust.
If you worry about unsafety in Rust, then you should know you can run miri on your unsafe code to check for undefined behavior, in addition to most C tools used like valgrind, etc.
"Can be more" correct is a bit weaselish (corrolarry it "Can be less"). Sure. You can write bad code in any language. Rust gives you tools to limit sets of memory errors, and on top of that you can use C-standard tools, -AND- even Rust specific tools.
And on top of that it offers sets of tools to eliminate possible errors in safe Rust code (see Clippy).