// the find
matklad/minipratt
A minimal Rust implementation of Pratt parsing (top-down operator precedence), written specifically to accompany matklad's two blog posts on the topic. This is a teaching artifact, not a library — the code exists to be read alongside the prose, not imported.
The implementation is genuinely minimal: no macros, no trait soup, just ~100 lines that show the core algorithm clearly. Including shunting-yard as a second binary makes the relationship between the two algorithms concrete rather than abstract. matklad is the author of rust-analyzer, so the code quality and idiom choices are trustworthy. Ports to TypeScript and Python exist if you want to compare across languages.
There is no real API surface — you cannot use this as a dependency, you have to copy and adapt the pattern yourself. The repo handles only a toy arithmetic grammar; applying this to a real language with prefix operators, ternaries, or postfix calls requires non-trivial extension that you are on your own for. No tests — correctness is demonstrated only by the example REPL output. Last meaningful commit was years ago, so if the blog posts have errata or the Rust idioms have aged, neither will be updated.