3 ms·
When Zig is safer and faster than Rust
- karmakaze 4y agoTweet references this article which is also posted: [0] https://news.ycombinator.com/item?id=35058176 https://news.ycombinator.com/item?id=35058176
- bsder 4y agoThe article title is a touch misleading. It's really talking about how Zig is safer and faster when you must use unsafe Rust. "Unsafe Rust" is a world unto itself and even many of the Rust gods have pointed out that writing "unsafe Rust" correctly is very, very difficult.
- 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.