Developers port Python PEG parser to Rust in 72 hours, verify with 20,000 fuzz tests
A team built rs-parsimonious, a complete Rust port of the Python PEG packrat parser library 'parsimonious', during Port Mortem 2026, a hackathon focused on proving ports work rather than just writing them. The project was completed in 72 hours with zero unsafe code blocks, enforced through CI. Correctness was verified via differential fuzz testing across 20,041 cases with zero divergences, alongside the upstream Python test suite running unmodified. The Rust port delivered notable performance gains, cutting cold start time from 23ms to 2ms, p99 latency from 0.068ms to 0.016ms, and peak memory usage from roughly 13MB to 6.7MB. A key architectural decision was modeling grammar expressions as Arc-shared structs with a kind enum, enabling efficient packrat memoization through pointer-based cache keying.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in