I ported my Gameboy Color emulator to WebAssembly
GITHUB.IO
With the recent release of Go 1.11, with experimental WebAssembly support, lots of people are having fun porting their existing projects to the web. This post looks at the process of porting quite a complex codebase, a Gameboy emulator, to the web.
In this case, the initial port was pretty trivial, it only took the author 5 mins to get the code running in the browser. However, managing I/O, i.e. rendering to the scree, handling keyboard input, was a challenge, with the final solution using Web Workers. There are also some interesting browser performance results, where Chrome is lagging behind quite significantly.
wasmjit - a kernel mode WebAssembly runtime for Linux
GITHUB.COM
Cervus, Nebulet, and now WasmJit … yes, this is another kernel mode WebAssembly runtime. The goal here is to create a runtime which doesn’t require the standard OS ‘protection rings’, instead relying on the safe nature of the WebAssembly architecture, resulting in much lower overhead in I/O operations.
This project has sparked the usual long Hacker News thread, and multiple references to ‘that’ talk!
Announcing the web-sys crate!
GITHUB.IO
The current version of WebAssembly has a very and limited interface for interoperating with its host environment (typically JavaScript, within the browser). This makes it hard for your WebAssembly applications to do anything meaningful beyond number-crunching.
The Rust community have been working hard to resolve this, firstly they creates wasm-bindgen, that generates JS / Rust binding code to allow for a more ‘rich’ interface. And now, with web-sys, they have managed to generate bindings for all of the Web APIs! This really makes Rust a first-class citizen within the browser.
And Finally
If you just like number-crunching, you might be interested in the wasm version of Cephes, which brings 100+ specialist maths functions to the web. Have fun with your Bessel Functions and your Confluent Hypergeometric!