Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

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.



sort by: page size:

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.

Rust is extremely interesting, but here's the thing: at this point it's going to be hard to dethrone a language like C++. Far too many excellent libraries exist for C++ and even recent but slightly more mature languages like Go will need at least a decade to catch up. Sure, you could write bindings but it's never going to be quite the same.

Interestingly, modern C++ is the closest production language there is to Rust in terms of compile time safety guarantees (though C++ is unsafe by default, and that’s a huge problem), type expressiveness, runtime behavior, and so on.

Also, many of the best Rust ideas have been backported to it.

I wonder if it’ll still be in second place after whatever new hotness replaces Rust in a decade.


This is a pretty good summary.

Not to pile on, because Rust is still in a fragile condition, but the point that Rust cannot, and never will be able to call, typical C++ libraries deserves a boost (no pun intended).

This matters because C++ has more facilities to encapsulate powerful semantics into libraries than any other language. People write libraries in C++ that cannot be written in other languages, routinely.

This makes it usually impractical to integrate Rust code into an existing modern C++ codebase, unless it implements a wholly independent subsystem. That matters because effectively all of the most demanding systems-level work, today, is conducted in C++, not C (old OS kernels and databases excepted).

The longevity problem also deserves attention. The normal, expected fate of any new language is to die. It practically takes a miracle to survive, and we have no way to predict miracles. So, we don't know if there will be anyone to maintain Rust code written today.

What will it take to survive? It comes down to numbers. Rust has an excellent adoption rate for a language at this stage. To survive, it might be enough were the rate to increase by two orders of magnitude.

You don't get that just by more and better publicity. It needs change. But the changes needed are, by experience, very, very unpopular among existing Rust users.

Rust will never displace C++ or C. C++ does things Rust can't. C will dwindle only as its user base retires, because C users actually like it for its failings: it makes them feel tough (or something). Rust is an overwhelmingly better language than Java or Go, and the world would be a better place if Rust were to displace them.

But neither of those has the specific problems that the borrow checker demands be solved. They have other, graver weaknesses. So, for Rust to displace them, its advocates will need to change their approach to appeal to users of those languages.

That will require at least a different build model that admits an order of magnitude faster builds, and a looser use of the borrow checker that generates less frustration. It might need accommodations to integrate in Go and Java projects, maybe including support for a JVM target, virtual call mechanism, and import of foreign Go and Java modules.

To get any of that, the project will need to excite people now in those environments with the prospect of easing their pain. Rust's advantage there is that their pain is great, and Rust could ease it.


I think a more important question is whether Rust will supplant C++ for new development at some point. Obviously, no one is going to rewrite the existing C++ code base from scratch.

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.


Rust is not equal to C++, not even language wise and certainly not from a tool / pipeline / libraries / knowledge side.

When you have legacy code, with millions line of code you just don't swap for something else for the sake of it might be better.

Adding a new language in a medium / large company is not an easy task.

I think Rust is a good contender for C++ "replacement" on the long term but it's a really difficult task and you need proper planning.


Rust is a better C++ more than a better C, it has similar goals to C++ of advanced zero-cost (at runtime) abstractions, not so much of being a portable assembly. Like C++ it can be an alternative to C in some contexts.

D intended to be a better C++, but that hasn't panned out well in practice for various reasons (one of them being the use of a GC and much of the standard library depending on it, though IIRC they're trying to fix that).


Rust will never replace C++. It is terrible langauge driven by terrible programmers.

The whole point of C++ is that it enables writing more powerful libraries, capturing semantics in libraries that can then just be used. C++ is still quite a lot more powerful for this purpose than Rust. Rust will get better at it, over time, but it has a long way to go and C++ is not siiting still.

Rust is still a niche language, and if its rates of adoption and improvement do not keep up, it will remain a niche language, and fade away like Ada.

I cannot imagine a serious programmer switching from C++ to Go. If you can, you have a much livelier imaginary life than I do.


C++ has massive adoption and billion of lines of codes in active use. IMO Rust is already superior syntax-wise in almost every area but C++ is going nowhere any time soon.

I'm sure some C++ codebases will outlive everybody posting in this thread.


As of now I don't see any problems with C++. I doubt Rust is going to offer something so much better that people will abandon the tools they already have for these benefits. Though, who knows? I never touched Rust.

Why not Rust? C++ is obsolete

Rust is trying to replace C++. If you were not in the market for C++ to begin with it's unlikely that Rust is going to excite you.

A lot of people working with C/C++ I know are looking forward to Rust, but the problem is that currently it's nowhere near as mature and widespread as former languages. I hope that will change in the near future as it looks like promising system language.

I disagree. There are a lot of us who want a higher level systems language, but don't think that C++'s kitchen sink approach is a good design. Those people are flocking to Rust already, and more people are coming because it's interesting or cool.

Rust doesn't have to beat C++. If Rust steals 1/10th of C++'s marketshare, it will have a viable ecosystem.


Rust will not in any case replace C++, in any core application area.

Rust might move in alongside C++, in some, in time. Or, Rust could still very possibly fizzle. That would be the normal course of events for a new language, barring a miracle as was dispensed to Javascript, Java, C++, and vanishingly few others.

Will Dart survive and thrive? Kotlin? Scala? Clojure? Go? All doubtful, based on prior experience. Having a lot of code and a lot of users does not seem to suffice. Many other languages had those, and faded. Ada even had $billions in backing, and faded.

What we can say confidently about Rust's future is that it is not certain to fade. The miracle has come in less deserving cases.


There are no niches where Rust can do better than C++. In many places Rust can, uniquely, match C++.
next

Legal | privacy