I do assume any post with "written in rust" does better on hacker news.
I do assume any post with "written in rust" does better on hacker news.
Point is, it's still an improvement. I am regularly amazed as to why that factually correct and (more and more) time-proven argument is always skipped when criticizing Rust.
At the same time assuming you'll never get a memory issue is over the top.
Personally though -- and in my work -- I'll take any improvement that I can. I am sick of reading about yet another important piece of software having yet another memory safety zero day pwnage bug.
Point is, many don't do it. And they don't tell anyone. And they deploy important software. And then we get unpleasantly surprised years (or decades) later.
Same argument as with C++: proponents say that the modern C++ is almost like Rust which is cool and I am happy for them, but there are literal hundreds of millions of C++ coding lines out there that will never get upgraded. Having a cop-out like "yeah but the modern version is better" doesn't help legacy code.
Rust on the other hand is super strict for a long time now. They did the right thing.
I heard the ideal theory you cite, many many times. Yet many people still do mistakes. How does that fit in your world-view?
Most of the code in my Linux distro is written in C, yet I don't see many segfaults or data corruption in my favorite tools, even those exposed to the internet. It just works. Supposed buffer overflows and double-frees don't affect me daytoday despite 95%+ code I run being written in C, "catastrophic" issues like heartbleed notwithstanding.
People make mistakes, sure. They'll make them with "safe" languages, too. Rust programs are not immune from mistakes. They'll just be of a different kind.
PHP is memory safe, and there were many easily exploited (not just exploitable) vulnerabilities in software written with PHP. (and it doesn't even have escape hatches out of its memory safety)
And yet I am sure we all have witnessed code bases where this was done. At least I and no less than 40 other colleagues I knew have.
The "ideal theory" refers to the old adage of "just be a good programmer, duh" which historically has been proven to be a complete BS.
> Rust programs are not immune from mistakes. They'll just be of a different kind.
Glad we agree on something. I want memory safety problems out of the equation.
Also please don't fight straw-men -- all Rust discussions seem to always spiral from the very reasonable premise of "Rust eliminates a class of bugs" to "But with Rust you can still make logical mistakes!!!!!", and nobody ever claimed the opposite anyway...
The benefit is that unsafe passages of Rust are rarer and should be safely abstracted from APIs for use by Safe Rust. Mellisearch seems to often (but not always) provide safety rationales for unsafe code, explaining why whatever is done is OK. I don't understand this domain in enough detail to comment on the quality of the rationales.
I prefer the number of guarantees / invariants that's above zero.