Intel, Mozilla, Red Hat, and Fastly partner to make WebAssembly a cross-platform runtime

The Bytecode Alliance's main goal is to promote the use of security-hardened WebAssembly tools.

bytecode-alliance.jpg

Image: The Bytecode Alliance

Intel, Mozilla, Red Hat, and Fastly announced today the creation of the Bytecode Alliance, an open-source foundation that will work to make WebAssembly into a cross-platform runtime that can be used on native mobile, desktop, and server environments, and not just inside browsers.

WebAssembly is a relatively new technology. It's a standard formally adopted in 2017 that defines a new binary format.

Initially, WebAssembly was specifically developed to find a better and more compact way of delivering web resources from a server to a user's browser. Instead of receiving tens or hundreds of HTML, JavaScript, and CSS, files, users could get resources in one go as a WASM (WebAssembly) bytecode file.

Because it was a binary format, developers quickly realized they could use other languages like C++ or Rust to write their code, compile it to WASM, and then run it inside a browser, without actually having to write in JavaScript first.

Since its release, WASM has been a boon for web app developers, helping them create apps with features thought to have been unachievable with regular JavaScript.

Currently, WebAssembly is supported in all major browsers, but developers are also exploring the idea of using WASM to create one singular app that they can run everywhere.

An effort to prevent WebAssembly from going sideways

The Bytecode Alliance is an effort to standardize the efforts of creating cross-platform WebAssembly runtimes. At heart, it is an attempt to prevent the wide adoption of unsafe WebAssembly runtimes by providing tools developed with security in mind.

"WebAssembly is changing the web, but we believe WebAssembly can play an even bigger role in the software ecosystem as it continues to expand beyond browsers," said Luke Wagner, Distinguished Engineer at Mozilla and co-creator of WebAssembly.

"This is a unique moment in time at the dawn of a new technology, where we have the opportunity to fix what's broken and build new, secure-by-default foundations for native development that are portable and scalable. But we need to take deliberate, cross-industry action to ensure this happens in the right way," Wagner added.

"Together with our partners in the Bytecode Alliance, Mozilla is building these new secure foundations-for everything from small, embedded devices to large, computing clouds."

To get things started, all four founding members of the Bytecode Alliance have contributed their WebAssembly in-house tools to the foundation. This includes:

Runtimes:

  • Wasmtime is a stand-alone WebAssembly runtime that can be used as a CLI tool or embedded into other systems. It's very configurable and scalable so that it can serve as the base for many use-case specific runtimes, from small IoT devices all the way up to cloud data centers.
  • Lucet is an example of a use-case specific runtime. It's ideal for fast CDNs and Edge Compute, using AOT compilation and other techniques to provide low-latency and high-concurrency. We are refactoring it to use Wasmtime at its core.
  • WebAssembly Micro Runtime (WAMR) is another use-case specific runtime. It's ideal for small embedded devices that have extremely limited resources. It provides a small footprint and uses an interpreter to keep memory overhead low.

Runtime components:

  • Cranelift is emerging as a state-of-the-art code generator. It is designed to generate optimized machine code very quickly because it parallelizes compilation on a function-by-function level.
  • WASI common is a standalone implementation of the WebAssembly System Interface that runtimes can use.

Language tooling:

  • cargo-wasi is a lightweight Cargo subcommand that compiles Rust code to target WebAssembly and the WebAssembly System Interface for outside-the-browser use.
  • wat and wasmparser parse WebAssembly. wat parses the text format, and wasmparser is an event-driven library for parsing the binary format.

If this effort will succeed remains to be seen. The four founding members would like to see other tech companies join their fold. Unless the other major browser and OS vendors join, the foundation's efforts might be doomed in the long run.