liveBook · Manning

WASI

As explained in Refactoring to Rust

WASI is a standardized system interface that allows WebAssembly programs to access operating-system-like services in a portable way.

WASI (WebAssembly System Interface) is a standard interface for connecting WebAssembly (Wasm) modules to services supplied by a host. It helps take Wasm beyond a browser-and-JavaScript setting: a compatible runtime can run a module as an executable or make it available to another application. section 10.0 section 10.1

Keep the module, interface, and runtime separate:

  • A Wasm module contains compiled code, such as a library or executable. section 10.0
  • An interface defines how the host and module communicate. Code that fulfills the expected interface can be exchanged without changing the host application. section 10.1
  • A runtime executes the module. WasmEdge is one runtime implementation with an SDK for applications that consume Wasm. section 10.8

Refactor without replacing the host

A CLI search tool can consume Wasm through the WasmEdge SDK and runtime. The host keeps its role while a module supplies code behind the agreed interface. This offers a way to migrate part of an existing application rather than rewrite it all at once. section 10.8 section 10.0

That flexibility has a boundary. The runtime provides sandboxed linear memory shared by the VM and module; communicating through it requires functions to allocate and deallocate memory in the module. WASI supplies a low-level binary interface, not a replacement for those integration details. section 10.8 section 10.0

How Refactoring to Rust covers it

How deep it goes
Explains host interfaces, module swapping, and sandboxed memory; stops short of a WASI protocol specification.
Examples
Uses WasmEdge installation and a CLI search tool that consumes Wasm.
What it assumes
Builds on browser-based Wasm and JavaScript loading while introducing WASI and host interfaces directly.
What you can do after
Apply it via the WasmEdge SDK and runtime to consume Wasm modules in an application.
How it connects
Connects WebAssembly modules with host interfaces, application binary interfaces, runtimes, and sandboxed linear memory.

Also explained in

Compare how 3 books explain WASI →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Refactoring to Rust. The section links point to the parts of the book it draws on.