C++ needs to catch up
A prominent C++ library author and advocate delivers a scathing critique of the language's current state, revealing why he chose Rust for a new project. He argues C++ is falling behind not due to memory safety, but because of its abysmal library ecosystem, fractured package management, and a misguided standardization process hindering practical progress. The Hacker News community is deeply engaged, debating C++'s future, Rust's ascendancy, and the role of AI in this ongoing language evolution.
The Lowdown
Vinnie Falco, a titan in the C++ community responsible for popular Boost libraries like Beast, JSON, and URL, and president of The C++ Alliance, has made a surprising confession: he chose Rust for his latest project, Runvil, an AI prompt runtime. His decision wasn't driven by Rust's memory safety but by sheer development velocity and ecosystem maturity.
Falco details several critical issues plaguing modern C++ development:
- Ecosystem and Package Management Paralysis: C++ lacks a coherent, composable library ecosystem and a unified package manager like Rust's Cargo. Building cross-platform applications in C++ becomes a laborious "CMake surgery" involving vendoring dependencies, while Rust offers one-line imports for powerful, composable libraries (e.g.,
tokio,serde,reqwest). This friction leads to developers advertising "header-only, zero dependencies" as a virtue, a stark contrast to Rust's embrace of deep dependency trees facilitated byCargo.lock. - AI Won't Save C++ (It Accelerates Its Decline): Contrary to popular belief, AI coding agents amplify the need for rich, uniform package ecosystems. LLMs struggle with C++'s fragmented build systems and lack of standard libraries, producing broken code for complex tasks, whereas they thrive on Rust's well-defined crates. Benchmarks show AI agents performing significantly worse on C/C++ tasks than on Rust.
- The Standardization Gold Rush: Falco lambastes the ISO C++ committee's standardization process, which he argues prioritizes "career trophies" (like
P2300Senders/Receivers) over practical needs. He contends thatP2300is an unnecessary, over-engineered library solution that actively undermined C++20 coroutines, stalled standard networking, and introduced immense complexity without real-world deployment proof, ultimately harming the language. - Missing the Forest for the Trees on Memory Safety: While acknowledging the importance of safety, Falco asserts that even a magic solution for C++ memory safety wouldn't address its core problem: the inability to easily build modern applications (web servers, AI apps, desktop UIs) due to the lack of composable libraries and tooling.
Falco proposes a path forward: embrace C++20 coroutines, build a user-space composable library stack (exemplified by Boost.Capy and Boost.Corosio), and provide opinionated project templates with automated dependency gates. He argues that C++'s strengths in bare metal and ABI stability are worth fighting for, but only a living, evolving library ecosystem built outside the slow ISO process will allow C++ to catch up and attract the next generation of builders.
The Gossip
C++'s Convoluted Conundrums
Many commenters resonate deeply with the author's frustrations, echoing common pain points in C++ development. Themes like the arduousness of CMake, ABI incompatibility nightmares between libraries and compilers, and the perceived glacial pace or misdirection of the ISO standardization committee are widely discussed. Multiple developers recount spending days wrestling with build systems for what should be simple tasks, often citing `abseil` and `protobuf` as specific culprits for dependency hell. There's a strong sentiment that C++'s 'general-purpose' claim is undermined by its practical inability to deliver rapid MVP development due to these systemic issues.
The Rust Revolution Rolls On
A significant portion of the discussion centers on Rust as the inevitable successor to C++. Many C++ veterans express burnout and a strong desire to switch, or confirm that their organizations are already forming Rust teams. Commenters highlight Rust's superior package management (`Cargo`), 'if it compiles it runs' reliability, and better AI integration as key advantages. While some debate performance parity, with a few anecdotal claims of C++ retaining a slight edge in highly optimized loops, the general consensus leans towards Rust offering a more productive and less 'hostile' development experience for modern applications. The idea that AI will accelerate this transition, by making Rust easier to write and C++'s problems more apparent, is a recurring point.
AI's Ambidextrous Aid (or Annihilation)
The role of AI in the future of C++ and other languages sparks considerable debate. Some commenters agree with the author that AI multiplies the benefits of a rich ecosystem, thus favoring Rust. They suggest AI makes rewriting C++ to Rust easier and highlights C++'s inefficiencies. A fascinating tangent explores OpenAI's internal 'DIL' language, potentially designed *by* and *for* AI, suggesting future programming paradigms might diverge significantly from human-centric design. Conversely, some argue AI could 'save' C++ by making its complexities manageable, acting as a 'copilot' to navigate its pitfalls and generate fixes, thus reducing the incentive to switch.
C++'s Stalwart Strongholds and Stubborn Survival
Despite the critiques, several commenters argue that C++ will retain its niche and maintain relevance for decades. Traditional strongholds like game engines (Unreal, AAA titles), low-latency trading, GPU inference kernels, and embedded systems are frequently cited. The sheer volume of existing C++ codebases and the high cost of rewriting them are presented as significant factors ensuring its longevity, likening its persistence to Fortran or COBOL. However, others counter that even in these areas, Rust is making inroads or C++ components will increasingly be hidden behind FFI wrappers, further reducing its direct developer exposure.