C++ Needs to Catch Up
242 points - today at 8:18 AM
SourceComments
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.
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.
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.
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.
I’m curious why? What happened? Why is C++ so dysfunctional when other languages (Python, JavaScript) make progress?
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
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.
The best research i know on the (admittedly understudied) subject is by Dan Luu: https://danluu.com/pl-tokens/ and subsequent articles.
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.
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.
- 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.
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.
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.
I do not want to fight with half baked alpha quality libraries and bindings.
> 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
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.
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.
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
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.
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.
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.
ok, this is sad
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.
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.
It's hard to catch up when new software is vibecoded.