# hsutter/cppfront

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hsutter-cppfront).**

5,964 stars · 267 forks · C++ · NOASSERTION

## Links

- GitHub: https://github.com/hsutter/cppfront
- awesome-repositories: https://awesome-repositories.com/repository/hsutter-cppfront.md

## Description

cppfront is a C++ language extension frontend and source-to-source translator. It functions as a syntax transformer that converts experimental language extensions into standard compliant C++ code, allowing for the prototyping of new language features within existing build systems.

The project provides a translation layer that adds support for pattern matching, contracts, and string interpolation. It includes a metaprogramming tool for compile-time reflection and automated code generation using specialized metafunctions.

The system automates several development tasks, including the resolution of dependency order through automatic forward declarations and the management of parameter passing modes. It also applies static analysis to insert automatic bounds checking and optimize resource management by applying move semantics at a variable's last point of use.

The tool includes a verification mechanism to ensure that standard source code remains unchanged during the translation process to prevent syntax regressions.

## Tags

### Programming Languages & Runtimes

- [Language Prototyping Toolkits](https://awesome-repositories.com/f/programming-languages-runtimes/language-prototyping-toolkits.md) — Enables experimentation with new C++ syntax and features by translating them into standard compliant code.
- [Language Extension Frontends](https://awesome-repositories.com/f/programming-languages-runtimes/c-language-extensions/language-extension-frontends.md) — Provides a translation layer that adds support for pattern matching, contracts, and string interpolation to C++.
- [Pattern Matching](https://awesome-repositories.com/f/programming-languages-runtimes/pattern-matching.md) — Translates high-level pattern matching expressions into standard C++ conditional logic.
- [Compile-Time Meta-Programming](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/type-systems/type-checking-disciplines/statically-typed-languages/compile-time-template-programming/compile-time-meta-programming.md) — Enables compile-time reflection and automated code generation using specialized C++ metafunctions.
- [C++ Source-to-Source Translators](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers/c-source-to-source-translators.md) — Converts experimental C++ syntax into standard C++ code to enable prototyping of new language features.
- [Metafunction Code Generators](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers/source-to-c-transpilers/inline-c-code-embeddings/c-code-generators/metafunction-code-generators.md) — Implements a system for compile-time reflection and automated code generation using specialized C++ metafunctions.
- [Automatic Move Semantics Optimization](https://awesome-repositories.com/f/programming-languages-runtimes/automatic-move-semantics-optimization.md) — Automatically applies move semantics to variables at their last point of use to optimize resource management. ([source](https://hsutter.github.io/cppfront/welcome/hello-world/))
- [Embedded Regular Expression Syntax](https://awesome-repositories.com/f/programming-languages-runtimes/embedded-regular-expression-syntax.md) — Provides specialized syntax to embed regular expression logic directly into the language for more efficient validation. ([source](https://hsutter.github.io/cppfront/))
- [Forward Declarations](https://awesome-repositories.com/f/programming-languages-runtimes/forward-declarations.md) — Provides automatic generation of forward declarations to eliminate the need for specific definition ordering in source files.
- [Parameter Passing Constraints](https://awesome-repositories.com/f/programming-languages-runtimes/parameter-passing-constraints.md) — Automates the selection between value and reference passing using standardized parameter modes. ([source](https://hsutter.github.io/cppfront/welcome/hello-world/))
- [Software Contract Systems](https://awesome-repositories.com/f/programming-languages-runtimes/software-contract-systems.md) — Introduces specialized syntax for defining preconditions and postconditions to ensure software correctness through contracts. ([source](https://hsutter.github.io/cppfront/))
- [String Interpolation](https://awesome-repositories.com/f/programming-languages-runtimes/string-interpolation.md) — Adds support for embedding expressions into string literals using simplified syntax for automated value capture and formatting. ([source](https://hsutter.github.io/cppfront/welcome/hello-world/))
- [Syntax Automation Layers](https://awesome-repositories.com/f/programming-languages-runtimes/syntax-automation-layers.md) — Simplifies development by automating forward declarations and managing parameter passing modes through a translation layer.
- [Syntax Transformers](https://awesome-repositories.com/f/programming-languages-runtimes/syntax-transformers.md) — Automates forward declarations and applies move semantics to optimize resource management.

### Part of an Awesome List

- [Experimental Syntax Support](https://awesome-repositories.com/f/awesome-lists/devtools/parsers-and-language-support/experimental-syntax-support.md) — Converts experimental source code into standard syntax to enable new features within existing build systems. ([source](https://github.com/hsutter/cppfront#readme))
- [Mixed Syntax Parsers](https://awesome-repositories.com/f/awesome-lists/devtools/parsers-and-language-support/experimental-syntax-support/mixed-syntax-parsers.md) — Handles source files containing both standard and experimental syntax within a single compilation unit. ([source](https://hsutter.github.io/cppfront/))
- [Compile-Time Metafunctions](https://awesome-repositories.com/f/awesome-lists/devtools/reflection-and-metadata/compile-time-metafunctions.md) — Ships a metaprogramming tool that uses compile-time reflection and specialized metafunctions for automated code generation. ([source](https://hsutter.github.io/cppfront/))
- [Developer Tools](https://awesome-repositories.com/f/awesome-lists/devtools/developer-tools.md) — Experimental C++ syntax compiler

### Development Tools & Productivity

- [Language Extension Transformers](https://awesome-repositories.com/f/development-tools-productivity/ast-transformation-tools/ast-to-source-conversion/ast-based-source-transformations/language-extension-transformers.md) — Translates experimental C++ language extensions into standard compliant code via a syntax transformation pipeline.

### Software Engineering & Architecture

- [Compile-Time Metaprogramming](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/abstraction-domain-modeling/compile-time-architectural-patterns/compile-time-metaprogramming.md) — Provides a reflection system to execute metafunctions for introspection and automated code generation during compilation.
- [Source-to-Source Translation](https://awesome-repositories.com/f/software-engineering-architecture/syntax-tree-analysis/source-to-source-translation.md) — Implements a multi-pass source-to-source translation pipeline to convert experimental extensions into standard compliant C++ code.
- [Declaration Order Resolution](https://awesome-repositories.com/f/software-engineering-architecture/automatic-dependency-resolution/declaration-order-resolution.md) — Automatically generates forward declarations so functions and types work regardless of their definition order. ([source](https://hsutter.github.io/cppfront/welcome/hello-world/))
- [Instrumentation Generators](https://awesome-repositories.com/f/software-engineering-architecture/variable-usage-analysis/instrumentation-generators.md) — Automatically inserts bounds checking and move semantics based on static analysis of container sizes and variable lifetimes.

### Operating Systems & Systems Programming

- [Automated Memory Optimizations](https://awesome-repositories.com/f/operating-systems-systems-programming/manual-memory-management/c-memory-management/automated-memory-optimizations.md) — Automatically applies move semantics and bounds checking to reduce memory overhead and prevent errors.

### Security & Cryptography

- [Runtime Bounds Checking](https://awesome-repositories.com/f/security-cryptography/memory-bounds-checking/runtime-bounds-checking.md) — Automatically inserts runtime checks on container subscript accesses to prevent out-of-bounds memory errors. ([source](https://hsutter.github.io/cppfront/welcome/hello-world/))
