#javascript #swc #ast

swc_experimental_ecma_ast_compat

An extensible Rust-based platform for the next generation of fast developer tools

7 releases

Uses new Rust 2024

new 0.3.3 Dec 15, 2025
0.3.2 Dec 15, 2025
0.2.0 Dec 11, 2025
0.1.1 Dec 4, 2025

#2266 in Web programming

Apache-2.0

1.5MB
38K SLoC

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.35x-1.60x faster.
  • Pre-order visit: 0.45-0.70x slower.
  • Post-order visit: Compared to legacy pre-order visitor, 7-40x 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.

Dependencies

~19MB
~371K SLoC