To The Browser And Beyond: WebAssembly Gets It Right
While WebAssembly emerged from a desire to improve the performance of computationally intensive browser apps, it can do much more than that. In practice, there are at least three ways in which developers can use it to transform their products and processes:
- WebAssembly accelerates your server-side functions and services. WebAssembly virtual machines (VMs) don’t all require a browser. Some VMs start in microseconds and, unlike containers, can run as a single process in a sandbox. This makes them ideal for running serverless functions. Fastly reports that it can set up and tear down a WebAssembly VM in less than 60 microseconds, compared with the hundreds of milliseconds that traditional containers take.
- WebAssembly enables portability and sandboxes. Although WebAssembly was designed to improve the performance of browser-based apps and works well for server-side functions and services, it turns out that a lot of scenarios benefit from platform neutrality and sandbox security. I spoke to one stealth startup that uses WebAssembly just to abstract away the underlying hardware. This lets them create a single build rather than a separate build for each architecture. As demonstrated by the Microsoft Flight Simulator software development kit and Envoy’s packet filters, a good sandbox and portable bytecodes let any application accept arbitrary user code — even where executing arbitrary machine code could be a security risk.
In short, WebAssembly can make your browser applications faster. But it can also do a lot more. To learn more about WebAssembly, see Forrester’s WebAssembly: A Quiet Revolution and WebAssembly Wisdom: Best Practices For Wasm Wizards.
Written with Zachary Stone, research associate