The Oxidation Compiler is creating a suite of tools for the JavaScript / TypeScript language:
- AST - See docs.rs/oxc_ast
- Parser - See docs.rs/oxc_parser, @oxidation-compiler/napi
- Linter - Work in progress. Try it out!
npx oxlint@latest path
- Formatter
- Transpiler
- Minifier - Prototype
- Type Checker - See ezno, available via
npx oxidation-compiler@latest check path
The primary objectives for this project include:
- Create a really fast native program by using the Rust programming language
- Provide the basic building blocks for creating your own tools by having good API designs
- Provide good documentation on learning Rust and compiler techniques
Performance issues are considered as bugs in this project.
As of now, Oxc has a fully working parser, a prototype for the linter and the minifier.
The current objectives are:
- A MVP (Minimal Viable Product) for the minifier.
- A MVP for the linter.
This project is an invitation for you to come and learn Rust with us, any contributions to this project are appreciated.
To get started, check out some of the good first issues or ask us on Discord.
If you are unable to contribute by code, you can still participate by:
- star and watch this project
- join us on Discord
- follow me on twitter
- provide your wisdom in discussions
The linter is fast to the extent that it feels broken.
With 31 rules implemented, testing in the VSCode repo on a M2:
vscode main ❯ npx oxlint@latest src
Finished in 388ms on 3628 files with 31 rules using 8 threads.
Found 53 errors.
And also in a huge monorepo:
Checked 73660 files in 7415ms using 12 cores.
Found 470 errors.
On my Intel i7 6-core, the linter is around 80 times faster than ESLint.
See benchmark for details.
The linter is currently usable and it can potentially catch a few mistakes for you:
npx oxlint@latest path
The cargo coverage
command reports the following conformance summary
Test262 Summary:
AST Parsed : 44000/44000 (100.00%)
Positive Passed: 44000/44000 (100.00%)
Negative Passed: 3915/3915 (100.00%)
Babel Summary:
AST Parsed : 2065/2071 (99.71%)
Positive Passed: 2062/2071 (99.57%)
Negative Passed: 1332/1502 (88.68%)
TypeScript Summary:
AST Parsed : 2337/2337 (100.00%)
Positive Passed: 2331/2337 (99.74%)
Negative Passed: 673/2535 (26.55%)
Test262 conformance is complete. TypeScript parsing is complete.
Only unstable stage 3 json-modules
and stage 3 decorators
tests are skipped.
- My small tutorial on how to write a JavaScript Parser in Rust
- My small article - Pursuit of Performance on Building a JavaScript Compiler
- Crafting Interpreters
- [Create an issue and insert your inspirational learning resources here]
Rust cloc
scc . --include-ext=rs --no-complexity
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Blanks Comments Code
───────────────────────────────────────────────────────────────────────────────
Rust 194 54278 5933 4636 43709
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $1,426,246
Estimated Schedule Effort (organic) 15.74 months
Estimated People Required (organic) 8.05
This project was incubated with the assistance of these exceptional mentors and their projects:
- Rome Tools - @MichaReiser, @ematipico
- Ruff - @charliermarsh
- quick-lint-js - @strager
- elm-review - @jfmengels
- @domonji for contribution to the TypeScript parser
Licenses are listed in THIRD-PARTY-LICENSE
This project partially copies code from the following projects: