Skip to content

[ADR 01] Decide on a parser technology

Jose Emilio Labra Gayo edited this page Jan 6, 2024 · 4 revisions

There seems to be several parsing technologes in Rust:

  • nom which is the one used in nemo. In nemo I also found a Turtle parser in nom and a SPARQL parser in nom. There is another Turtle parser written in nom which says that passes the spec's testsuite although it seems unmaintained.
  • peg which I think is used in the SPARQL parser in oxigraph.
  • pest which looks nice. I didn't find SPARQL/Turtle parsers written in pest.
  • chumsky, seems to put emphasis on error reporting. I didn't find SPARQL or Turtle parsers in Chumsky.
  • antlr4rust would be great to leverage my previous ANTLR parser in shex-s, but the project seems not to be active.
  • combine seems to be one of the first Rust parser combinators. It defines a trait and some macros to handle cyclic recursive parsers.

I recently found the parse-rosetta repo that compares different parsers in Rust.

Given all those possibilities...I am considering using nom by now.

Clone this wiki locally