4 Interfacing Wasm with the Underlying System
This chapter covers
- Implementing APIs with the WebAssembly System Interface (WASI)
- The new capabilities of WASI 0.2
- Converting a Wasm Module to a Wasm Component
- Using WASI-Virt to restrict or allow component capabilities
- Composing Wasm components together
At this point in our learning of Wasm for server-side development, as illustrated in figure 4.1, we have a somewhat clear picture of what Wasm modules and what Wasm components are, together with the differences between the two.
Figure 4.1 Comparing Wasm modules and Wasm components

Wasm modules are core Wasm—they are what we got from the first implementation of the Wasm spec. A binary format with four basic types and a linear memory block that sets the stage for very quick (near native) and safe (sandboxed) execution of code—be it in a JavaScript engine (on the browser) or in a Wasm runtime (on the server).