Hacker News new | ask | show | jobs
by cogman10 1512 days ago
Honestly, I think the shift you are already seeing is from C++ -> a GCed language (python, javascript, java).

While C/C++ are everywhere, they are mostly in very low level places. You don't find a lot of new backend projects that go the C++ route.

Rust will likely eat up a significant chunk of C++'s current market share and SOME of the backend service market share (where CPU and Memory are REALLY important). However, I don't find it terribly likely that it will grow much beyond that.

As for the Cobol analogy, a good one, but you have to also realize there are about 1,000,000x more lines of C++ in the wild than Cobol. For cobol to die takes some institutional investment that most companies are not willing to burn. C++ will have a MUCH harder time being purged.

2 comments

If I was in a situation where c++ made sense for a greenfield project, rust would almost certainly be a better choice.
Except not having the libraries, IDE tooling and graphical debuggers that make C++ still relevant.
I agree those are downsides. But I think memory safety matters more in the problem space where c++ is relevant. I understand that's debatable, but I think the historical evidence suggests that it is impossible to write memory-safe c++ code beyond a fairly low complexity threshold.
Indeed, however memory-safe c++ isn't on the top list of what makes GPGPU, HPC/HFT, LLVM/GCC relevant in the industry, as such, those ecosystems won't be jumping into Rust anytime soon.

Some recent examples, Apple recently added support for using Metal from C++ instead of Swift secure bindings, Android now supports Rust at the OEM layer, no roadmap for NDK/AGK support for anything beyond C and C++, Azure Sphere is "secure" yet SDK is all about C and C++ (no Rust plans), Khronos API ecosystem is all about C and C++, CUDA,....

Agreed the spaces you’ve enumerated make sense for c/c++ still because trading off memory safety is a sensible engineering decision given the current state of things. Unfortunately security vulns can still sneak in there though :/
> You don't find a lot of new backend projects that go the C++ route.

TBF, C++ was never a great backend language. Rust "the language" isn't either, but "Rust the package ecosystem" might be one day (because unlike C++, Rust is coming out of the "web hemisphere").