liveBook · Manning

Binary component

As explained in Server-Side WebAssembly

A binary component is a WebAssembly component packaged as a compiled binary artifact.

A binary component is a compiled WebAssembly component artifact that can interact with another component or with a host. Its interfaces are described with WIT, while generated bindings connect the interface to Rust code. section 4.5

Compose and run a binary component

Build the binary and library components with cargo component build --release, install wac-cli 0.6.1, plug them into composability.wasm, then run wasmtime composability.wasm to produce “Hello from Lib!”.

How Server-Side WebAssembly covers it

How deep it goes
Builds the artifact through WIT, Cargo metadata, Rust bindings, release compilation, composition, and execution.
Examples
Uses composability_bin, composability_lib, hello-world, composability.wasm, and the output “Hello from Lib!”.
What it assumes
Assumes familiarity with an existing library component and introduces the needed WIT import and Cargo configuration.
What you can do after
Build it from scratch, compose it with WAC, and execute the resulting artifact with Wasmtime.
How it connects
Connects WebAssembly components, WIT, Rust, cargo component, WAC, and Wasmtime.

Related concepts

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