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

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.
4 points johnagrillo62 8 months ago 1 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton