Show HN: Pest – Fast parser generator written in Rust
github.com
github.com
Am I misunderstanding something or is the comparison not fair?
One constructive criticism, which may be only an unpopular opinion, but I find creative operator overloading unnecessarily hard to read. And I don't think my opinion is entirely subjective since, by definition, you have to learn new semantics whereas a good function name would make the meaning obvious. Maybe this syntax would be familiar to people who are already familiar with formal grammar notations?
Basically, you have tools for context free grammars such as GNU Bison or Yacc. This is an alternative, but with PEG.
For more in-depth info, there's the original PEG paper. [2]
[1]: http://bford.info/packrat [2]: http://bford.info/pub/lang/peg
The README doesn't say, but most PEGs in the wild (AFAICT) compile down to / are implemented by packrat parsers.
E: turns out this is wrong anyway.
[1]: https://github.com/pest-parser/pest/blob/master/pest/example...
For example: https://doc.rust-lang.org/book/first-edition/procedural-macr...
A better title would be "Pest - Fast, modern parser generator for Rust".
One cool thing is that rather than the parser generation being a standalone tool, it's written using Rust's macro system. Normal parser generators use some sort of command line tool to generate say C code which can then be used like any other library. Here, there's no need for generated code, because the Rust macro system generates it on the fly.