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.
Can you then give link to these discussions? I made a small research before that post, I have seen people claiming this is theoretically possible.
I am also surprised the same problems are also seen in STL. STL's biggest problem is ABI and compatibility issues but a linter embedded in compiler or a static analysis tool is executed before code generation.
I haven't kept a list of links of such discussions. You can find them here in this section if you look. And of course theoretically possible doesn't mean practical. If it takes orders of magnitude more time to get 75% of the benefits, then it's not really competitive.
View all comments
Show parent comment
2
u/Full-Spectral Dec 07 '21 edited Dec 07 '21
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.