Comment by jurschreuder
10 hours ago
I don't think Rust/PHP are all that much more safe than Zig/C++.
80% of memory safety bugs in C++ are just basically "array out of bounds", for which you don't need a memory checker at all just array bounds checks which LLVM has enabled by default for Rust but you can also use it for C++.
70% of vulns in C++ are memory related but only ~10% of those would be caught by borrow checking. Most are already caught by forcing object initialisation and array bounds checking. Only use-after-free is caught by either borrow checking OR OTHER TOOLS like ARM has 4 bits in addresses that can encode if the memory location has not been pulled from under you.
So aaaaall this trouble if the borrow checker to have in some cases max 10% fewer vulnos.
I'm not going to switch to Rust/PHP just for that little memory safety bonus.
No comments yet
Contribute on Hacker News ↗