Live data from Hacker News

Is C++ Doomed?

tednesday.wordpress.com

1–10 of 168 posts

Re: Is C++ Doomed?

#3
Gonna be a long while before safety and certification bodies for industries like aerospace move away from C++. All the tools for the past few decades focus on C++ as the main systems language in these cases.

Rust is great as a spiritual successor with more stable performance (in general) but the institutional inertia with C++ is strong.

Re: Is C++ Doomed?

#5
It's true that implementing a standard library in C++ seems daunting but

a) most C++ users don't implement stuff that goes into the standard

b) you can tailor your data structures to the problem at hand instead of making it usable with every type and use case

c) quoting Stroustrup: "There are only two kinds of languages: the ones people complain about and the ones nobody uses".

Re: Is C++ Doomed?

#7
On a long enough timeline I do believe C++ is doomed or will otherwise become something completely unrecognizable from its current form. Similar to how C++98 code is wildly different than modern C++ code. People often ask, "is C++ a good language?" or "is XXX better than C++?". Doesn't really matter, what matters is whether people are willing to pay the "tax" of learning/using/maintaining C++. C++ is a generalist language and new languages are competing with it by specializing in different areas. If I am going to use something as unergonomic and perilous as C++ it needs to be for some advantage but looking into the future and comparing to newer language, that advantage is becoming less clear.

Re: Is C++ Doomed?

#8
post #3

Gonna be a long while before safety and certification bodies for industries like aerospace move away from C++. All the tools for the past few decades focus on C++ as the main systems language in these cases. Rust is great as a spiritual successor with more stable performance (in general) but the institutional inertia with C++ is strong.

What's the state of Rust/C++ interop currently? Naively it seems like allowing Rust in C++ projects could be a reasonable way forward, but I haven't tried it personally yet.

Re: Is C++ Doomed?

#10
post #8
post #3

Gonna be a long while before safety and certification bodies for industries like aerospace move away from C++. All the tools for the past few decades focus on C++ as the main systems language in these cases. Rust is great as a spiritual successor with more stable performance (in general) but the institutional inertia with C++ is strong.

What's the state of Rust/C++ interop currently? Naively it seems like allowing Rust in C++ projects could be a reasonable way forward, but I haven't tried it personally yet.

It's fine, works well enough. Challenges are passing data across the boundaries as the data types need to conform to both sides. E.g. using a string in both languages without doing copies means using a C-style string and now you've lost some expressiveness in both languages.

Second challenge is smoothness of integration in build systems. In C++ you might use CMake, in Rust you use Cargo, so now who is authoritative? Do you use Cargo to build the C++ code? Do you build your Rust projects in CMake?

Post reply on HN