talira

pest (Rust)

The elegant PEG parser generator for Rust

open sourceMIT OR Apache-2.0free

pest is a general-purpose parser for Rust built for accessibility, correctness and performance. You write a grammar as a parsing expression grammar (PEG), which reads like regular expressions but can parse complex languages, and pest_derive generates the parser from it. It has an official book, API docs on docs.rs, an online grammar fiddle, and guidance on resource limits for untrusted input.

Problems it solves

  • write a parser for a custom language in Rust
  • parse a DSL with a PEG grammar
  • generate a Rust parser from a grammar file

Features

  • PEG grammars
  • parser generated by pest_derive
  • online grammar fiddle
  • guidance for parsing untrusted input

Alternatives

The same job

These do what pest (Rust) does.

  1. nom A Rust parser combinator library for fast, safe binary and text parsers
  2. peg Packrat parser generator for Go from Parsing Expression Grammars

Compare pest (Rust) with the top 3