A Rust parser combinator framework for building fast, safe, and memory-efficient parsers for binary and text formats.
nom is a parser combinator framework written in Rust that provides tools for building fast, safe, and memory-efficient parsers. It allows developers to create parsers for binary formats, text formats, programming languages, and streaming data by combining small, reusable parsing functions. The framework leverages Rust's type system and memory safety to prevent common vulnerabilities like buffer overflows while maintaining high performance.
Rust developers who need to parse binary protocols, text formats, configuration files, or programming languages, especially those prioritizing safety, performance, and zero-copy operations.
Developers choose nom for its unique blend of safety, speed, and composability—offering zero-copy parsing, streaming support, and descriptive errors without sacrificing performance, making it ideal for both binary and text parsing tasks.
Rust parser combinator framework
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Returns slices of input data without copying, minimizing memory overhead for binary and text formats, as highlighted in the README's technical features.
Handles partial data gracefully, making it suitable for network protocols and large files where data arrives in chunks, ensuring deterministic parsing.
Benchmarks show it often outperforms other parser combinator libraries, regex engines, and even handwritten C parsers, prioritizing speed without sacrificing safety.
Leverages Rust's memory safety and type system; fuzzing has found no flaws in nom itself, reducing vulnerabilities like buffer overflows.
The combinator approach requires understanding functional programming patterns and Rust's complex type system, which can be daunting for newcomers.
While descriptive errors are possible, setting up custom error types and aggregating errors involves additional boilerplate and complexity, as admitted in the documentation.
Confined to Rust, limiting its use in projects that rely on multiple languages or require cross-platform parsing libraries.