1 Introduction to Wasm on the server
This chapter covers
- The evolution of Wasm from a browser-based tool to a versatile technology for server-side development.
- The key attributes of Wasm: performance, security, and flexibility.
- Practical scenarios where Wasm excels.
- The limitations and challenges of adopting Wasm in server-side development.
WebAssembly, commonly abbreviated as Wasm, is a construct that is akin to an instruction set architecture (ISA) like x86_64, aarch64, and others. In the same way you can compile your code to such architectures, you can compile your code to Wasm. But, unlike x86_64 or aarch64, you can't go to the store and buy a computer that contains a Wasm chip. Wasm is not a real or physical platform. As illustrated in figure 1.1, it can be thought of as a hardware abstraction layer (HAL) that is entirely agnostic over the hardware itself. Wasm can then be transformed into native code for the specific hardware it is running on. In fact, one of Wasm’s goals is to serve as a common denominator across different ISAs.
Figure 1.1 Wasm as an abstraction layer virtualizing over various kinds of hardware.
