pest is a parser generator written in Rust that uses parsing expression grammars to build parsers for complex languages.
pest addresses the problem of writing correct parsers by letting developers define language syntax in separate .pest grammar files using a PEG-based syntax similar to regular expressions but with greater expressivity. The parser is then automatically derived from the grammar definition. This separation keeps the grammar formalized and maintainable alongside the procedural code. The tool generates meaningful error messages automatically based on the grammar, showing the input that failed to parse and what was expected at that point.
pest suits projects where you need to parse structured text or domain-specific languages and want a clear, readable grammar definition. It works well for developers who value having the language specification as a separate, easy-to-understand artifact. The tool runs on stable Rust and supports features like precedence climbing for operator parsing and custom error handling. It is appropriate for cases where you want automatic error reporting without manual implementation.
The project maintains active community engagement through multiple channels including a book for getting started, an interactive fiddle for experimenting with grammars, GitHub Discussions for questions, and chat communities. The codebase demonstrates consistent attention to the grammar file format and parser derivation mechanism, with examples showing how to handle multiple parsers in a single file through namespace organization. Development reflects a focus on the core parsing workflow and the quality of error messages produced by the generated parser.