A Forth dialect implemented in C, Javascript, WebAssembly and compiled from C to asm.js and WebAssembly.
This project is based on the 1992 IOCCC entry buzzard.2 (design notes: buzzard.2.design), prettified and then compiled to:
asmjs using emscripten
WebAssembly using Binaryen
Also reimplemented by translating the C code into Javascript and WebAssebly.
For instructions to setup the dev environment yourself check the README.
Here we compile a simple C program to asmjs and WebAssembly to make it easier to follow the generated code for a minimal example that does function calls, local variables and I/O:
hello-binaryen: hello.c compiled to WebAssembly using binaryen
hello-emcc: hello.c compiled to asmjs using emscripten
the resources folder has all the generated files if you want to read them
To read the process of prettifying the C code follow the buzzard.c commits in chronological order.
Slides from a presentation I gave at StuttgartJS (August 10th, 2016) are available here: WebAssembly Presentation at StuttgartJS
JS-like proposal from FF Nightly
emscripten's emsdk/src/settings.js contains docs about the flags that can be passed to emcc
Luke Wagner -on- WebAssembly: A New Compiler Target For The Web
Experimental programming language that compiles to both WebAssembly and JavaScript