WebAssembly example using C using Emscripten.
Activate the Emscripten SDK:
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh # emcc command now on path
Recompiling the hello.wasm
file:
emcc hello.c -o hello.js
node hello.js
Optimise code, and emit HTML:
emcc hello.c -O3 -o hello.html
Serve via HTTP:
python -m http.server 8000
View the output on http://127.0.0.1:8000/hello.html
Based on example provided by Aaron Turner and licensed under the Creative Commons Attribution 4.0 License.