Is WebAssembly Really the Future?
The Cloud Native Computing Foundation’s (CNCF) most recent annual survey includes a bold statement about WebAssembly (Wasm): “Containers are the new normal and WebAssembly is the future.”
This statement portends a lot of things, about not only WebAssembly’s roadmap and development but also its current place in computing. Already, 37% of end user organizations have some experience deploying applications with WebAssembly, the CNCF reported. While many of these uses are for testing Wasm’s merits, WasmEdge and WAMR are the top runtimes used, according to the CNCF report.
“WebAssembly is the future because it is increasingly used for serverless, containerization and plug-in technologies and is expected to significantly impact web, serverless, gaming and containerization applications.,” Taylor Dolezal, head of ecosystem for the CNCF, told The New Stack in an email response.
But where is WebAssembly’s adoption headed, and what do its roadmap and future place in computing look like? Let’s look at Wasm’s integration and its future in containers, edge and other applications, programming languages and serverless.
Arguably, you could say Wasm is not about the future but is already very much about the present when it comes to its use in all the major web browsers for which it was originally created. But while Wasm has achieved maturity for browsers, more work needs to be done for its use in backend applications, such as its use and deployment in edge devices, before it becomes part of the future there.
Indeed, it is not as simple as adding Python to Wasm and then running the package through Wasi, which hosts the Wasm runtime. For backend applications for which Python is specially adapted, such as machine learning and data analysis, its application in Wasm is very much tied to a host of third-party dependencies that are just now being developed and compiled.
A Wasm Platform as a Service (PaaS) offering or platform does not yet exist that can easily be used to lend WebAssembly to backend applications. In other words, Wasm’s application beyond the browser is just emerging.
“There is a lot of ground to cover in terms of reliably and efficiently supporting production use cases,” Torsten Volk, an analyst for Enterprise Management Associates, told The New Stack. “Exactly what is still missing we will discover along the way. That’s when open source projects and commercial vendors come in to close these gaps and deliver the best possible developer and DevOps experience.”
Distinguishing server-side (ss-Wasm) WebAssembly from Wasm for browser applications, ss-Wasm holds much promise while the road to ss-Wasm adoption is long, and “much of it still needs to be mapped,” Wiqar Chaudry, CEO and founder of Xymbia, which offers a project collaboration platform, told The New Stack.
“There are two very simple measures for making this case: Is there a clear economic value proposition for Wasm when creating software? Does it reduce cost, help companies and developers make more money, or does it help unlock some other type of unrealized value?” Chaudry said, who is also involved in the Wasmer project, currently as an adviser.
“The second is its technical value proposition. Does it appeal to enough developers and solve enough technical pain for them to take on the overhead of using Wasm as a part of their stack?”
As it stands now, WASI has emerged as the best candidate for extending the reach of Wasm beyond the browser. Described as a modular system interface for WebAssembly, it is proving apt to help solve the complexities of running Wasm runtimes anywhere there is a properly configured CPU — which has been one of the main selling points of WebAssembly since its creation.
“I believe the key feature that unlocks WebAssembly as a general-purpose technology is support for WebAssembly System Interface (WASI),” Matt Butcher, co-founder and CEO of Fermyon Technologies, told The New Stack. “WASI allows developers to use familiar system idioms in their code, like opening files and reading environment variables, but without undermining the WebAssembly security model. As WASI support becomes widespread, we will see an explosion of use cases for WebAssembly.”
However, WASI is still maturing. “The first version of WASI opened our eyes to WebAssembly’s potential. The second version, preview 2, is due out in a few months,” Butcher said. “The addition of networking in preview 2 will open up a wealth of new uses.”
WebAssembly will leverage components and WASI in order to abstract common application libraries into common pluggable components, said Liam Randall, CEO and co-founder of Cosmonic. Components like publish-subscribe messaging or specific SQL servers are delivered to applications as abstractions instead of tight couplings to specific libraries, he said.
“When containers arrived on the scene they were smaller, faster to start, and gave developers a smaller surface area to configure and maintain than virtual machines,” Randall said. “WebAssembly modules continue the trend and are smaller, faster to start and leverage components to reduce the amount of code that developers write and maintain.
“More importantly, the component model is a new application methodology that allows for capability-driven security and makes it easier for platform operators to safely run applications.”
Wasm’s use of WASI for system-level integration APIs further adds to its viability as a universal runtime, Dolezal said: “WebAssembly’s capability to host untrusted code within a secure environment is also a significant benefit.”
Containers indeed are the “new normal,” especially in the cloud native space, as the CNCF report said. Wasm can replace containers in some use cases, but overall, WebAssembly and container adoption are set to grow in tandem.
“I absolutely believe that Kubernetes and Wasm are complementary products where one, Kubernetes, takes care of provisioning and scaling infrastructure, while the other, Wasm, delivers the application, including its runtime, on top of this infrastructure,” Volk said.
The path of Kubernetes adoption can serve as a possible model for how and when Wasm will likely see massive adoption. “Kubernetes is widely adopted because access to Kubernetes and tooling to use it, scale it and support it is widely available,” Chaudry said. “We’d see less adoption and usage if Kubernetes wasn’t so readily available as AKS, EKS, or GKE. WebAssembly will travel the same arc.”
Wasm also only solves some of the problems that containers do, he said: “Containers are more complex and have a higher operational overhead. The tradeoffs between the two make it plausible for the two to grow in tandem.”
When DockerHub began to support a new artifact storage specification, the Wasm community realized that instead of re-inventing the wheel, it was now possible to store Wasm runtimes in Open Container Initiative registries such as Docker Hub, Butcher said.
This month, for example, Fermyon’s Spin 0.8 began to support OCI registries. “While we were initially unsure whether OCI registries would be the right distribution mechanism, an evolution in the standards combined with support in Docker Hub changed our minds,” Butcher said. “We’re committed to distributing WebAssembly applications using OCI registries, and can do so today.”
To learn more about WebAssembly, check out this interview with Fermyon Technologies’ Matt Butcher on the future of Wasm, from 2022’s Open Source Summit North America: