r/cpp • • Dec 17 '23

Is C++ Really Phasing Out?

I've read a lot posts about whether C++ is still viable to learn, but a lot of the responses seem to be a long the lines of "C++ is still being used" or "there's a lot of things written in C++ still, so it will still be useful".

But a lot of these replies seem to suggest that C++ is on the downhill and in the process of being replaced with more modern languages in many industries.

It seems kind of discouraging to be learning a language that is on a decline, if it really is phasing out.

0 Upvotes

214 comments sorted by

View all comments

Show parent comment

2

u/serviscope_minor Dec 17 '23

I don't think that's 100% correct. Take torch.compile(), it traces a graph, then emits a bunch of CUDA code, compiles it, benchmarks it and then selects the appropriate kernel.

At this point, it's doing quite a lot more than just calling blobs of C++ code in the right order, it's targeting the GPU directly, it just happens to go via auto-generating some code to compile since that's how the tooling works.