Memory safety issues and Undefined Behavior (UB) are not bugs in C++ — they are deeply embedded in the language standard. Features like macros, header files, partial template specialization, SFINAE, and complex initialization rules make evolution extremely difficult. Any significant change risks breaking vast amounts of existing legal code. As a result, the committee must either preserve backward compatibility (including dangerous UB) or introduce new parallel mechanisms, which further increases language complexity.
The paradox is clear: the more established C++ becomes, the harder it is to improve. Organizational inertia, conflicting interests between compiler vendors, library authors, corporations, and independent experts, and the need to maintain zero-overhead principles all contribute to gridlock. Only features that barely conflict with anything can be added quickly. For a language that claims to be the primary tool for systems programming, this has become its Achilles’ heel.
The Paradox of Modern “C++ Killers”
This explains why new “C++ killers” appear regularly. Almost every new systems programming language has at some point been promoted as a successor: safer memory model, better concurrency, clearer errors, and a more modern development experience. Many of them are successful in their niches and often superior to C++ in ergonomics and safety.
However, they have largely failed to displace C++ in large existing codebases. The main reason is not syntax or compiler quality — it’s compatibility.
C++ is much more than a language. It is an entire ecosystem: ABI, calling conventions, binary interfaces, build systems, linkers, debuggers, profilers, sanitizers, millions of lines of build scripts, header-only libraries, and deeply ingrained coding culture. A new language with its own compiler (even if based on LLVM) inevitably creates a new set of integration barriers — mixing modules, linking with existing libraries, debugging, exception compatibility, name mangling, and cross-platform behavior.
While Foreign Function Interface (FFI) sounds good in theory, in practice “extern C” is far too limited for real C++ interoperability involving templates, inlining, overloads, SFINAE, and header-only libraries.
Modern C++ killers have forgotten a crucial historical lesson. The first C++ compiler, cfront, was a transpiler that converted C++ (“C with Classes”) into plain C. This allowed it to instantly leverage all existing C compilers, linkers, and tools. The barrier to adoption was dramatically lowered.
In contrast, modern replacements build their own compilers and ecosystems. While this gives better diagnostics and coherence, it creates a high compatibility wall. As a result, they become viable only for greenfield projects, not for gradually replacing C++ in massive legacy codebases.
What a Real C++ Successor Should Look Like?
The most realistic path to a true C++ replacement is a transpiler that generates C or, more likely, C++ as its output.
A transpiler provides the most critical feature at C++ scale: incremental adoption. You can migrate one file, one component, or one subsystem at a time without rewriting everything. The build system, linking, ABI, and tools remain unchanged.
The new language becomes a frontend that gradually conquers territory within the existing C++ world rather than demanding an entirely new one. It can enforce safety by default while allowing explicitly marked unsafe sections where necessary. Most importantly, it can be compatible not just with C, but with the entire C++ ecosystem.
Transpilation has its own challenges — code quality, debug information, readability, and dependence on C++ compilers — but these issues are often more manageable than rebuilding the entire infrastructure from scratch. And the winner will likely not be the “purest” or most theoretically correct language, but the one with the lowest barrier to adoption in existing C++ codebases.
C++ itself won not because it was the best language, but because it integrated so easily with existing C infrastructure. The next major successor will probably follow the same path — starting as a transpiler that is first and foremost compatible, and only then safer and more convenient.
ссылка на оригинал статьи https://habr.com/ru/articles/1027490/