In what is probably one of the most impressive WebAssembly demos, the Mozilla team have ported an entire Python data science stack to the browser. This impressive demo uses Emscripten to compile a Python interpreter into WebAssembly. The end result is between 1x-12x slower than native, depending on the benchmark that is executed. Despite the slowdown, the end result is really quite useable. This is probably one of the most practical, and impressive, WebAssembly applications out there.
WebAssembly control flow includes loops and branches (based on stack depth), but doesn’t allow you to jump to an arbitrary location, i.e. it lacks a ‘goto’ construct. So, how do you compile a language which supports ‘goto’ into WebAssembly? This blog post explores the problem in detail.
This is a WebAssembly compiler, it takes wasm modules and compiles them to native machine code.
A brief article that looks at how to port an Asteroids game to WebAssembly using Emscripten. It also has a playable version online and the full sourcecode.
And Finally …
WebAssembly was the fifth most loved language in a recent StackOverflow developer survey. I’m not sure how many of these respondents actually write WebAssembly?!