Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use parser combinators instead of Regex #1

Open
1 task done
pragmatrix opened this issue Oct 29, 2021 · 0 comments
Open
1 task done

Use parser combinators instead of Regex #1

pragmatrix opened this issue Oct 29, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@pragmatrix
Copy link
Member

pragmatrix commented Oct 29, 2021

I'm having a bit of a hard time implementing even simple parsers with Regexes. Therefore I am considering using a parser combinator framework:

Candidates are (ranked by dependents on crates.io):

  • 992: nom: Basically unusable syntax-wise, weirdest one, ancient, fast.
  • 98: LALRPOP: External files... Nooooo.
  • 58: combine: Inspired by Parsec, trait heavy, a bit of trouble passing parsers around. Lots of success stories.
  • 20: pom: PEG, so far no downsides. Looks similar to the one I built for F#. slow at construction time
  • 5: Chomp: TODO
  • 0: Chumsky: Similar to pom. New.

TODO:

  • How can we reuse parsers, constructing them may be expensive.

    We can use once_cell, no locking involved if static is already initialized, just one atomic memory read.

@pragmatrix pragmatrix self-assigned this Oct 29, 2021
@pragmatrix pragmatrix added the enhancement New feature or request label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant