forked from Mirrors/wasm3
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Volodymyr Shymanskyy
ab08f64e25
|
5 years ago | |
---|---|---|
.. | ||
README.md | 5 years ago | |
main.c | 5 years ago |
README.md
Build using Emscripten
In root:
source /opt/emsdk/emsdk_env.sh --build=Release
mkdir -p build
cd build
cmake -GNinja -DEMSCRIPTEN=1 ..
ninja
Note:
To enable tail-call
WebAssembly extension:
cmake -GNinja -DEMSCRIPTEN=1 -DWASM_TCO=1 ..
You can convert the generated wasm to wat to see the effect:
wasm2wat --enable-tail-call wasm3.wasm > wasm3.wat
Running tail-call
version will require Chrome with experimental flags:
emrun --no_browser --no_emrun_detect --port 8080 .
chrome --js-flags="--experimental-wasm-return-call --wasm-opt --wasm-no-bounds-checks --wasm-no-stack-checks" http://localhost:8080/wasm3.html
Or use Node.js:
node --experimental-wasm-return-call --wasm-opt ./wasm3.js