WebAssembly (Wasm) is a programming language that runs on
browsers (stack based VM). Compared to
JavaScript, Wasm is faster, more memory efficient and file size efficient and safer.
Compiling c source
A
C source file can be compiled into Wasm with
emscripten:
The folllowing command produces a
.wast
file.
$ emcc -O3 -g source.c
It is also possible to create a
html file:
$ emcc -O3 source.c -o webPage.html
$ python3 -m http.server 8888
$ open localhost:8888/webPage.html