Hacker News new | ask | show | jobs
by jjpe 3255 days ago
It seems you are missing the point of Rusts safety. Yes that safety does prevent things like segfaults, but the real value is in security. As software becomes evermore critical to our lives in pretty much every aspect, having a system that can be derailed by malicious actors is not just unfortunate in the way that a segfault is, no. It is reckless. At this moment what we see is news about company X or Y being hacked,including some infrastructure like electrical grids. Fast forward a half decade and we will have people being hacked and killed from a distance. All made possible because of bugs.
1 comments

Your comment doesn't refute anything I've said.

How does Rust compare against C++ with Coverity? Because that's the real baseline Rust should compare to.

Rust refactor times are significantly faster than C++, and solutions can be implemented and deployed to production at a much faster rate, without the need to wait for Coverity scans to verify PRs. It enforces proper idioms at compile-time; makes it easier to implement and debug issues with threads; enables the capability to enforce correct API usage (See how Vulkano > C++ Vulkan; or Glium > C/C++ OpenGL) with the aid of additional type information and compile-time state machines; encourages developers to push towards zero to minimal-allocation designs due to the move semantics / borrow checker; opens the door to a wide range of compiler optimizations not possible in C/C++; enables rapid software development through automatically pulling Cargo dependencies from Crates.io, and making it simple to push crates of your own to the repos for others to use, resulting in much less reinventing the wheel, and more extensive testing of community solutions; not to mention the ADTs and pattern matching, and a significant number of additional features that C++ just doesn't have.
This.

Basically the net effects are a mix of: 1. Push more computation to compile time rather than runtime 2. Verify a lot more state at compile time, preventing dangerous or nonsensical state from occurring altogether 3. Because of 2,you get hard guarantees about the runtime state e.g there is no chance of encountering undefined behavior in safe Rust 4. Building, testing, and deploying are all quite straightforward in almost every Rust project. If you can get away with simple statistics, benchmarking is very simple too. The ones that don't typically have native non-Rust dependencies