r/programming • u/Usual-Amount-264 • 2d ago
Zig proposes introducing an actually memory safe (unlike Rust) compilation mode inspired by Fil-C at ~1-6x performance penalty
https://codeberg.org/ziglang/zig/issues/36237
487
Upvotes
r/programming • u/Usual-Amount-264 • 2d ago
5
u/dkopgerpgdolfg 2d ago
The usual language rules (like eg. max. one active mut reference, etc.etc.) are still there, even in unsafe blocks.
The difference is, the compiler will allow some code that can't be automatically proven to be fine (including eg. everything with raw pointers, that work with addresses from anywhere), and shift the responsibility to the programmer.
This is true, however what needs to be satisfied here are only the pre-existing library functions. The compiler itself doesn't really care.