A WebAssembly (Wasm) module is the core, raw form of Wasm: a compiled binary built for execution by a JavaScript engine or server-side Wasm runtime. Its low-level foundation consists of four basic types and linear memory, enabling fast, sandboxed execution without assumptions about a particular operating system or platform. section 2.3.2 section 4.0 section 2.3.4
In Rust, configure a library to emit a module by setting `crate-type = ["cdylib"]`, then compile for a Wasm target. `wasm32-unknown-unknown` produces a generic module with no designated OS dependencies; release builds apply optimizations. The resulting `.wasm` file can be executed by a compatible runtime. section 2.3.2 section 2.3.4
Listing 2.2 hello_world_guest Cargo.toml file
[package] name = "hello_world_guest" version = "0.1.0" edition = "2021" [lib] crate-type = ["cdylib"] [dependencies]
This Cargo manifest turns the Rust guest library into a dynamic-library output suitable for building as a `.wasm` module. section 2.3.2
A raw Hello, World guest
A host can place a string in a module’s linear memory and call guest code using integer offsets and lengths. The guest returns data through the same shared memory arrangement. This works, but changing offsets or string-prefix lengths can corrupt results; multiple modules with different memory-management assumptions make custom contracts fragile. section 2.0 section 2.3.6
Modules deliberately leave richer data exchange to custom host contracts. Wasm components wrap modules and use WebAssembly Interface Types (WIT) plus the Canonical ABI to represent richer values and communicate with more generic hosts. Converting a module to a component wraps it, but does not by itself add WASI Preview 2 APIs. section 4.0 section 4.3
For distribution, a Wasm binary packages application logic rather than a guest userspace and system libraries. Compared with container images, this can yield smaller artifacts and faster startup. A Wasm module can also serve as a container entrypoint, run through a Wasm runtime managed by `containerd-shim-wasm`. section 7.1 section 7.2 section 7.3

