Serdar Yegulalp
Senior Writer

Mozilla’s WASI takes WebAssembly beyond the browser

news
Mar 28, 20192 mins

WASI promises a standard interface for WebAssembly to access system resources like file systems and network connections

gear turn industry machine motion integration
Credit: Thinkstock

Mozilla has announced a new standardization effort to provide a consistent way for WebAssembly applications to interact with any operating system they run on.

Dubbed WASI, or WebAssembly System Interface, the currently experimental project provides WebAssembly applications with a set of abstractions for performing tasks such as reading and writing files and network I/O. Each WebAssembly host implements WASI for the platform it runs on.

A key part of WASI, according to Mozilla, is that it is platform-independent. Languages like C provide a standard library to interface with the file system and memory, for example. Similarly, WASI can be thought of as a standard library for cross-platform abstractions like files or network sockets.

Another key element of WASI is that these behaviors are sandboxed. One example given by Mozilla is file access. A WASI-managed call to open a file would only work for the directories the application has explicit permission to read from or write to. Those permissions could also be limited per module.

Using WASI will require recompiling existing WebAssembly to work correctly, but WebAssembly is still early enough in its development that a change like this isn’t likely to be disruptive. Right now, two of the major toolchains for writing WebAssembly apps, Rust and C/C++, support WASI. Both leverage LLVM’s ability to generate WebAssembly code to achieve this.

To run WASI-enabled apps, you currently need more than stock WebAssembly support in the browser. One method is to use a browser-based polyfill, in much the same way that experimental features of JavaScript can be used. Another is by way of wasmtime, a standalone WebAssembly runtime that doesn’t use a browser. A third is yet another standalone runtime, Lucet, built by Fastly using Mozilla’s Cranelift code generation system. Mozilla hopes that in time browsers will support WASI natively.

Serdar Yegulalp

Serdar Yegulalp is a senior writer at InfoWorld. A veteran technology journalist, Serdar has been writing about computers, operating systems, databases, programming, and other information technology topics for 30 years. Before joining InfoWorld in 2013, Serdar wrote for Windows Magazine, InformationWeek, Byte, and a slew of other publications. At InfoWorld, Serdar has covered software development, devops, containerization, machine learning, and artificial intelligence, winning several B2B journalism awards including a 2024 Neal Award and a 2025 Azbee Award for best instructional content and best how-to article, respectively. He currently focuses on software development tools and technologies and major programming languages including Python, Rust, Go, Zig, and Wasm. Tune into his weekly Dev with Serdar videos for programming tips and techniques and close looks at programming libraries and tools.

More from this author