rustle
rustle copied to clipboard
Choosing the parsing backend
Some options are:
nom
and pest
seem to be the most popular right now.
Any other suggestions? Tell me what we should use
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
Chumsky seems well maintained and apparently very fast. I'm leaning towards it.
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.
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
Does swc have a css parser?
I looked around in the swc crates and I found it