The highly vaunted C++ language would become simpler and safer under a proposal dubbed Cppfront, an experimental C++ front end being floated by prominent C++ developer Herb Sutter.
Intended as a major C++ evolution, Cppfront is an experimental “syntax 1 to syntax 2” compiler designed to explore whether C++ can evolve to become “10x simpler, safer, and more toolable,” said Sutter in a GitHub repo on the project. Sutter is chair of the ISO C++ committee, the designer of various C++ features, and a Microsoft software architect.
An alternative C++ syntax would provide “a bubble of new code that does not exist today,” allowing C++ language designers to make arbitrary improvements such as changing defaults, removing unsafe parts, and making the language context-free and order-independent. Type and memory safety would be offered by default. The “second syntax” would also make it easy to write a parser and refactoring and other tools. The syntax also would double down on modern C++, making C++ 20 modules and C++ 23 import std
the default.
The Cppfront compiler is still a work in progress. The project itself actually has been in development for seven years but had its “coming out party” of sorts at last week’s CppCon conference in Aurora, CO. Cppfront builds with major C++ 20 compilers including MSVC, GCC, and Clang. Instructions can be found on GitHub.
Sutter’s project follows the recent revelation of Carbon, a planned experimental successor to C++. Created by Google, Carbon is an attempt to offer seamless, bidirectional interoperability with C++ while overcoming hurdles to evolving the language.