logoalt Hacker News

vlovich123last Thursday at 8:25 PM3 repliesview on HN

Zig isn’t memory safe though right?


Replies

pixelpoetlast Thursday at 8:43 PM

It isn't a lot of things, but I would argue that its exceptionally (heh) good exception handling model / philosophy (making it good, required, and performant) is more important than memory safety, especially when a lot of performance-oriented / bit-banging Rust code just gets shoved into Unsafe blocks anyway. Even C/C++ can be made memory safe, cf. https://github.com/pizlonator/llvm-project-deluge

What I'm more interested to know is what the runtime performance tradeoff is like now; one really has to assume that it's slower than LLVM-generated code, otherwise that monumental achievement seems to have somehow been eclipsed in very short time, with much shorter compile times to boot.

show 2 replies
kristoff_itlast Thursday at 9:27 PM

How confident are you that memory safety (or lack thereof) is a significant variable in how fast a compiler is?

ummonklast Thursday at 9:18 PM

Zig is less memory safe than Rust, but more than C/C++. Neither Zig nor Rust is fundamentally memory safe.

show 1 reply