No description
Find a file
2020-01-11 11:39:53 -05:00
src Add doc and readme 2019-07-24 14:13:33 -04:00
wasm-bindgen Move wasm-bindgen folder inside 2019-07-24 12:42:40 -04:00
.gitignore Move wasm-bindgen folder inside 2019-07-24 12:42:40 -04:00
build.sh Fixed issues following wasm-bindgen updates 2020-01-11 11:39:53 -05:00
Cargo.lock Fixed issues following wasm-bindgen updates 2020-01-11 11:39:53 -05:00
Cargo.toml Fixed issues following wasm-bindgen updates 2020-01-11 11:39:53 -05:00
index.html Move wasm-bindgen folder inside 2019-07-24 12:42:40 -04:00
index.js Fixed issues following wasm-bindgen updates 2020-01-11 11:39:53 -05:00
LICENSE Initial commit 2019-07-18 11:06:27 -04:00
README.md Add doc and readme 2019-07-24 14:13:33 -04:00
worker.js Move wasm-bindgen folder inside 2019-07-24 12:42:40 -04:00
Xargo.toml init 2019-07-18 11:04:20 -04:00

Specs Wasm Usage Example

This simple example shows the (almost) minimum amount of code currently required to run specs on wasm (in the browser!).

Prerequisites

  • Running linux with the standard development tools available for your distribution.
  • Rust installed

Getting Started

Clone this repository:

git clone https://github.com/jojolepro/specs_wasm

Make sure that rust nightly is installed and up to date:

rustup install nightly
rustup update

Make nightly the default toolchain:

rustup default nightly

Add the rust-src component:

rustup component add rust-src

Install the wasm-bindgen cli tools:

cargo install -f wasm-bindgen-cli

Install Xargo

cargo install -f xargo

And run the build.sh script!

./build.sh

Open up firefox nightly and navigate to about:config

In there, you want to enable the javascript.options.shared_memory flag.

Once this is done, navigate to http://127.0.0.1:8000 , open the browser console and click the "Run!" button at the top of the page.