Wasmtime 1.0 released: WebAssembly outside the browser, but is it really production-ready?

Wasmtime 1.0 released: WebAssembly outside the browser, but is it really production-ready?

The Bytecode Alliance, sponsors of the Wasmtime project, have declared it fit for production with the release of version 1.0.

WebAssembly was invented to run code in the browser both securely and with near-native performance. Wasmtime takes the same concept outside the browser, such as for server-side use in microservices or web applications. Other use cases include application plug-ins, user-defined functions for database managers, or client applications where portability and a sandboxed environment is desirable – reminiscent of older runtimes such as those for Java and .NET.

The Bytecode Alliance has around 30 member companies including Amazon, Arm, Google, Intel, Microsoft, Mozilla and VMWare.

Language support for Wasmtime is currently limited. Rust is the best-supported language, since it compiles to WebAssembly. Developers can also target WebAssembly with C/C++, with some limitations such as no support for C++ exceptions, and AssemblyScript, a language similar to TypeScript. Developers can also use the WebAssembly text format (.wat). Various languages have support for embedding wasmtime, including Rust, C, Python, C#, Go and Bash.

According to a post by Fastly senior principal engineer Lin Clark, who works on Wasmtime, “we could have called Wasmtime production-ready more than a year ago.” Clark said the goal was to run Wasmtime in production for an extended period, before declaring it done.

Existing users include Shopify (since July 2021) and Fastly, which uses Wasmtime for hosting Edge functions, custom services that run close to the user for low-latency, and Embark, which uses Wasmtime in a game engine. Microsoft uses Wasmtime in preview for WASI  node pools in the Azure Kubernetes Service. WASI (WebAssembly System Interface) is a system interface for Wasmtime, enabling secure access to operating system features like the file system – though WASI is opposed by the AssemblyScript project which regards it as harmful to the web platform.

The idea of a high performance, secure cross-platform runtime is compelling, but is Wasmtime really ready for production? There are some oddities, such as JavaScript being absent from the list of supported language, and limitations like the lack of multi-threading, though there is a Threads proposal for WebAssembly. There are also ways to run JavaScript.

“Spidermonkey.wasm is the basis of Fastly’s JavaScript on Compute@Edge support. We have found it to be faster than QuickJS,” said a Wasmtime contributor on Hacker News.

Dig into Wasmtime though, and despite the 1.0 release, many subprojects (like the .NET support) are still in preview. Windows support is also limited, thanks to WASI being only partially implemented on Windows so far. Lack of integration with Java is another surprising omission.