Unlikely in the foreseeable future. If either C++ compiler or tooling around it (linters/static analysis) catches up with Rust compiler in terms of race condition/lifetime guarantees, then there is no chance of Rust replacing C++. Now how possible this is, I am not sure.
Not really possible. And, even if it got close, the difference between having these things caught immediately during compile vs. having to run a 10 minute analysis pass to hope to catch close to the same amount of issues is huge. It will always be a band-aid with C++.
C++ is about performance over safety these days. It would have to fundamentally change in order to give the tools enough information compete with Rust on the memory safety front. And it's just not going to fundamentally change at this point.
The technical reasons are many, and they've been gone over many times before. I'm not going to reiterate them here. Many of the problems are in the STL, but since almost everyone that uses C++ will use the STL (and yell down anyone who tries to create something better) they are one and the same for the purposes of this argument.
Classes like unique_ptr, shared_ptr, and vector have done a great deal for making C++ safer (to the point that I no longer think of memory safety as an issue). Additional new classes or language features can help in making C++ even safer. As with so many things, it doesn't have to be perfect; it just has to be good enough.
11
u/eyes-are-fading-blue Dec 07 '21
Unlikely in the foreseeable future. If either C++ compiler or tooling around it (linters/static analysis) catches up with Rust compiler in terms of race condition/lifetime guarantees, then there is no chance of Rust replacing C++. Now how possible this is, I am not sure.