top | item 45880492

(no title)

valcron1000 | 3 months ago

> Zig must also be good for eliminating the same ones.

But Zig does not eliminate them, but rather it might catch them at runtime. The difference here is that Rust promises that it will detect them at compile time, long before I ship my code.

> The property of memory safety is itself not binary in both languages

In this case it is: either you catch the issue at compile time, or you don't. This is the same as type safety: just because Python can detect type errors at runtime it does not mean that it's as "type safe" as, for ex. Haskell. This might be due to imprecise usage of terms but that's just the way it's discussed in the craft.

discuss

order

pron|3 months ago

> But Zig does not eliminate them, but rather it might catch them at runtime

So does Rust. That's what we mean by eliminating them. Zig/Rust will panic, but you won't get a vulnerability.

> The difference here is that Rust promises that it will detect them at compile time, long before I ship my code.

No, Rust doesn't guarantee catching spatial-memory-safety violations at compile-time. Neither do Java, Python, or JS/TS, by the way.