3 ms·
> The article title is a touch misleading. It's really talking about how Zig is safer and faster when you must use unsafe Rust. The whole point of "unsafe" co
by nateb2022 4y ago
> The article title is a touch misleading. It's really talking about how Zig is safer and faster when you must use unsafe Rust.
The whole point of "unsafe" code in Rust is that you can build safe abstractions on top of unsafe code. E.g. Rust's standard library is safe, and yet stands on the shoulders of fundamentally unsafe primitives and syscalls.
The author's point is not misleading; rather, it makes an appropriate point: it's easier to write safe Zig than safe Rust. Safety always relies on unsafe code at some level. As observed, safely using unsafe code (aka: writing safe code) is harder to do and often less performant when using Rust.