No description
Find a file
Shannon Rothe 6647752e03
refactor(ast): change Option<Vec> to Vec for decorators (#84)
* remove `Option<Vec>` from `FormalParameter`

* `unwrap` -> `unwrap_or_else`

* prefer `AstBuilder` helper

* implement `consume_decorators`
2023-03-02 15:52:46 +08:00
.cargo feat(tasks): add parser benchmark 2023-02-11 08:46:32 -08:00
.github/workflows ci: remove permissions override, I changed it in the GitHub settings 2023-03-01 20:47:14 +08:00
benchmark Git ignore benchmark/package-lock.json 2023-02-26 20:17:05 +08:00
crates refactor(ast): change Option<Vec> to Vec for decorators (#84) 2023-03-02 15:52:46 +08:00
npm/oxc ci: bump 0.0.0-alpha.4 and trigger release_ci.yaml 2023-03-01 14:12:19 +08:00
tasks feat(oxc_parser): Parse modifiers before declaration 2023-03-01 22:50:23 -08:00
.gitignore chore: igore .js(x), .ts(x) in root directory 2023-02-26 02:02:05 +08:00
.gitmodules chore(tasks): update submodules 2023-02-24 13:08:22 +08:00
Cargo.lock refactor(linter) Generate rule name with declare_oxc_lint 2023-03-01 06:50:36 -08:00
Cargo.toml chore(rust): remove symbols in release profile 2023-03-01 00:33:24 +08:00
CONTRIBUTING.md chore: update contribution docs 2023-02-24 13:24:42 +08:00
LICENSE Initial commit 2023-02-09 13:46:52 +08:00
README.md chore(README): credit @jfmengels and elm-review 2023-02-28 10:27:15 +08:00
rust-toolchain.toml chore: add rust-toolchain.toml and Cargo.toml 2023-02-11 13:03:40 +08:00
rustfmt.toml chore: add rustfmt.toml 2023-02-11 13:11:17 +08:00
THIRD-PARTY-LICENSE chore: s/LICENSE-THIRD-PARTY/THIRD-PARTY_LICENSE 2023-03-01 21:11:20 +08:00

The JavaScript Oxidation Compiler (oxc)

MIT licensed Discord chat

Why this project?

The goal of this project is to:

  • Create a blazingly fast JavaScript Compiler written in Rust.
  • Provide good documentation on learning Rust and compiler techniques.
  • Create a linter.

And mostly importantly, an invitation for you to come and learn Rust with me. We will learn a lot from each other!

You can watch this project and also follow me on twitter if you don't have the time to Rust but would like to learn things.

Contributing

Contributions are welcome and highly appreciated. To get started, check out CONTRIBUTING.md.

You can also join us on Discord.

Call for action

You can take a look at some of the good first issues if you want to practice some Rust.

I welcome all nitpickings and bikesheddings if you think any of the code can be improved, just make an issue.

I have also created some discussions for documenting my thought processes.

Milestone

Oxc has a fully working parser and a prototype for the linter right now.

The current objectives are:

  • A MVP (Most Viable Product) for the linter.
  • Improve the parser for real usage. Areas include:

Parser Conformance

The cargo coverage command currently reports the following summary

Test262 Summary:
AST Parsed     : 43934/43934 (100.00%)

Babel Summary:
AST Parsed     : 2045/2057 (99.42%)

TypeScript Summary:
AST Parsed     : 4291/4861 (88.27%)

(The parser is failing some of the TypeScript recoverable parser tests.)

Linter Performance

See benchmark for details. Hyperfine results are:

Benchmark 1: oxc
  Time (mean ± σ):      30.9 ms ±   1.4 ms    [User: 138.2 ms, System: 54.7 ms]
  Range (min … max):    28.6 ms …  35.7 ms    83 runs

Benchmark 2: rome
  Time (mean ± σ):     145.0 ms ±   2.8 ms    [User: 674.9 ms, System: 69.9 ms]
  Range (min … max):   141.5 ms … 151.8 ms    19 runs

  Warning: Ignoring non-zero exit code.

Benchmark 3: eslint
  Time (mean ± σ):      2.661 s ±  0.057 s    [User: 4.076 s, System: 0.223 s]
  Range (min … max):    2.593 s …  2.790 s    10 runs

  Warning: Ignoring non-zero exit code.

Summary
  'oxc' ran
    4.70 ± 0.23 times faster than 'rome'
   86.20 ± 4.35 times faster than 'eslint'

Learning Resources

Credits

This project is incubated from the help of these great mentors and their projects:

License

MIT

Third Party Licenses

Licenses are list in LICENSE-THIRD-PARTY

This project partially copies code from the following projects:

Project License
eslint/eslint MIT
typescript-eslint/typescript-eslint MIT
microsoft/TypeScript Apache 2.0
rome/tools MIT
mozilla-spidermonkey/jsparagus MIT Apache 2.0