Giter Club home page Giter Club logo

oxc's Introduction

The JavaScript Oxidation Compiler (oxc)

Discord chat MIT licensed npm version

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:

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

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 on an Intel i7 6-core are:

Benchmark 1: oxc
  Time (mean ± σ):      34.6 ms ±   1.3 ms    [User: 160.1 ms, System: 67.2 ms]
  Range (min … max):    31.8 ms …  40.9 ms    75 runs

Benchmark 2: rome
  Time (mean ± σ):     147.4 ms ±   3.7 ms    [User: 695.4 ms, System: 72.4 ms]
  Range (min … max):   141.9 ms … 153.8 ms    20 runs

Benchmark 3: eslint
  Time (mean ± σ):      2.905 s ±  0.185 s    [User: 4.387 s, System: 0.254 s]
  Range (min … max):    2.710 s …  3.287 s    10 runs

Summary
  'oxc' ran
    4.26 ± 0.20 times faster than 'rome'
   83.94 ± 6.25 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 THIRD-PARTY-LICENSE

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
acorn MIT
sindresorhus/globals MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.