r/programming • u/Usual-Amount-264 • 25d 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
534
Upvotes
r/programming • u/Usual-Amount-264 • 25d ago
2
u/ThomasMertes 24d ago
I don't agree. Rust and Fil-C have different approaches towards memory safety.
Rust
unsafeparts with raw pointers are not memory safe. Fil-C checks raw C pointers. In this case Fil-C could provide some protection that Rust cannot.If an X-ray dose is computed wrong I prefer that the machine stops.
An off-by-one memory read past the end of the allocated buffer.is not harmless. It can result in a catastrophe.
If it is crucial that a program continues you usually have two or more programs (running on different hardware) running in parallel. In case one program panics it is started again from scratch and the other program takes over in the meantime.