by vlovich123 · 2y ago · 0 comments
I think the main problem with the article referenced in the submission is that percentages of vulnerabilities change based on the problem domain. The main threat for web facing services isn’t memory safety but that’s because most web facing services already use memory safe languages like JS, Java/JVM, Python, Ruby, or Go. It’s weird to pick Rust for its memory safety for web services. The reason to pick Rust is because you get C/C++ like performance without the memory safety issues. If you don’t need the perf, all the other languages are better choices because you’ll probably move quicker.
It’s interesting that 20% are still memory vulnerabilities. Assuming this is all the same class of attacks on web services, that means 20% of applications do care about perf and have exploitable memory safety issues. Or the methodology is shoddy and they’re comparing different classes of software. Regardless, the premise of the first article is flawed and rife with statistical analysis problems that paint a misleading picture while the response isn’t infusing me with a lot of confidence on the merits and comes off as unnecessarily fanboish trying to stretch for a reason of “but no rust still makes sense”. 70% of vulnerabilities in Chrome are memory safety. This holds for similar classes of software written in c/C++ (eg Windows). There’s a reason all major c/c++ codebases have started getting grass roots and organizational support to transition away as quickly as possible.
The richer and stricter type system of Rust makes such errors a lot less likely. And if an error escapes, there usually is a way better indication of the origin of the error than just 'None'.
Caml Light, SML, OCaml, Haskell, F#, Scala, and whatever else is out there.
Most of them also come with a REPL, and have multiple toolchains, no need for always be waiting for the compiler.
In particular a strong point of Rust is that C programmers feel comfortable switching to Rust in way that has not happened with other safe languages.
It's much more common to go from C to Python, Go or even Zig, rather than Rust.
I think the C++ to Rust transition is by far the most common one.
I don't see this at all. C++ programmers might be switching, but C programmers aren't reaching for Rust when they need something better than C.
Python well, it isn't as if Rust is on the same level of developer experience and friendliness.
With CPython finally getting a JIT, and Mojo, I don't force that happening long term.
In any case, hardly changes the fact of not being Rust specific type system features not available anywhere else.
Weak type checking at interface boundaries allows for all kinds of errors including vulnerabilities.
A famous class of vulnerabilities due to poor type checking is SQL injection.
Using Rust doesn't change how those folks keep concatenating strings.
Lets not forget a competent type system as well. Go/Java are decent, but i'd not even consider dynamic langs these days for any remotely complex project. I just don't believe in the benefits of a dynamic system.
I use Rust in areas that otherwise don't require it in part because i prefer the type system.