The technology was introduced in 2015 as an extension of a previous software project called asm.js, according to Luke Wagner, a co-chair of the WebAssembly Working Group at the World Wide Web Consortium and an engineer at the content delivery network platform Fastly. He previously worked at the browser-maker Mozilla, where the technology was born.
“Our goal was to try to specify the smallest minimum viable product,” he explains. He notes that the nature of the concept could have forced a high level of complexity, but keeping the approach minimal enabled the project’s initial release just two years after it was announced. WebAssembly has been natively supported in all major web browsers since late 2017.
How Does WebAssembly Work?
In many ways, WebAssembly is comparable to containerization, in which applications run in an enclosed area, separate from the rest of the infrastructure.
Inside a virtual machine, the code can be executed away from the rest of the machine, offering some security benefits to users because it prevents code from directly touching the system. Unlike container technologies such as Kubernetes and Docker, however, it does not require an additional subsystem and allows the code to be executed across platforms.
“It’s a lot smaller than a container, and it’s a lot more portable than a container,” Wagner says.
He says that the code tries to replicate the fast speeds of running code natively on the CPU while still allowing high levels of security. While this approach bars running CPU-specific code as seen with x86 processors or Apple silicon, it does enable faster execution speeds across platforms.
DISCOVER: What your small business should know about app modernization.
“What we tried to ask is, how can we allow you to achieve the same performance in WebAssembly as you would if you directly generated CPU code?” Wagner says. “Now, in a browser, you’re not allowed to generate CPU code directly because it could break the sandbox and exploit everyone, so we have to stay within the sandbox.”
The WebAssembly community, he adds, is looking to replicate key features of many execution environments, such as garbage collection. There’s also a focus on improving integration with web browsers so that the final result feels native and properly interacts with the page’s document object model.
Another comparison point to WebAssembly might be the web browser plugin such as Adobe Flash or Oracle’s Java, but with more secure mechanisms that prevent the executable from breaking out of its shell. Additionally, since it is based on open standards, many companies can contribute, which will help ensure you can get the benefits of it no matter which browser or application tools you use.
“It was designed from the beginning to be embeddable in a bigger system,” Wagner says. “It’s not assuming a lot about the surrounding environment.”
The environment-neutral approach gives the technology a potential use case as back-end infrastructure in the enterprise, according to Daniel Lopez, who works on WebAssembly solutions for VMware’s Office of the CTO.
“The part that excites me and that really is relevant to VMware is that a lot of the characteristics that make WebAssembly interesting in the browser and successful in the browser translate really well to the back end — in particular, around the edge where you have a lot of constrained pieces that also have really high security requirements,” says Lopez, a founder of the VMware-owned package management platform Bitnami.
WATCH: Learn how to build a dynamic infrastructure that optimizes the user experience.
WebAssembly Use Cases: Increased Ambitions on the Front End
The technology for WebAssembly was originally designed to be used in web browsers, which means that many of the benefits of it have been leveraged through web-based experiences.
This creates opportunities to run high-quality applications akin to desktop experiences through a web browser alone. One famous example is a buzzworthy web-native version of Adobe Photoshop that was announced last year. In a blog post from last fall, Google product manager Thomas Nattestad and Adobe principal scientist Nabeel Al-Shamma suggest that the possibility of running Photoshop in a browser shows how advanced web browsers have really become.
“We’ve seen impressive co-development where web apps push the boundaries of what’s possible, and browser vendors respond by further expanding web capabilities,” they write. “The latest iteration of this virtuous loop is what has enabled Photoshop on the web.”
Adobe is not alone. Firms such as Autodesk have also brought desktop-level apps like AutoCAD to the web browser, making it possible to access the software’s capabilities in even lighter-weight settings, such as on a Chromebook.
And high-flying web apps that previously pushed the edge, like Google Earth, have furthered their capabilities and browser support using WebAssembly.