More News on WebAssembly
- Jan-Erik RedigerAnother week has passed and work on WebAssembly, documentation, tooling and usage is not stopping. Here's a recap of what happened recently:
Oxidizing Source Maps with Rust and WebAssembly
Nick Fitzgerald and Tom Tromey rewrote one of the most performance-sensitive code paths for source map parsing,
that's used in JavaScript debuggers and other applications.
Using Rust compiled to WebAssembly they were able to run more than 5 times faster for real-world use cases.
All work is based on the wasm32-unknown-unkown
target of Rust.
Along the way they discovered a few shortcomings of this target and some bugs as well.
Making WebAssembly even faster: Firefox’s new streaming and tiering compiler
Lin Clark wrote another illustrated post on WebAssembly, this time introducing the new streaming compilation feature coming to Firefox 58. With this, WebAssembly can be compiled while it is streamed over the network and it will be ready to execute as soon as all the code is there. In combination with the baseline compiler in Firefox this brings another boost to running WebAssembly.
Tooling
Useful new tools came out of Nick's and Tom's work as well. One of these is wasm-snip, a tool to replace unused functions, that neither the compiler nor wasm-gc were able to remove with no-ops. This should get rid of some of the code bloat still in the module. Once we get a proper linker and improved compiler this will hopefully be unnecessary.
emk started a new tool to analyze size of WebAssembly modules more easily: wasm-bloat.
If you're compiling to WebAssembly also take a look at binaryen, which has tools like wasm-opt for even more optimization.
A point of coordination for all things rust+wasm
Aaron started a new repository to coordinate the development of Rust and its Wasm backend. With already two dozen issues opened, there's a lot going on. Jump into the discussion and shape how Rust and WebAssembly work together.
More examples
Daniel pointed me to two new demos of Rust and WebAssembly.
wasm-astar is a A* Pathfinding example, showed on an interactive map and some writing about Jake's experience working on it.
Koute wrote pinky, a fully working NES emulator written in Rust. Most excitingly there's also a Web frontend, running WebAssembly, to play your favourite game right in the browser: pinky-web.
Do you have another cool thing showing Rust & WebAssembly? Let me know by opening an issue.