wac is a WebAssembly composition tool that connects component exports to matching imports, producing a standalone composed component. Its plug-and-socket model treats exports as plugs and imports as sockets. section 4.5
Compose two Rust-produced components with this workflow:
- Build the binary and library components with cargo component build --release. section 4.5
- Install the CLI with cargo install --locked wac-cli@0.6.1. section 4.5
- Run wac plug composability_bin.wasm --plug composability_lib.wasm -o composability.wasm to connect the binary's hello-world import to the library's export. section 4.5
- Run the resulting artifact with wasmtime composability.wasm, without custom host functionality. section 4.5
Resolving hello-world
A binary component imports hello-world: func() -> string, while a library component exports the same function. wac embeds both components, wires the import to the export, and produces composability.wasm. Running it prints "Hello from Lib!". section 4.5
