AnshulMalik / rapidus

A toy JavaScript engine in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rapidus

CircleCI codecov

A toy JavaScript engine aiming to pass test262

Features

  • Small
  • Support Tracing-JIT compiling
    • Currently, any functions or loops fitting for the following rules would be JIT-compiled.
      • Accessing only its arguments and local variables (not global variables)
      • Number and Boolean(only for function's returning type) are used
      • Calling only itself
      • (There are exceptions...)

Building from Source

Building on Linux

  1. Install dependencies
  • LLVM 6.0
$ # e.g. Ubuntu or Debian
$ apt-get install llvm-6.0
  1. Test
$ cargo test
  1. Build
$ cargo run --release
  1. Run
$ cargo run --release example/XXX.js

Building on other platforms

I don't know.

  • tips: If you are using macOS, you cannot use llvm installed with brew. You should use macports or docker instead. Now it works!

Use Dockerfile

  • Docker image: uint256/rapidus
$ docker build -t rapidus:1.0 .
$ docker run -it rapidus:1.0

About

A toy JavaScript engine in Rust

License:MIT License


Languages

Language:Rust 99.8%Language:Dockerfile 0.2%