March 7, 2026

Compile-time cult vs cozy Lisp vibes

Lisp-style C++ template meta programming

C++ cosplays as Lisp; fans cheer, skeptics fear laptop-melting compile times

TLDR: A new C++ trick mimics Lisp to create prime numbers during compilation. The comment thread fixates on whether this is genius or a build-time nightmare, splitting folks between wowed tinkerers and pragmatists begging, ‘please just use Lisp.’

C++ is dressing up as Lisp, thanks to a library that lets developers build lazy lists and filter them while the program is still being compiled. It needs the newer C++17 standard, and showcase trick is a classic: Sieve of Eratosthenes generating prime numbers before the app even runs. The top reaction? Curious excitement mixed with dread. As ahartmetz put it, “I wonder what it does for compile time,” echoing the long‑standing fear that these stunts turn a build into an all‑night event. Most readers cheered the clever, Lisp‑like feel, but kept one eye on the clock.

Then came the culture clash: Lisp loyalists rolled their eyes and muttered “just use Scheme,” while C++ tinkerers shouted “let us cook.” Meme parade followed—fans joked laptops might double as space heaters, and threatened to write a whole game in templates. Skeptics worried about team sanity: debugging code that runs during compilation sounds like a boss fight. Supporters countered that it’s a teaching tool and a flex, showing C++ can be playful. The result? A split crowd: half thrilled by the wizardry, half wondering if cleverness is worth the wait. Either way, this experiment turned a dusty math trick into prime‑time drama.

Key Points

  • Introduces a C++17 library (LMP) for Lisp-style template metaprogramming.
  • Demonstrates lazy evaluation with let_lazy, analogous to Scheme’s delay.
  • Implements a compile-time Sieve of Eratosthenes using Cons/Int and list operations.
  • Validates results with static_assert checks using nth for the first primes.
  • Provides a Scheme version to illustrate one-to-one conceptual mapping with C++ templates.

Hottest takes

"I wonder what it does for compile time" — ahartmetz
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.