Skip to content
 
 

Repository files navigation

SWC (Experimental)

This project is still in a very early stage; please continue to use SWC.

This project is an experimental version of SWC. The primary modification, based on SWC, is the redesign of the AST data structure:

  1. It adopts a Flattening AST design, which allows for a higher performance.
  2. The AST structure (fields) of the SWC (experimental) remains largely consistent with that of SWC, making migration relatively straightforward.

Performance

See codspeed for comparison.

Local benchmark results with M3Pro:

  • Parser: 1.2x-1.5x faster.
  • Pre-order visit: No apparent difference.
  • Post-order visit: Compared to legacy pre-order visitor, 20x faster.

Roadmap

There's a long way to go, but luckly it could be progressive.

  • Flattening AST design
  • Port SWC js parser.
  • Port SWC jsx parser.
  • Port SWC TypeScript parser.
  • Port SWC minifier.
  • Port SWC transformation.

Design & Architecture

See our docs

Credits

Thanks to:

  • The zig compiler and the rowan, which inspire the flattening AST design.
  • The oxc, which inspires the ast-tools design.

License

SWC (Experimental) is licensed under the Apache License, Version 2.0, which should be always same as SWC.

See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages