logoalt Hacker News

C++ Needs to Catch Up

190 points • by simonask • today at 8:18 AM • 193 comments • view on HN

Comments

teh • today at 11:09 AM

I feel almost every single point in this article. I spent the last 5 years of my life fighting c++ in a finance place. Something that should be a 20 minute job becomes 20 minutes & several hours of cmake because abseil in some deep dependency does c++ version detection and segfaults because std::string_view isn't compatible with its own version.

What makes this worse in finance is that you sometimes only get a binary library to link against so you have to add another 2 days to run the library in a subprocess with some kind of rpc interface on top because it's not link compatible.

I can't speak to the standardization saga but IMHO that really feels like they are arguing over areas that ultimately should be in libraries and where the exact details don't matter that much. There are interesting areas like verification (rust verus e.g.) where c++ contracts might help but by the time I'm getting value from that years will have passed when I can have 3 different tools right now in rust.

c++ has the weight of history and many large projects like llvm etc I can really tell the dam finally broke. I am currently interviewing and number of companies now have or are starting rust teams to replace their internal c++.

I think the author thinks it's possible for c++ to catch up but IMHO it's too late for that now. There are too many people like me who have burnt years on c++ and don't really want to go back.

➕ show 3 replies
nly • today at 9:06 AM

C has most of the same problems raised in the article. You'll notice there's no "C SDK" on all those third party SDK lists either. There's no universal package manager for C. No standard library worth a damn.

My personal view is APIs and behaviours should be standardized, not libraries. In that respect C++s efforts to figure out universal async I/O is a noble one unmatched by other languages. And it's a hard problem.

That's not to say it hasn't gone off the rails. The Sender-Receiver model has never 'clicked' for me. I think the ideas is alien and overly abstract and I've never seen anything elegant fall out of it on a single page. Coroutines on the other hand make sense. The C++ language implementation of them is elegant and versatile.

std::execution is a verbose mess.

At my employer pretty much all of our code is C++ and threads aren't used anywhere. As a result, I/O tends to go through our own APIs written to use an Linux ioring backend behind C++ coroutines, which yield to our own main event loop.

➕ show 5 replies
zarzavat • today at 11:00 AM

C++ is dying. The only thing keeping it going pre-AI was the large number of experienced C++ developers who had invested decades into learning the language, and I say this as one of those people.

AI makes it easier to write new code in Rust, easier to rewrite old code from C++, and easier to exploit C++ code.

There's no way back for the language, inertia will carry it for the next 10+ years but its eventual irrelevance is a certainty.

➕ show 4 replies
rdong8 • today at 5:39 PM

all the build system/package manager related complaints here are addressed with Bazel, which among other things:

- Supports C++20 modules - Makes it easy to use the newest compiler - Basically just works because of hermeticity - Makes build script surgery easy if you actually have to do it - Comes with a built in package manager and registry - Supports distributed caching and remote builds, which CMake is now trying to do: https://www.kitware.com/cmake-fastbuild-distributed-cached-a... - Was made from the start to be modular and programming language-agnostic other programming languages, unlike CMake, which is now trying to add Rust support: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Help/de...) - Most importantly, is already well adopted outside of C++ rather than being one more specialized tool you have to learn

Unfortunately CMake and its workarounds (header only, submodules, etc.) have been incredibly destructive and are a big contributor to the fear of changing/upgrading things we see with C++ users.

giancarlostoro • today at 5:10 PM

I'm surprised nobody's made an "experimental" standards committee for C++ where they can approve features that are being considered for C++ but not fully approved, orgs that build compilers could target approved experimental features, and we can all see what it functions like and looks like ahead of time, once proven, the official committee approves it.

I remember that for a long time a lot of Rust projects required the nightly compiler, and it put me off Rust for a long time, but a lot of those features came into the fold and now Rust is very well defined.

➕ show 3 replies
filipdobro • today at 8:47 AM

> Dependency friction in C++ is so punishing that authors advertise “header-only, zero dependencies!”

This article kinda sums up all frustrations I have with C++. Vcpkg seemed like a good fix at the time, but it needs so much more improvement and adoption.

A lot of good solutions to the raised issues in the article require us to rip the bandaid off, however I believe the community built around C++ has built their systems around the premise that it must remain stable and predictable.

➕ show 7 replies
Eji1700 • today at 10:07 AM

> C++ still owns bare metal, low-latency trading, game engines, GPU inference kernels, and decade-spanning binary ABI stability

I wonder how long many of these will last.

AI is absolutely a predator to C++ not a benefit as the author notes, at least in my untrained eyes. Any language that gives you consistent “pythonic” standards and compile time “if it compiles it runs” guarantees (or tries to) seems to perform VASTLY better with AI than the ones that can’t.

C++ has, as an outsider who’s talked to C/C++ coders and written less than 1000 lines, felt like it decided “yeah but if you want fast on bare metal you’ll put up with it” and left it there.

Rust was designed to come for that lunch and it sure seems like that time is upon us. I’ve no doubt that the most performant code may still be theirs, but if it’s not on a rocket it’s probably going to be Rust not C++ sooner than later.

With that in mind I’m extremely curious how much longer it’ll be the standard for games. Yes if you want cutting edge graphics and physics you’re going to be managing your memory and might as well go deep, but as more and more of my backlog looks like Probably Stolen or say more “demanding” Caves of Qud or Nuclear Option i wonder where that line starts to blur.

Given the whole “shipping” goal I don’t see the next generation reaching for something so “hostile” when good enough and easy to work with get the job done and don’t have “must trade every nano second” needs

➕ show 6 replies
rbnafo • today at 9:58 AM

One thing open source taught is that you don't need ISO committees to produce good, maintainable programming languages. C++ spent too much on bureaucracy and stopped being pragmatical. Nowadays only existing codebase prevents projects from moving to Rust.

➕ show 2 replies
codemastercpp • today at 5:35 PM

as much as i love c++, i think this is its time to go to rest

gignico • today at 9:56 AM

Those are all the same reasons why I switched to Rust after 20 years of C++. Not the borrow checker, even though it’s fine to have. Pattern matching and ADTs would be also appreciated these days…

marsten • today at 11:26 AM

C++ long ago decided not to touch the packaging problem, and seems intent on sticking with that choice. No doubt they wanted to avoid controversy.

In my "what if?" file of hypotheticals, I wonder what would have happened if C++ had gone all in on a Cargo-like dependency manager. Ruffled feathers, pissed people off. As the blogger points out, a lot of committee time spent on `std::` additions could have been avoided if dependency management was easy.

The long-term risk for C++ is becoming a maintenance language like Fortran. That happens when it's no longer a viable choice for big, new projects. I think C++ is getting close to that line, and has crossed it in several domains. Unfortunately the people making those greenfield decisions – new programmers, startups, entrepreneurs – are not at the table in C++ decisions so they tend to be forgotten.

➕ show 1 reply
naikon • today at 11:00 AM

I agree completely.

Memory safety is low on the totem pole for usability. I mean sure, it would be nice to have, but it doesn't reduce development friction in a meaningful way.

Standardization around the distribution of libraries and build process would be a game changer for C++.

My preferred stack right now is cmake/vcpkg/Qt + vendored in libraries for anything else, in which I am super productive, once scaffolding is set up. This is not a "plug and play" solution at all.

In my experience, as C++ projects become bigger, less and less of the standard library is used. In that sense, some of the largest projects I work on basically just use the C standard library, concepts, smart pointers, vector, algorithms and not much else. No std::threads, no coroutines, no std::(unordered_)map, etc, etc. Why? Because I need extension points in almost all of these, and the standard library is very hard to customize mainly because it is not build as part of the project.

What if the standard library (the non-compiler dependent part) was just another library on github? Then we could split it up, make it composable, and VERSION IT. Put the interface behind std::v1, std::v2 or whatever to prevent source conflicts and we're off to the races. No more locked-in useless regex, std::list etc.

Surac • today at 12:42 PM

The try to put everything and the kitchen sink into C++ in a most confusing syntax has made me flee to ansi c for performance and c# for luxury. C++ is not needed in my way of coding. Also most c++ are compiler specific and cmake makes everything even more complex

jillesvangurp • today at 10:07 AM

I'm kind of curious to see if somebody will come up with new languages and tools that are optimized for LLM usage. Rust and Go accidentally go in the right direction (strong typing, good development tools, etc.) but they are still optimized for people writing code manually. If you let go of that, the requirements could change.

It seems to me like a logical next step to start engineering tools and languages for a world where we don't have people tinkering with code bases anymore. What matters when working with LLMs is fast tools, strong typing and safety, etc. You want fast feedback loops that catches/pre-empts a lot of issues. The cliche of a Rust program that compiles probably working as intended is one of the big reasons it works so well with LLMs. But modern languages also have a lot of the syntactic sugar that makes things nice for people (sometimes at the cost of adding ambiguity) that is less relevant for LLMs.

➕ show 2 replies
semiinfinitely • today at 5:22 PM

no, c++ needs to die (and fast)

mirmor23 • today at 12:17 PM

(Ignoring legacy codebases); Even today, for a new project, C++ is likely the only cross-platform option if a rich desktop GUI is critical (EDA/CAD/GIS/Video etc).

Slint is still not professional grade (tried it over a year ago, and also its lack of widget variety and graphics toolkit is a big hole).

Avalonia might work if performance and footprint is acceptable to the app, and I'm not sure about the breadth of their native OS hooks, and window manager quirks.

➕ show 1 reply
im3w1l • today at 8:49 AM

One approach to consider for C++ would be for the community to adopt nix as the unofficial package manager. I think it could work very well for this. AI is like a gift from heavens for Nix, much more accessible now that you can ask for help with changing your config. And if you are a windows shop, maybe try wsl out its pretty good.

> Wiring axum, reqwest, serde, jsonschema, and rmcp takes 300 lines of idiomatic glue and compiles before lunch;

Ironically I have much higher expectations nowadays. When telling a model to make a hello world-tier project with some technology I expect it to add the dependencies compile and run in like 5 minutes tops

➕ show 4 replies
htfy96 • today at 5:26 PM

Unfortunately this post was removed from r/cpp due to being marked as AI slop

➕ show 1 reply
motbus3 • today at 10:12 AM

It is probably a skill issue, but it is much harder to learn c++ today.

You can read Stroustroup book and still got no idea on lots of important features.

I am not fond of this model to update the language every 2 years without providing resources to properly use it.

If are a cpp veteran you probably can find your way, but if you are not, it seems to me that the language makes the path to become one much harder now.

throw93933944 • today at 9:34 AM

I tried Rust for GUI dev (mainly QT) and quickly gave up. With LLM there is no need to migrate from C++ or Python, I barely read code, and it is memory safe by code audits.

I do not want to fight with half baked alpha quality libraries and bindings.

➕ show 3 replies
HeavyStorm • today at 11:48 AM

Maybe it's time to move on?

darkurge • today at 11:49 AM

I do not understand all the fuss to "save" a programming language. If a programming language is not "good" enough will not survive and another will come. What's the problem with that?

IshKebab • today at 9:49 AM

Let it die.

➕ show 2 replies
rfgplk • today at 1:02 PM

How long until people realize that a) most of these languages are effectively wrappers around LLVM IR b) you can direct LLMs to write directly in LLVM IR, bypassing the frontend parsing stage and c) writing your own custom language/compiler frontend is easier than ever.

humblefly • today at 4:48 PM

So weird to have an article that's obviously 100% AI-generated, but opens with the "author" boasting about their credentials.

But even ignoring this: the author appears to be an AI maximalist. For AI maximalists, programming is solved: it's something you do with agents, not human brains. So what does it matter that the socket API is lower-level and closer to the actual syscall interface provided by the OS than in some other languages?... Agents can write userspace C++ just fine.

pjmlp • today at 8:46 AM

C++ had a sweet frameworks spot when I learnt, Turbo Vision, Object Windows Framework, MacApp, PowerPlant, CSet++, Motif++, Tools.h++, POET,...

The ISO C++ group decided on a bare bones standard library for C++98, a thin layer on top of POSIX, with iostreams, and a last minute addition of Stepanov's HP STL on top, that only became developer friendly with C++11 lambdas instead of C++98 functor approach with operator() overloading.

To this day people are fighting to add into the standard library, basic stuff already covered by those 1990's C++ compiler frameworks, like string handling, networking protocols, UI frameworks,....

If only we had some kind of package management systems that could sort it out instead, and we do, but since ISO C++ does not acknowledge their existence, neither do most C++ shops, each project keeps their own approach, thus library writers have to decide with bubble their want to sponsor, or neither of them, leaving the integration challenge to the users themselves.

However, how much of this is still relevant when we have a tiny offshore team inside our graphics card, remains to be seen.

➕ show 3 replies
r_lee • today at 10:02 AM

You can either wait for all this to be addressed by the 50 C++ ISO committees, where they all come together and start making massive changes in the next year or so as the landscape is moving so fast

or you admit that this is a sinking ship, or rather a ship that no longer moves and you move onto the thing that actually is built from the ground up for modern practices, has a package manager, doesn't have a spec of CMake hell, just works, is heavily backed by the industry now, and overall probably has better ergonomics when taking into consideration the vast ecosystem

I think it's naive to think that this stuff will come together in time, or to try to force it to work when clearly it's just a fundamental issue and a limitation due to how C++ was brought up

C++ is now a niche language, and that's okay

iekeb • today at 5:35 PM

Vinnie Falco sounds like the name of a character from Goodfellas.

3form • today at 9:43 AM

Seeing the article title I was wondering, why do we need C++ to become another language like the others?

After opening the article, to paraphrase: "we need it so that it's easier to write the code that doesn't need reading".

I would say that if that's the premise, why would anyone need C++ to begin with? Just write the whole thing in Rust then like you did? There are many good changes mentioned and many I would like to see happen, but just because they are good changes, not because the language should work better with AI.

➕ show 1 reply
kelseyfrog • today at 5:30 PM

It not possible. C++ selects for very opinionated developers. It has to; being picky and choosy about the correct way to write C++ is how C++ devs survive in an environment that is at times actively hostile.

Strong opinions are a beneficial adaptation for the individual dev, but it results in very low group cohesion. No two devs agree, they're quick to point out flaws, and unwilling to accept things that are mostly good enough.

This is a disaster for a build system where judgement, tastefullness, and preference are even less clear than core language design. The trait that enabled developers to survive is actively working against their ability to collaborate as a group. You can see it here where 'this worked for me,' stories are met with hostility of, 'thats DOA.'

I don't see a way to turn that ship. It's a culture problem, not a technical one and solving social problems as if they are technical problems misdiagnosis the ailment.

feverzsj • today at 11:09 AM

Yet, C++ is still the core language behind every AI/ML framework/system. Musk even said they rewrote Grok with full C++ stack, because "Real men manage their own memory".

➕ show 1 reply
dist-epoch • today at 10:07 AM

C++ is the walking dead. Like COBOL, it will live forever, but nothing new will be developed in it.

➕ show 1 reply
fukaiall • today at 4:46 PM

Yeah lots of high-skilled C++ folks don’t really give a shit about borrow checker or RAII in Rust because they are already familiar with it in C++. It’s the ecosystem and package management part. If those Rust fanboys shut their fuck up then it is the most productive language now.

brettermeier • today at 11:50 AM

I'm glad that C++ always seemed too complex and old-fashioned to me, which is why I never really got into it. People used to think you'd be shooting yourself in the foot by not knowing it, since C++ was the mother of all programming languages. I think it's a good thing that turned out to be not true, and it is nice that no one has to use this outdated stuff for modern projects anymore.

mac3n • today at 1:46 PM

s/Catch Up/Die/

locknitpicker • today at 9:54 AM

As a long time professional C and C++ developer, I completely agree with the blogger's sentiment, particularly about Rust's value proposition. Contrary to the talking points parroted by the infamous Rust fanboy community, the borrow checker and vague notions of "security" are not Rust's key feature. What makes Rust stand out is it's improvements in developer experience. Part of this is Rust benefitting from decades of lessons learned in ergonomics and API design, part of it is providing a packaging system that is simple and just works.

If you make people's lives easier, they will use you to solve their problems. There is no merit in making life difficult.

The cliche is that the OS's package manager is C and C++'s packaging system. Whenever anyone wants a C++ library, they just run deb/apt/rpm/apk and they have it. But this sucks. Then there is Conan and the like, but they are far from dominant. So ultimately C amd C++ developers are faced with the prospects of having to distribute and consume their libraries as standalone source packages and build their own. This sucks.

Where in Rust you'll just cargo your way into a dependency. Easy.

➕ show 2 replies
z3ratul163071 • today at 11:02 AM

it will, the committee is asap scheduling to schedule the next meeting as early as summer of 2027. from there on it is smooth sailing with the new standard already ready as early as 2035!

attila-lendvai • today at 8:49 AM

i used to know everything about C++... what a waste!

➕ show 1 reply
tonyhart7 • today at 10:59 AM

"C++ is the language of AI because PyTorch, TensorRT-LLM, CUDA, and llama.cpp run underneath"

ok, this is sad

topspin • today at 10:42 AM

I think an example of non-dysfunctional C++ that supports the arguments in this post has to be what Espressif has done with ESP-IDF. Much of the power of that platform is found in the working package management, endemic CMake, FreeRTOS batteries and uncompromising CLI tooling. These work together smoothly and much of the workflow that the post wishes existed for conventional C++ is found in ESP-IDF. AI absolutely thrives in ESP-IDF.

It isn't flawless. Builds can take longer than one would wish, for one thing. But you can haul in a dependency with one line of CMake, use whatever FreeRTOS facilities you need to do whatever you need done, build, flash and it "just works." All I know is that if non-embedded C++ worked like that, C++ would be in a much better place.

rramadass • today at 12:27 PM

The article only states that the author doesn't like std::execution, thinks coroutines are the bees knees, the tool ecosystem around C++ is not unified (like for Rust) and hence some trouble to setup, some criticisms of the standards committee (everybody has an opinion) and that's it.

And yet people are reading what they want into it.

There are tons more code in C/C++ than most other languages and given its origins there is bound to be some difficulties since it started out with different assumptions i.e. the onus is on the programmer to put together everything. Since it is already being modernized (albeit slowly) i really don't see the hoopla around gloom and doom.

AI workflow is being optimized around tooling which is certainly better for other modern languages but in no way is it a hard limiting factor i.e. C++ will soon be made "AI-friendly" even though not standardized. If there is one thing i can say for the standards committee they do understand current sentiments/needs and do work towards making C++ better to fit in.

r2vcap • today at 10:50 AM

[dead]

Jasonsf737 • today at 9:59 AM

[dead]

qmplayveil • today at 12:23 PM

[dead]

Woshiwuja • today at 9:23 AM

[dead]

mk89 • today at 9:18 AM

My experience with LLMs: by default they choose Rust (backends, clis, etc.), Javascript (front-end), or Python (scripts, etc). .

It's hard to catch up when new software is vibecoded.

➕ show 1 reply
tontinton • today at 8:55 AM

Or not? who cares about deprecated tech?

➕ show 3 replies