News

Microsoft Explores a 'Reboot of Compute' in Cloud with WebAssembly

WebAssembly made Microsoft's Blazor framework possible by enabling C#-based web development, and now the company wants it to completely remake cloud computing.

The site for WebAssembly, or Wasm for short, describes it as "a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications."

In other words, it acts like a translator that allows software written in any language to run on the internet.

WebAssembly
[Click on image for larger view.] WebAssembly Interface Types (source: Mozilla).

But now Microsoft is exploring extending its reach to the cloud, specifically within the .NET development ecosystem.

"The promise on the horizon is being able to take an existing .NET app or library and compile it to a Wasm target," Microsoft's Richard Lander said in a Dec. 4 blog post. Taking Wasm to the cloud would amount to the "second act" of the tech, revamping both cloud apps and functions.

"Wasm may be offering us a reboot of compute in the cloud, with the promise of a single cloud-native binary, higher density, and cheaper multi-tenancy," Lander said. "It also opens up the possibility of edge compute for the same reasons."

His post discusses new constructs to harness Wasm for the cloud, starting with the wasi-experimental workload in the newly released .NET 8. That workload offers up WebAssembly System Interface (WASI) as the new cloud enabler, providing a way for WebAssembly code to safely call and implement arbitrary APIs across languages. The new workload enables devs to create WASI apps with .NET, with functionality expected to be rounded out next year and presented in an improved fashion with .NET 9 in November 2024.

"We're back for another round of 'write once, run anywhere,'" said Lander, product manager for the .NET team. "WASI apps are portable binaries that run on any hardware or operating system and are not specific to any programming language. This time, it feels different. It's not just vendor neural; it's everything neutral."

While the new Wasm explorations build on the "write once, run anywhere" concept of Linux containers, instead of packaging up resources like an OS into a container, the Wasm approach more equates to running an app with no OS at all, just assembly code and memory, with WASI providing access outside normal Wasm boundaries.

Along with WASI, Microsoft's efforts involve related components including WebAssembly Interface Types (WIT), and WebAssembly Component Model. All these bits are in the early stages, though, with much work to be done and many revisions likely to be undertaken.

Lander's post explains how to work with WASI Preview 1 that came with .NET 8, with the expectation that next year's .NET 9 implementation will use WASI Preview 2.

In the meantime, the WASI workload is expected to remain an experiment until a stable 1.0 release is shipped. Lander said the company has no idea when that might be, listing backlogged work items that need attention, including:

  • Integrated debugging
  • AOT support
  • dotnet run with wasmtime CLI arguments
  • Support for more WASI interfaces, likely via better witbindgen support

"Over the next year, we'll be focused on improving the capability and UX of our current implementation and following along with the general evolution of WASI," Lander said. "We're also looking forward to watching how cloud teams adopt WASI within their services. To date, we've been building enabling technology. As we get farther, we'll consider focusing on more targeting experiences that pair with a cloud service. For now, that's all future looking, like the rest of WASI."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

Subscribe on YouTube