This project implements a Javascript to WebAssembly compiler for writing Lambda functions for the Manetu platform in Javascript and Javascript-based languages (e.g., Typescript, Clojurescript, etc.). It is based on Javy, following the Extending Javy guidelines.
When running the official mjsc binary on Linux, glibc
2.31 or greater must be available. If you are using an older version of glibc,
you may need to update your operating system.
- On Ubuntu,
sudo apt-get install curl pkg-config libssl-dev clang
- rustup
- Stable Rust, installed via
rustup install stable && rustup default stable
- wasm32-wasi, can be installed via
rustup target add wasm32-wasi
- cmake, depending on your operating system and architecture, it might not be
installed by default. On MacOS, it can be installed with
homebrew
viabrew install cmake
On Ubuntu,sudo apt-get install cmake
- Rosetta 2, if running MacOS on Apple Silicon, can be installed via
softwareupdate --install-rosetta
Inside this repository, run:
$ cargo build -p mjsc-core --target=wasm32-wasi -r
$ cargo build -p mjsc-cli -r
Alternatively, if you want to install the tool chain globally, inside this repository, run:
$ cargo build -p mjsc-core --target=wasm32-wasi -r
$ cargo install --path crates/mjsc-cli
If you are going to recompile frequently, you may want to prepend CARGO_PROFILE_RELEASE_LTO=off to cargo build for the CLI to speed up the build.