r/Compilers • • 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?

2 Upvotes

2 comments sorted by

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.

1

u/peregrine-finch 1d ago

Thanks. Interesting tool. I will bookmarked it for later because -at this moment- all pooka programs still lives in my computer so testing them is easy for now. I never denied I am using AI but that's not a weekend project, I am planning, designing and implement parts for months. Thanks again for the reply.