The Gamma Language

C gets templates with Gamma — dev hobby ignites “just use C++” fight

TLDR: Gamma adds templates to C via a tiny preprocessor you can drop into any project, sparking a big “just use C++ or D” debate. Fans love the minimal, vendor-friendly hack; skeptics want real use cases and proper debugging, making this a flashy showdown over modernizing C without the baggage.

Gamma is a tiny tool that bolts templates (reusable, generic code) onto C without rewriting the language, and the comments are where the fireworks exploded. You set a compiler flag and suddenly C can sort numbers and words with one function, build object files, and even ship as a tiny add-on. The creator, masot, winks at the chaos, calling it a “dumb hobby” and admitting the experiment comes with “big annoyances” when you refuse to parse C. Cue the crowd: half impressed, half facepalming.

The doubters came in hot. One voice, sfpotter, asked the room, “What’s the use case?” then dropped the hammer: just use C++ or even D for cleaner templates and better tooling, especially when debugging gets real. Fans countered with a vibe of “C forever,” cheering that Gamma’s a strict superset of C, bootstraps with normal compilers, and is small enough to bundle inside any project. Jokes flew: “Add another G to GCC and call it GG,” “NIH therapy group meets on Tuesdays,” and “C++ PTSD support line is now open.”

In pure dev-sci-fi fashion, Gamma promises generic vectors and sort/print demos while the chat argues whether this is clever minimalism or reinventing a very buggy wheel. The verdict? A spicy split between hackers who love scrappy tools and pragmatists who just want fewer headaches. Check the repo here: gamma.

Key Points

  • Gamma is a self-hosting C preprocessor that adds templated data structures to C without parsing C.
  • It is a strict superset of C and integrates via setting CC="gc gcc".
  • Quickstart instructions include cloning the repo, running make, and compiling/running examples.
  • Gamma can be bootstrapped with standard C compilers and is small enough to vendor into projects.
  • It supports creating object files, static archives, and linking against normal C object files.

Hottest takes

"Playing with 'minimal' ways to add templates/generics/reflection to C has become a bit of a dumb hobby of mine" — masot
"Gamma was an experiment in templates without having to parse C" — masot
"Just using C++ and restricting oneself to templates seems like a better bet than this" — sfpotter
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.