WebAssembly support now shipping in all major browsers
In the past weeks, both Apple and Microsoft have shipped new versions of Safari and Edge, respectively, that include support for WebAssembly. Since Mozilla Firefox and Google Chrome already support WebAssembly, that makes all four major browsers capable of running code compiled to the wasm format on the web.
“Google, Apple, and Microsoft had all committed to supporting WebAssembly in their browsers. To have that support in market today is a really exciting development,” said Luke Wagner, the Mozilla engineer who created WebAssembly’s precursor, asm.js, and spearheaded work on the WebAssembly specification.
A Growing Standard
What’s the big deal about WebAssembly? First, it’s on its way to becoming an industry standard. It’s a proven way to run large, complex applications on the web. And it gives web developers a number of options they’ve never had before. For instance, now you can:
- Get near-native performance without using a plug-in
- Write code that is both performant and safe, because it executes within the browser’s security sandbox
How It’s Used Today
Today, the use cases for WebAssembly and asm.js have grown beyond online gaming. As people experiment with the process of using the WebAssembly format and its cohort, the Emscripten compiler, they’re finding ways to move increasingly sophisticated applications to the web. Things like:
- Computer vision
- 3D mapping – Altus platform, Google Earth
- User-interface design
- Language detection
- Audio mixing
- Video codec support
- Digital signal processing
- Medical imaging
- Physical simulation
- Compression – zlib-asm, Brotli, lzma
- Computer algebra
“Asm.js and WebAssembly were really no-brainers for the gaming industry, because they had all this investment in massive C++ programs that they didn’t want to rewrite for the web,” Wagner said. “Now we’re seeing people using WebAssembly for all kinds of new projects. So there’s this real promise that we will someday be able to run most any application on the web and have it perform just as it would if it were running locally on your PC.”
You can also try out WebAssembly Explorer, an online tool which allows you play around with a C/C++ compiler and understand how WebAssembly code is produced, delivered, and ultimately consumed by the browser. Another online tool, WebAssembly Fiddle, lets you write, share, and run WebAssembly code snippets in the browser. For an even deeper dive, you can inspect WebAssembly binaries to understand how WebAssembly code is encoded at a binary level.