I think looking at this as a battle is not helpful to understanding the situation. In order to supplant C/C++, Rust (and Rust programmers) will need to operate in harmony with the existing ecosystem for decades.
This interoperability means that Rust programmers will need to also be good C/C++ programmers. Its not a binary OR, its more like diffusion.
Just as an example, the primary (or earliest) use of Rust is in Firefox. But Firefox is still a C++ project.
I actually think that the scenario of Rust versus C++ is going to be quite interesting to see unravel, precisely because I don't think one is going to definitively weaken the other, but both be on their respective tails. This is because of the abnormally dramatic evolution C++ has seen over the past 5 years or so, and is hectically continuing.
Though this has pretty much definitively made C++ too large for any single person, and there are some fundamental semantics that ensure Rust will always have the high ground in some areas, the lines related to functionality are getting blurrier.
I think Rust has an ambition to supersede C++ but in its current form it has only superseded C. C++ is still a significantly more expressive than Rust, which limits the ability of Rust to replace it.
It would be great if a modern language could match C++, but none is on the horizon.
Rust is powerful enough to do a lot of what C++ is used for, but not the hardest things. There are libraries you write routinely in C++ that you can't code in, or call from, Rust, and never will. The gap will widen with time. Rust is focused on low-level safety at the expense of library power, but you get safety in C++ by coding using more powerful and safe libraries, so C++ comes out ahead in the end.
Rust is a way better language than Go or Java. It would be excellent if Rust could displace them, or even just one of them.
If its adoption rate were to increase by maybe two or three orders of magnitude, it could survive. But the Rust core team seem not interested in doing what would be needed to get that much adoption, and hype alone won't get it there.
Rust's place will be secure when more complaints are written about it than paeans.
I think at this point, Rust will not really replace C++ just like how C++ never replaced C.
Given the learning curve of Rust and the lack of tools it's still a bit of a gamble to choose Rust over C or C++ IMHO. Why take that risk when the benefits aren't entirely clear cut.
What makes you think that rust is a long term replacement for c++? I'm neither a rustacean or a dogmatic c++ follower, but it'd pretty clear to me right now that rust isn't going to replace C++.
There is so much inertia in the field with both existing projects and new projects being written on C++, what seems more likely is you end up with a split akin to C vs C++
I have more faith in the evolution of rust than C++. C++ has a lot of backward compatibility pressure with large large companies. Rust is new and is already quite a good language.
That’s precisely the issue, until and unless enough libraries are created in Rust with little to no dependency on C/C++, it won’t be a significant language but will just be something similar to Haskell may be bit larger.
So I still feel Rust needs another decade or two to be able to claim as C/C++ replacement, not at present.
This is exactly the problem Swift faced to replace Objective-c, in Apple eco-system where everything controlled by Apple. Rust has much bigger hill to climb to be really useful systems programming language.
Also, nothing is even close to matching the ability of C++ to build against other C++.
Even if Rust had Rust alternatives for enough of the interesting niches, it will take a loooong time for all the relevant software to either get rewritten or reach end of life.
There is no chance of Rust "replacing" C++. There is no chance of it even cannibalizing many seats from C++. The net benefit is just not there.
But Rust is so overwhelmingly better than C, Go, Java, and C# for things people use those for, it may have a bright future replacing them, once its libraries and tooling mature enough. It will be competing with C++ on that, but there's room for both.
Such momentum is not so easily overcome. The roots of Chrome's codebase and LLVM are both significantly older than the very beginning of the Rust project, for example.
If Rust manages to actually supplant C or C++ it would very likely require decades and generational change.
If we are being honest, there is no actual competition between C++ and Rust. Rust is a darling of HN, but practically unheard-of outside these four walls. C++ is the workhorse of industry, and it will be for many years to come. The difference between last week's population of professional C++ coders and this week's is larger than the total number of professional Rust coders. That will be true next week, too.
At this point, it appears that Rust could well survive and become a mainstream language, eventually, but that is by no means assured. While that puts it well ahead of any other language created in this millennium, it is very far from ready to raise a family on.
Remember, Ada had far more investment and industry backing than Rust will have for a long time to come, but was wiped out. Fighter planes are coded in C++, not Ada.
I think you’re blissfully unaware of just how many developers are still being trained in C/C++ this day. I agree with you that in the long run, Rust has everything going for it to replace C++, but these types of things happen in a span of several decades, not years.
It's too early yet to make claims like that. Rust may or may not end up supplanting C++ in some areas, but even in the most optimistic case it definitely won't obviate C++ entirely.
Ha! Totally agree. I do think rust has a lot of potential to take a big bite out of c/c++'s current share. But that's 10 years away, because evolution is slow.
I also think that Rust has a bright future ahead, but C++ will probably live forever. There is a huge amount legacy code in C++, a lot of it tied to embedded systems that have service contracts that measure decades.
C++ didn't manage to displace C completely, I doubt that Rust will manage to displace C++. This is especially true now that C++ is seeing active improvement that makes it a lot more attractive for new projects.
I think looking at this as a battle is not helpful to understanding the situation. In order to supplant C/C++, Rust (and Rust programmers) will need to operate in harmony with the existing ecosystem for decades.
This interoperability means that Rust programmers will need to also be good C/C++ programmers. Its not a binary OR, its more like diffusion.
Just as an example, the primary (or earliest) use of Rust is in Firefox. But Firefox is still a C++ project.
reply