Fuzzing the Gleam Compiler: Finding Bugs by Generating Random Programs

Fuzzing the Gleam Compiler: Finding Bugs by Generating Random Programs

Gleam is a functional language that compiles to both Erlang and JavaScript, making it an ideal candidate for structure-aware fuzzing. The author built a fuzzer that generates random Gleam programs to uncover compiler bugs, particularly those causing differences between the two backends. The project uses a generation-based approach, leveraging the compiler's public API to test the parser and type checker. It found a regression in the nightly build involving a pipeline operator in a const expression. The author plans to extend the fuzzer to generate type-safe programs for deeper testing.

One is definitely more than zero.

More from this day

2026-08-25