nom

A byte-oriented, zero-copy parser combinators library for Rust

Library
Cargo
v8.0.0
10,475 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
42 /100 Fair
Development Activity 0
Maintenance 0
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
81 /100 Excellent
Architecture 88
Code Quality 90
Innovation 85
Learning Curve 60

nom is a parser combinators library for Rust: instead of writing a grammar in a separate file and generating parser code from it (as with lex/yacc-style tools), you compose small, specific parsing functions — “take 5 bytes”, “recognize the word HTTP” — into larger parsers that mirror the shape of the grammar you’re implementing. It works over byte slices, bit streams, and UTF-8 strings with the same combinator style, and returns zero-copy slices of the input wherever possible rather than allocating new buffers.

nom was designed from the start to handle both binary and text formats correctly under streaming/partial-data conditions: when there isn’t enough input to decide an outcome, it reports that more data is needed instead of silently producing a wrong result. It ships descriptive, pattern-matchable error types (with support for custom error types), and has been used in production to write parsers for formats ranging from TLV binary protocols and HTTP to full toy programming languages.

What You Get

  • A library of composable parser combinators (bytes, character, number, sequence, branch, multi, combinator modules) for building larger parsers from small functions
  • Byte-, bit-, and string-oriented parsing using the same combinator API, with zero-copy slice returns
  • Streaming support: parsers correctly report “need more data” instead of guessing when input is incomplete
  • Descriptive, pattern-matchable error types with support for custom error types
  • no_std compatibility via optional alloc/std feature flags for embedded or allocation-constrained targets

Common Use Cases

  • Writing a binary format parser (TLV structures, bit-level protocol fields, custom file formats)
  • Building a text format parser for line-based or nested formats like CSV, INI, or JSON
  • Prototyping a small programming-language parser (lexing, tokenizing, and building an AST in one pass)
  • Writing a streaming network protocol parser that must handle partial reads correctly (e.g. an HTTP proxy)
  • Replacing a hand-written or regex-heavy parser with a safer, memory-safe combinator-based one

Under The Hood

Architecture - The crate is organized by parsing domain: src/bytes (byte-slice combinators), src/bits (bit-level parsing), src/character and src/str.rs (string/UTF-8 parsing), src/number (numeric parsing), plus cross-cutting src/combinator, src/branch, src/sequence, and src/multi modules for composing and sequencing parsers. src/internal.rs defines the core IResult/error machinery all combinators share, and a companion nom-language crate in the same repo builds higher-level language-parsing helpers on top of the core crate.

Tech Stack - 100% Rust, MSRV 1.65+, with an alloc/std feature-flag split so the crate can run in no_std environments when only alloc is available. No required external dependencies for the core combinator engine.

Code Quality - The tests/ directory contains format-specific integration tests (ini.rs, css.rs, arithmetic.rs, json via arithmetic_ast.rs-style AST tests, float.rs, escaped.rs) exercising real parsing scenarios end-to-end, and a proptest-regressions/ directory shows the project uses property-based testing/fuzzing to catch parser edge cases — the README states fuzzing has only ever found flaws in code outside nom itself.

API Design - The combinator style (small functions like tag, take_while_m_n, map_res composed via .parse()) keeps individual parsers both reusable and independently testable, and the resulting code reads close to the grammar being implemented — the README’s hex-color parser example demonstrates this directly. The tradeoff is a learning curve: combinator composition and the IResult/Parser trait machinery take longer to internalize than a hand-written recursive-descent parser would.

Used by 7 apps in this directory

Rust
65%
Apache 2.0

agentgateway

AI Development · Developer Tools · Mcp

5,071

An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.

View details
88
Repo Health
82
Technical
69
Dependency
Built with
Rust 65%
Go 23%
Updated 6 days ago
TypeScript
54%
MIT

Anarlog

AI Assistants · Note Taking · Productivity

9,404

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
68
Dependency
Built with
TypeScript 54%
Rust 34%
Updated 5 days ago
Rust
54%
Other

Cap

Team Chat · Video Conferencing

22,884

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
64
Dependency
Built with
Rust 54%
TypeScript 42%
Updated 5 days ago
Rust
80%
MIT

fabro

Developer Tools · Devops

1,658

Define AI agent workflows as code graphs, route tasks across any LLM, and intervene only where it matters.

View details
82
Repo Health
83
Technical
67
Dependency
Built with
Rust 80%
TypeScript 15%
Updated 6 days ago
Rust
96%
Apache 2.0

InfluxDB

Analytics · Databases

31,758

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
82
Repo Health
76
Technical
72
Dependency
Built with
Rust 96%
Updated 1 weeks ago
Rust
100%
Other

Meilisearch

Search

59,424

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
89
Repo Health
88
Technical
68
Dependency
Built with
Rust 100%
Updated 1 weeks ago
Rust
90%
Apache 2.0

Qdrant

AI Development · Databases · Search

34,857

Open-source vector database and search engine built in Rust for production-grade AI applications — from semantic search to RAG pipelines and recommendation systems.

View details
92
Repo Health
87
Technical
65
Dependency
Built with
Rust 90%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers