|
|
||
|---|---|---|
| .cargo | ||
| .github/workflows | ||
| benchmark | ||
| crates | ||
| npm/oxc | ||
| tasks | ||
| .gitignore | ||
| .gitmodules | ||
| .typos.toml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
| THIRD-PARTY-LICENSE | ||
The JavaScript Oxidation Compiler (oxc)
The Oxidation Compiler is building a set of tools for the JavaScript / TypeScript language.
These tools include:
- Parser - Done
- Linter - Work in progress
- Formatter
- Transpiler
- Minifier
Goals
The goal of this project is to:
- 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.
Contributing
This project is an invitation for you to come and learn Rust with us.
Contributions are welcome and highly appreciated. To get started, check out CONTRIBUTING.md.
If you do not have the time to contribute code, you can still participate by:
- star and watch this project
- join us on Discord
- follow me on twitter
- provide your wisdom in discussions
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:
- Performance
- API
- Pass more conformance tests
Linter
The linter is fast to the extent that it feels broken.
With a few rules implemented, testing in the VSCode repo:
vscode main ❯ npx oxidation-compiler@latest lint src
Checked 3479 files in 335ms using 12 cores.
Found 17 errors.
And also in a large monorepo:
Checked 73660 files in 7415ms using 12 cores.
Found 470 errors.
On my Intel i7 6-core, the linter is around 84 times faster than ESLint. But we'll get slightly slower as we add more features.
See benchmark for details.
Try it out yourself!
The linter is already usable and it can potentially catch a few mistakes for you:
npx oxidation-compiler@latest lint path
All feedbacks are welcome.
Parser Conformance
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 : 2064/2071 (99.66%)
Positive Passed: 2054/2071 (99.18%)
Negative Passed: 1333/1502 (88.75%)
TypeScript Summary:
AST Parsed : 2330/2340 (99.57%)
Positive Passed: 2323/2340 (99.27%)
Negative Passed: 680/2532 (26.86%)
Conformance for Test262 is now complete.
Only unstable stage 3 json-modules and stage 3 decorators tests are skipped.
Learning Resources
- My small tutorial on how to write a JavaScript Parser in Rust
- Crafting Interpreters
- [Create an issue and insert your inspirational learning resources here]
Credits
This project is incubated from the help of these great mentors and their projects:
- Rome Tools - @MichaReiser, @ematipico
- Ruff - @charliermarsh
- quick-lint-js - @strager
- elm-review - @jfmengels
- @domonji for contribution to the TypeScript parser
License
Third Party Licenses
Licenses are list in THIRD-PARTY-LICENSE
This project partially copies code from the following projects: