You will need nightly Rust
-
Install Rust, se rustup.sh curl -sSf https://static.rust-lang.org/rustup.sh | sh
-
Update installaion with: rustup self update rustup self update-data
-
Install nightly Rust: rustup toolchain install nightly
-
Default to nightly: rustup default nightly
-
Add the asmjs target: rustup target add asmjs-unknown-emscripten
-
Install NodeJS from https://nodejs.org/en/
-
Install CMake from www.cmake.org
-
Make CMake available on path sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
-
Download emscriptem from http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html
-
Get the latest version of the sdk and setup de emscriptem sdk ./emsdk install sdk-incoming-64bit ./emsdk activate source ./emsdk_env.sh
-
Create a simple project with cargo: cargo new --bin --name simple simple
-
Compile the project: cargo build --target asmjs-unknown-emscripten
-
Run with node: node target/asmjs-unknown-emscripten/debug/simple.js