cppgm is an ultra-fast C and C++ compiler.
- Try it. incpption.com runs the compiler in a browser. There, cppgm compiles itself on your device.
- Read about it. How I Built a Compiler That Is Faster Than GCC and Clang explains how the reference compiler was built. The origins of the proect can be found in the blog series that begins with I Spent 2 Billion Tokens Writing a C++ Compiler So You Don't Have To.
- Take the course. This repository also includes instructions and tests that can be used as a scaffold for an agent to build its own C++ compiler with maximum efficiency. To try it, point your agent at cppgm-assignments. This export has the scaffolds, the handouts, the tests and the reference tools. Its references are generated by this compiler.
The C++ frontend follows the C++11, C++14 and C++17 profile with selected C++20 features. The C frontend supports C90, C95, C99, C11, C17 and C23 modes, including selected GNU extensions. C library coverage depends on the target SDK. See the C coverage inventory and the bare Wasm and WASI C23 library supplements.
| Backend | Target platforms |
|---|---|
| x86-64 | Linux (ELF), Intel macOS (Mach-O) |
| AArch64 | Linux (ELF), Apple Silicon macOS (Mach-O) |
| wasm32 | Bare WebAssembly (wasm32-unknown-unknown) and WASI (wasm32-wasip1) |
| wasm64 (experimental) | Freestanding C and GNU Wasm assembly with memory64 and table64. Link with an external Wasm linker. |
| i386 (experimental) | Linux ELF32, freestanding integer C and x86 real-mode boot code |
Linux 7.3.6 boots under QEMU with cppgm compiling and assembling every
target input in a small native AArch64 virt configuration. The build uses
LLD and exercises the native vDSO in userspace. Integrated assembly
cppgm also built the x86 kernel's 32-bit compatibility vDSO and real-mode boot
objects and booted the kernel under QEMU. In the broader Arm defconfig
build, cppgm compiled the AArch64 C, including the native vDSO. Clang
assembled that configuration's Arm code and built its AArch32 compatibility
vDSO. That configuration disabled kernel pointer authentication.
Coverage, exclusions and test scope.
Speedups compare cppgm with GCC or Clang at O3. Higher is faster. Where a cell
contains three badges, they show GitHub-hosted EPYC, GitHub-hosted Intel and
dedicated Intel, in that order. Green through red indicates the speedup, with
red at 0.50× or below. n/m means unmeasured and n/a means inapplicable.
An asterisk marks a measurement at least 10 commits behind main or outside
its history. At 100 commits behind, a gray stale badge replaces the speedup.
A gray Godot runtime badge with a dagger (†) means the reference binary's own
time moved by more than 5% since its last run on the same processor.
Measurement age
| Workload | Compile vs GCC ↑ | Compile vs Clang ↑ | Runtime vs GCC ↑ | Runtime vs Clang ↑ |
|---|---|---|---|---|
| Public programs | ||||
| index-cpp | ||||
| Internal C++ subset | n/a | n/a | ||
| Boost tests | ||||
| Godot headless |
The public suite covers 81 third-party programs. Index-cpp times 50 checksummed workloads using elapsed time. The internal C++ row measures compilation only. Godot includes SCons and linking. Boost builds with assertions enabled and executes the C++ tests natively. Public programs · index-cpp · internal C++ · Boost · Godot
Each backend builds the compiler, runs a SIMD workload, and runs the same public programs. The public subset uses the original sources and inputs for sorting, floating-point matrix multiplication, recursive search and a C++ prime sieve that uses virtual calls. Each execution must match the same stdout checksum on all three targets. The public-subset badge shows the geometric mean of the five CPU speedups against Clang. Click it for individual program results and the measured revision. Shared public workloads · Main benchmark runs
For native self-builds, the compile columns time building cppgm. The runtime
columns time the resulting compilers rebuilding the same sources. WASI compares
cppgm with Clang targeting WASI and runs the resulting compilers in Wasmtime.
The Wasm SIMD128 and scalar workloads time warmed exports in one engine.
Arm64 kernel timings include integer and floating-point NEON. On native Linux
Arm64, the full public and index-cpp suites compare cppgm with GCC and Clang
at -O3. The index-cpp runtime column summarizes the 50 checksummed workloads.
On Google Axion, 521b59b53 reached 0.966× Clang's throughput on the public
suite (81 outputs matched, 80 timed) and 0.979× on index-cpp (50 checksums passed).
On x86, QEMU can check the Arm executables and count guest instructions.
Native Arm self-build, application timings and hardware counters · Arm optimization results and instruction profiles · Earlier QEMU measurements
Native self-build reports · simdjson · PA37 workloads · WASI self-build · Arm kernels · Local Arm benchmark instructions · Native Arm measurements against Clang · Dedicated Intel measurements
- PA38 remains an optional C assignment. The C23 mode is experimental.
-Ozand the LTO flags are experimental.-Ozoptimizes for size.-flto=fulloptimizes consecutive source inputs together on Wasm, Linux x86-64 and both AArch64 targets. On these native targets, add-c -o combined.oto write a host-linkable ELF or Mach-O object. On AArch64,-fltois shorthand for full source LTO. On Wasm,-fltoshares identical function bodies when linking objects. Full LTO needs the source files in the same command and can use more memory. Keep competing weak and strong definitions in separate objects so the linker can select one.- Integrated assembly is complete for its documented x86-64 profile. It is not a general assembler.
- The compiler has no C++ standard library of its own. Use the library that is installed on the host.
- The compiler can contain bugs.
- The generated code can be slow for program shapes that the benchmarks do not cover.
The main target is Linux x86-64. Install a C++11 host compiler, GNU make, Bash, Perl and Python 3. Later checks also use binutils and a debugger.
make CXX=g++ CPPGM_HOST_CXX=g++
make test-report
make inceptionTo get only the compiler, check out dev/ without the course data and build
cppgm:
git clone --depth 1 --filter=blob:none --sparse https://github.com/vishvananda/cppgm.git
git -C cppgm sparse-checkout set dev
make -C cppgm/dev cppgm CXX=g++ CPPGM_HOST_CXX=g++To build with Clang, pass CXX=clang++ CPPGM_HOST_CXX=clang++. CC does not
select the C++ host compiler. Use one host toolchain for a whole build.
The releases provide the tools
and LowIR library for Linux x86-64, Linux AArch64, Intel macOS and Apple Silicon,
plus WASI modules and two source downloads. Choose cppgm-<tag>-source.tar.gz
to build the tools and library, or cppgm-<tag>-source-with-tests.tar.gz
to build them and run the assignment suites. See
reference and version exports.
The LowIR library guide covers object emission for x86-64, WebAssembly and AArch64 targets.
The macOS guide describes Intel macOS support and its optional checks.
More documents:
- ROADMAP.md: the assignment sequence.
- AGENTS.md: instructions for contributors.
- TESTING_AND_REFERENCES.md: validation and the reference policy.
The original C++ Grandmaster Certification course supplied early assignment material, tests and starter code. The cppgm authors have substantially revised, combined, renumbered and extended that material into this independent course of 38 assignments. The handouts, the harnesses and the reference compiler describe this version. A PA number here does not identify an original CPPGM lesson.
Copyright 2026 The cppgm Authors. Code and materials that the project maintains use the Apache License 2.0. Inherited material keeps its original notices. See LICENSE, NOTICE and AUTHORS.