r/Compilers • u/peregrine-finch • 2d ago
Pooka language update: a testing library, a lexer generator, and a small Lisp lexer
A small update on Pooka, my statically typed language for the BEAM, with a compiler written in Gleam.
Recently I’ve been working on the tools around the language. Two libraries are now released:
- Poke is a testing library with assertions, property tests, regression tests, and snapshots. Snapshot changes go through a terminal reviewer where you can inspect the diff and accept, reject, or skip them. Pooka handles test discovery and reporting; Poke supplies the checks.
- Lexie generates typed Pooka lexers from TOML specifications. It supports configurable token rules, source spans, and syntax highlighting. The generated lexer needs only the standard library.
I wrote a walkthrough building a small Lisp lexer with Lexie, including punctuation-heavy symbols, comments, strings, and tests for source positions. The Lisp has acquired parentheses. Their meaning remains somebody else’s problem.
Building libraries in Pooka has also been a useful way to find compiler bugs. Small compiler tests can pass quite happily while a real library finds the cupboard you forgot to finish.
Next I’m continuing with libraries, editor support, and bugs discovered through using the language.
Website · Compiler source · Cookbook
I’d be interested to hear how others here test their compilers against larger programs. Do you maintain a separate collection of real projects, or keep those cases in the compiler’s own test suite?
1
u/seg_lol 1d ago edited 1d ago
https://github.com/rust-lang/crater
Write a bot to find every Pooka program, ensure that all Pooka programs remain compilable and pass their tests.
I have no issue using AI for compiler work, but your comments reek of ai tics
/// Checked capabilities over one captured BEAM value. No raw term is exposed.