Back to browse
GitHub Repository
5 starsCommon Lisp

One grammar, 18 YAML parsers – a Futamura projector in Common Lisp

by johnagrillo62·Feb 26, 2026·4 points·1 comment

AI Analysis

●●●●GemWizardryBig BrainZero to One

One grammar generates 18 spec-compliant YAML parsers via Futamura projection in Common Lisp.

Strengths
  • Genuinely novel metaprogramming technique: 20 years of pursuit ending in a working projector that eliminates parser hand-coding across ecosystems
  • All 308 YAML Test Suite tests passing on every generated parser—not theoretical, battle-tested spec compliance across C++, Rust, Go, Python, Haskell, Bash, even x86-64 asm
  • Adding a new language requires only ~300 lines of target spec; the projector generates the rest—real force multiplier for language tooling
Target Audience

Language implementers, parser engineers, compiler researchers, teams needing multi-language YAML support

Post Description

20 years of code generation led here. The YAML 1.2 spec has 211 grammar productions. I converted them from the Haskell reference implementation to s-expressions, wrote a projector in Common Lisp, and generated spec-compliant parsers in 18 languages. All pass 308/308 YAML Test Suite tests. Adding a new language is a 300-line target spec. The projector does the rest in seconds.

Similar Projects

Developer Tools●●●Banger

I built a codebase analysis MCP: Stria

Indexes the Linux kernel in 80 seconds without AST parsers, where tree-sitter tools fail.

WizardryShip ItSolve My Problem
microbass
313d ago
Developer Tools●●Solid

Define MCP tools as YAML specs

YAML runbook executor with destructive-step approval gates, exposable as MCP tools directly.

Big BrainSolve My Problem
stevehiehn
303mo ago