rustle icon indicating copy to clipboard operation
rustle copied to clipboard

Choosing the parsing backend

Open pintariching opened this issue 2 years ago • 6 comments

Some options are:

nom and pest seem to be the most popular right now. Any other suggestions? Tell me what we should use

pintariching avatar Aug 11 '22 15:08 pintariching

I found a benchmark between chumsky and nom: https://github.com/zesterer/chumsky/pull/94 And some related topics between nom and pest: https://unhandledexpression.com/general/2018/10/04/no-pest-is-not-faster-than-nom.html

linrium avatar Aug 11 '22 16:08 linrium

Chumsky seems well maintained and apparently very fast. I'm leaning towards it.

pintariching avatar Aug 11 '22 17:08 pintariching

From looking into Svelte Parser HTML is parsed using its own parser while javascript an CSS are both parsed by 3rd party libraries. Rustle could use a similar approach by parsing javascript with swc_ecma_parser or another parser and CSS with another library.

qwertydelle avatar Aug 14 '22 17:08 qwertydelle

Yeah after looking into it, I think I'm going to use the swc crates for parsing the js and css and try and rewrite their html compiler

pintariching avatar Aug 16 '22 14:08 pintariching

Does swc have a css parser?

qwertydelle avatar Aug 16 '22 15:08 qwertydelle

I looked around in the swc crates and I found it

pintariching avatar Aug 16 '22 16:08 pintariching