Show HN: A C++ Compiler That Is Faster Than GCC and Clang github.com · 6 points ...

@show

Show HN: A C++ Compiler That Is Faster Than GCC and Clang github.com · 6 points · 2 comments · HN thread

TL;DR The cppgm-extended repository is a 35-assignment C11 compiler course for AI agents, built around a reference compiler in dev/. The author says an agent run achieved self-hosting for under $500 in API tokens, and that the reference compiler compiles C about 4x faster than GCC and Clang. The author clarifies in comments that the speedup is in compile time, while generated code runs at roughly the same speed.

  • The course has 35 cumulative assignments (pa1 through pa35) covering preprocessing through native code generation, optimization and self-hosting, targeting C++11.
  • The author reports an agent-run reached self-hosting for less than $500 in API tokens.
  • The reference implementation is claimed to compile C++ about 4x faster than GCC and Clang; benchmark tables are in the README, with separate EPYC and Intel Xeon results.
  • In comments the author breaks it down: about 2.5x faster for unoptimized translation units, about 4x for optimized ones, and generated code at roughly 1.01x (unoptimized) and 0.99x (optimized) GCC/Clang speed.
  • Known limits: Linux x86-64 is the main target, Intel macOS is optional, general inline assembly is unsupported, no C++ standard library is bundled, and the compiler may contain bugs.
  • The project is Apache License 2.0 and descends in part from the original C++ Grandmaster Certification course material.

Discussion The thread is short, with two comments. The main exchange is about the title: a commenter argues that "faster than" should be "faster to compile than", since the generated code is only on a par with GCC and Clang. The author agrees, notes that "faster" is ambiguous, and posts a breakdown of compile-time and generated-code speed ratios. The mood is measured and mostly corrective rather than skeptical.

  • Title overstates the result; it is about compile speed (most): The commenter says the speedup applies to compilation, while generated code is only on a par with GCC and Clang. The author accepts this and points to the breakdown showing roughly 1.01x and 0.99x for generated code.
  • Impressive result despite the wording issue (some): The commenter calls the work very impressive, so the objection is to precision rather than to the achievement itself.

#cpp #compilers #aiAgents #benchmarks #selfHosting #showHN