4 ms·
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
by jurschreuder 8mo 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.
- willx86 8mo agoAs someone who has only used zig a little I've has more core dumps/seg faults than any other language I've ever used. Skill issue? Yes, 100℅, it's definitely due to my lack of skill in the language The only time I've ever made a rust program seg fault is when using nightly macros/"features" and being on stable, leading to rustc crashing with a nice error and then I change to nightly and that was caught at compile time... Skill is a huge factor in safety "70% of vulns are..." Yes, production code written at huge companies by experts... If experts are making those mistakes, that says a lot about it IMO That being said, I'm not a "one language for all", they have their place, embedded rust is hilarious as it's essentially a requirement to have unsafe blocks in your initialisation Anyway rant over