Skip to content

ratel-rust/ratel-core

Repository files navigation

Ratel

ratel-core

Travis CI Crates.io Discord Gitter

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

Online REPL with Wasm, courtesy of cmtt.

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 using the ratel FFI.

ratel chart

The benchmarks visualized above can be executed in the ffi folder using the npm run benches command.

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.