Analogues of nom crate.

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • nom

    Rust parser combinator framework

  • I found that nom's docs on GitHub were quite helpful like https://github.com/Geal/nom/blob/main/doc/choosing_a_combinator.md and it's examples

  • pom

    PEG parser combinators using operator overloading without macros.

  • Maybe a parser combinator library is not what you want? One alternative might be writing an expression parser without a library at all: https://matklad.github.io/2020/04/13/simple-but-powerful-pratt-parsing.html (Depending on the grammar you are parsing a Pratt parser might actually be a good fit!) A PEG might also be more suitable for your use case, like pom.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • lalrpop

    LR(1) parser generator for Rust

  • And of course, there are always the parser generators if you want to go that route. But picking the right parsing library is dependent on the specific grammar you are dealing with. For instance, nom is great for parsing binary formats and simple grammars that Pratt parsers can handle (because the structure of the code will mimic the structure of the grammar), but it may not be ideal for complex grammars with 5 pages of EBNF! A declarative parser might be more appropriate for these grammars hence parser generators are also an option. lalrpop and pomelo fall under this category.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts