JavaScript transpiler in Rust


Keywords
ast, compiler, javascript, parser, performance, rust, transpiler
Licenses
MIT/Apache-2.0

Documentation

Ratel

ratel-core

Travis CI Crates.io Gitter

Ratel is a high performance JavaScript to JavaScript compiler with a Rust core. It's goal is to take newest versions of JavaScript as input, and produce output that's compatible with older versions of the language.

This repo is split in two separate folders:

  • core contains the main Rust codebase that does all the heavy lifting.
  • ffi contains the Node.js wrapper around the Rust core with Neon bindings.

For common usage checkout the ratel-cli repo.

Performance

While still incomplete, the Parser part of Ratel can run circles around even the fastest parsers built in JavaScript, here it is compared to Esprima.

ratel vs esprima chart

Contributors

This project is created and maintained by Maciej Hirsz with the help of awesome contributors. Extended thanks to:

  • cmtt for work on the Node.js FFI and testing.
  • Jan Schulte for the initial version of transformer and codegen.

Logo

The smirky Ratel by the courtesy of A. L. Palmer.

License

This code is distributed under the terms of both the MIT license and the Apache License (Version 2.0), choose whatever works for you.

See LICENSE-APACHE and LICENSE-MIT for details.