Description
TLDR: Rslitn is still better than swc.
The code changes are in swc branch and rslint branch.
swc contains a lot of dependencies regardless if they are relevant to core parsing. Such bloated dependencies place huge burden to compiling, slowing rust-analyzer to almost freezing.
swc's docs and examples re scarce. The only working example is https://rustdoc.swc.rs/swc_ecma_parser/.
Looking to the code is also hard. The abstraction and module organization is, well, hazy at least to the uneducated. Peeking the definition is hard, if possible, given the massive usage of macros. Alas, the macro is also the perpetrator of the sluggish compilation. :/
Using swc is not a nice journey, actually. Looking at the example above, it immediately requires several crates other than the parse. common
, ast
, atom
, visit
and blahblah. And the core impl Visitor
has 200+ macro generated methods to implement without one single line of documentation. The usability is poor... And the output is large, merely importing swc pushes the binary size to 33MB.
Rslint at least has more comments and documentation than swc. It's underlying crate, rowan, also has docs. So it might be a better choice. Rslint's dependencies are also more lightweight. Rslint's source code is also simple and clear, compared to swc.
Understanding Green/Red tree does require some learning. But it is fine.
The binary size is 10MB after importing Rslint, one third of swc.