4 ms·
Rust is promising but C++ is here to stay. If you have a legacy C++ code base, it is much easier to sell that you are just upgrading the compiler to get new la
by seren 10y ago
Rust is promising but C++ is here to stay.
If you have a legacy C++ code base, it is much easier to sell that you are just upgrading the compiler to get new language features, that you are rewriting everything from scratch.
Now we'll have to see in the next few years if, for new projects, Rust is chosen over C++ wherever it was used traditionally and in which proportion.
- bluejekyll 10y agoLike all legacy code, it will not be replaced. Now if people wanted to bifurcate their codebase they can easily add Rust libraries to existing C++ codebases. In my experience I find Rust to be more productive than C++ and easier to write. Obviously that's a pure opinion.
- Someone 10y ago"they can easily add Rust libraries to existing C++ codebases." Is that truly easy? I would expect all kinds of incompatibilities that would require going through a C layer (object layout, difference in virtual method calling, object ownership, etc). For example, calling a C++ function that takes a pair of iterators from Rust and returns a std::map, passing iterators pointing into a Rust hash table, is that easily done?
- bluejekyll 10y agoWell, it depends on the strategy you use, but yes, you're right that it's hard to share strict/objects. But if the API boundary between the two is kept simple and small, then it's simple. Take a look at the rust ffi omnibus that I posted in this thread. It's object examples show some decent strategies.
- seren 10y agoI do agree with you, and I hope this is the future. However, in big organizations, which are not exactly nimble, this is even hard to say, "Okay we've been developing in C++ for 20 years, now the next part of our infrastructure will be written in Rust". This will be seen as an unwanted risk, associated with a training cost. You will have to demonstrate unequivocally Rust's advantage.
- bluejekyll 10y agoYes, companies that don't want happy employees make these types of monetary decisions. It's their responsibility to their shareholders to do this. It comes at the expense of long-term support of their software though. There are long lists of dead languages still in legacy systems, C and C++ aren't there yet, but I think they are headed that way.
- Yoric 10y ago> There are long lists of dead languages still in legacy systems, C and C++ aren't there yet, but I think they are headed that way. I tend to agree with you (and I'm a big fan of Rust), but I'm nearly certain I heard people saying exactly that ~20 years ago. I don't remember which was the language that was expected to replace C/C++, perhaps Java or Obj-C or perhaps some variant of ML. So far, it hasn't quite happened. While C/C++ seem to have become much more niche languages in these ~20 years, I suspect that they won't become legacy language any time soon. Now, I may be wrong. Maybe some revolutionary Rust-base game engine (VR engine? IoT platform?) will shift the landscape drastically any day now, but that's hard to predict.
- pjmlp 10y agoWell I believe that if Microsoft had made .NET as they originally were thinking of doing, meaning having .NET Native in 2002 instead of 2016 and not having the internal fights between Windows Dev and DevTools, maybe C++'s role on the desktop wouldn't be what it has turned out to be. On the Apple side of the fence, C++ was mostly used for IOKit with everything else that wasn't inherited from UNIX, being Java or Obj-C. Only later on they decided to drop Java, focus on Obj-C and their C++ usage only increased when they decided to sponsor LLVM and move their toolchains to it. Now we have LLVM as one of the major research compilers available, including for Rust, with all three major desktop companies sponsoring it. However I think this is probably the area where they will stay, systems programming infrastructure.
- k__ 10y agoI think culture will do its thing here. Getting into C++ now is harder then getting into Rust.
- zbuf 10y agoFantastic observation and concisely put. I've heard people stating that C is gaining more ground that C++ and it could be for, I imagine, similar reasons. The poster asks whether new C++ will bring more improvements. It will certainly bring more... "more". And with it, the bar to entry is raised a little more; every new feature designed to resolve some issue or edge-case with a previous addition.
- k__ 10y agoI think the problem isn't a technical one. Mozilla seems to put much time into getting the community right, which will get much younger people on board. Then time will do its thing.
- vesak 10y agoJava is promising but Cobol is here to stay. Kind of true, but one can rise in popularity while the other dwindles, even if not completely dying. Thing is that 90% of new developers who get to see both Rust and C++ will choose Rust.
- FT_intern 10y agobut the companies that they want to work for have codebases in C++