3 ms·
Why would it? As a C++ developer, I think Rust's main selling point (memory safety) isn't as big of a problem as it's made out to be. For every unsafe memory
by jlarocco 9y ago
Why would it?
As a C++ developer, I think Rust's main selling point (memory safety) isn't as big of a problem as it's made out to be. For every unsafe memory access that results in a crash or exploit, there are millions and millions of memory accesses that work just fine and never cause a problem. Tools like Coverity and Valgrind can catch a ton of errors, and its not clear Rust offers any significant advantages over C++ with Coverity.
Parallelism is nice, too, but C++ already has a ton of options there: OpenMP, MPI, TBB, OpenCL, standard library threads, boost/standard library async tools, etc.
On the other hand, as an end user, "written in Rust" or "written in <any language>" isn't something I care about. I don't even remember the last time I had a piece of software crash due to a seg fault, so a vague promise of being "safer" isn't good enough to accept an otherwise inferior product.
I guess to summarize, C and C++ developers are going to keep writing C and C++ and if Rust is going to take over the world, the people advocating for it will have to write better software in it and beat out software written in the other languages.
- xfer 9y agoCoverity is expensive and majority of software people use are open-source which don't make use of it(hence all the CVEs). As an end user running a server, i very much care about whether my web server has vulnerabilities. And the promise about safety is not vague, it has clearly defined semantics. To comment on your last point, it's seeing some light already, ripgrep is already beating grep in performance and is purely written in rust. And i agree that this is how rust will beat C++(if ever), by writing "better" tools than those already exist.
- AstralStorm 9y agoThen why Ada isn't used more in servers? See, people don't care about safety, they tend to want the language to get out of the way. C++ does that because it does not get in the way of a C standard library. Or other system specific stuff. Rust gets in the way enough that the benefit seems not worth it, and it brings few benefit in the server space over, say, Java if performance is not the paramount concern.
- jlarocco 9y ago> Coverity is expensive and majority of software people use are open-source which don't make use of it(hence all the CVEs). It's definitely an area where the closed source tools are ahead of the OSS alternatives, but there are open source (and free closed source) alternatives to Coverity. PVS Studio, for example, has a free download: https://www.viva64.com/en/pvs-studio/ https://www.viva64.com/en/pvs-studio/ > As an end user running a server, i very much care about whether my web server has vulnerabilities. And the promise about safety is not vague, it has clearly defined semantics. You say that, yet you're still running a ton of software written in C and C++.
- mmstick 9y ago> You say that, yet you're still running a ton of software written in C and C++. Nice assumption. Much of the software I use is actually implemented in Rust. And soon, I'll be using an operating system that's 100% written in Rust, with a 100% Rust Servo-powered web browser. It's only a matter of time. In addition, I've also implemented my servers (web server included) in Rust, and they have zero dependencies upon C/C++ software, so your entire point is rendered invalid.
- jjpe 9y agoIt 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.
- jlarocco 9y agoYour 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.
- mmstick 9y agoRust 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.
- jjpe 9y agoThis. 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
- mmstick 9y agoIt seems that you have a very misguided view of what Rust offers to the table. The main selling point of Rust is not safety. Safety is just a side effect of lowering the bar to achieving concurrency/parallelism, which has proven time and time again to be a major problem with C/C++. I can tell you right now that, among the top reasons that people choose Rust for, safety isn't even among the top three. For many, Cargo is the main selling point of Rust. Then there's the ADTs, move semantics and move-semantic-powered features(borrow checker & compile-time-checked state machines), compile-time static code analysis, FP capabilities, traits and trait-based generics, pattern matching, and the miscellaneous tools and communities surrounding Cargo / Rust. None of which you can obtain with C++. Not to mention how much better the syntax of Rust is compared to C++ -- being able to succinctly express complex patterns in simple, human-readable terms with no room for context-based ambiguity.