TypeScript was developed to address several key challenges faced by developers working with JavaScript, particularly in large-scale applications. Indeed, TypeScript is a superset of JavaScript that introduces optional static typing and other features to enhance the development experience, particularly for large-scale applications. Its history reflects the growing need for better tooling and structure in JavaScript development.
Browsers do not understand TypeScript directly; therefore, it must be transpiled into valid JavaScript before it can run in a browser.

CppFront, created by Herb Sutter, is an experimental tool designed to explore Cpp2, an alternative syntax for C++ that aims to improve the language's usability, readability, and safety. Much like how TypeScript enhances JavaScript by adding type safety, modern syntax, and error detection, CppFront seeks to bring improvements to C++ while retaining compatibility with existing code and libraries.
And like TypeScript, Cpp2 is designed to work by first converting Cpp2 code into standard C++ code before compiling. The tool that makes this possible is called CppFront, which plays a role similar to the TypeScript compiler.
Herb Sutter presented Cpp2 two years ago and is still actively working on it:
CppFront was introduced to help developers explore a safer and more expressive way to write C++ code. Here's how the process works:
1- Cpp2 Syntax Parsing
When you write code in Cpp2, you use a simpler and safer syntax than traditional C++. Cpp2 aims to reduce common C++ pitfalls, introducing features like explicit ownership models, safe pointers, and modern control structures. Cpp2 code still represents C++ constructs, but its syntax encourages safer and more maintainable programming.
2- CppFront Translation to C++
CppFront takes this Cpp2 code and translates it into standard C++ code, that conforms to C++20 or earlier standards. This conversion involves mapping Cpp2 constructs to their equivalent C++ structures, preserving behavior while improving readability and safety. For example, contracts and pattern matching in Cpp2 are reinterpreted in C++ code so that existing C++ compilers can understand them.
3- Compiling with a Standard C++ Compiler
Once CppFront has converted the Cpp2 code to C++, you can compile it using any standard C++ compiler (like GCC, Clang, or MSVC). This ensures compatibility with the existing C++ ecosystem, libraries, and tools.
This source-to-source translation approach allows Cpp2 to be backward compatible with C++ while letting developers incrementally adopt safer syntax, much like TypeScript’s design of compiling to JavaScript.
Conclusion
TypeScript began as an experimental project, and Microsoft officially announced its first public version in 2012. Today, TypeScript is a key player in the JavaScript ecosystem, offering developers powerful tools to create scalable and maintainable applications. Its growth reflects the broader trends in software development, where type safety and developer productivity are increasingly prioritized.
I hope Cpp2 follows a path similar to TypeScript, gaining widespread adoption over the next few years and helping make C++ development simpler and safer.
