// the find
rust-bakery/nom
Rust parser combinator framework
nom is a parser combinator library for Rust that lets you build parsers by composing small functions rather than writing a grammar file and running a code generator. It handles both binary and text formats, works in no_std environments, and supports streaming input where you only have partial data at a time. If you're parsing anything in Rust — a binary protocol, a config format, a subset of a language — this is the first library you should reach for.
Zero-copy by default: parsers return slices of the original input, not owned strings, which matters a lot when parsing large files or network streams. Streaming support is first-class, not bolted on — the complete/streaming module split means you can use the same combinator logic whether your data arrives all at once or in chunks. The adoption list is a real signal: X.509, TLS, DNS, Matroska, HTTP — these are not toy projects, they're production parsers that have validated nom against real, malformed, fuzzed input. No alloc feature flag means it works in embedded/kernel contexts where most parser libraries can't go.
Error messages are the perennial complaint and it's still valid — the default error type tells you where parsing failed but not why in human terms, and getting genuinely useful errors requires implementing custom error types which is non-trivial boilerplate. The learning curve is steep: the `IResult<I, O, E>` type signature and the difference between combinators like `map`, `map_res`, `map_opt`, `flat_map` is not obvious from the docs, and the Nominomicon guide helps but is incomplete. Compared to chumsky or pest, nom gives you less built-in support for left-recursive grammars and operator precedence — the new `nom-language` subcrate adds precedence climbing but it's a separate crate and still young. Major version upgrades (5→6→7→8) have historically been breaking with non-trivial migration effort.