| There wasn't a reply button on your latest reply so I'm posting here instead. Also because I now have more time to clarify what's exactly wrong about the claims. > who says that the same invariants weren't broken on the Zig side There are no such invariants in Zig. > "unsafe invariant broken" does not strictly mean that there's a reachable bug. Broken invariant literally means you are reaching it. The word you are looking for is "unsoundness". > callers may never actually trigger a bad invariant in an unsafe block. There's a neat class of UBs called "immediate UB"s. They can ruin the code just by being compiled, instead of reached at runtime. And guess what? They have a lot of these. > potential, grep'able bugs We are indeed going in circles but I have to ask: you still don't understand that? Grep works for violated lints, unsafe blocks and all things explicitly exist in the code. Not for unsoundness in safe functions that can be called incorrectly and ruin everything, can't be reasoned about by any existing tools. They also have thousands of those. It's unfair to say the unsoundness is freshly introduced by the port, but Rust also doesn't help in this way where no unsafety is encapsulated and calling anything can be a wild ride. |
Zig does have invariants. It doesn't have an aliasing invariant like rust though, but it does have its own invariants, naturally. Zig is a memory unsafe language.
> Broken invariant literally means you are reaching it. The word you are looking for is "unsoundness".
A reachable bug means one that can be triggered. Undefined behavior does not mean a bug can be triggered.
> There's a neat class of UBs called "immediate UB"s. They can ruin the code just by being compiled, instead of reached at runtime. And guess what? They have a lot of these.
Can be, yes.
> Not for unsoundness in safe functions that can be called incorrectly and ruin everything, can't be reasoned about by any existing tools
This is only possible if unsafe is used. `unsafe` is grep'able, hence all memory safety bugs are grep'able. That's the whole point of rust.