liveBook · Manning

Interface-level type

As explained in Server-Side WebAssembly

An interface-level type is a data type specified at an interface boundary for representing values exchanged between software components.

An interface-level type describes values exchanged across software boundaries. WIT defines these values independently of programming languages, making interactions between Wasm modules and host runtimes more expressive. section 2.4

WIT expands beyond Wasm’s four core number types with:

  • Primitive values such as bool, signed and unsigned integers, floating-point numbers, characters, and strings. section 2.4
  • Composite values such as lists, optional values, results, tuples, records, and enums. section 2.4
  • The Canonical ABI lifts and lowers these representations when values cross the Wasm boundary. section 2.4
Listing 2.4 The ”Hello, World” application’s WIT
package component:hello-world-guest-wit;

world example {
    export greet: func(name: string) -> string;
}

Browse a WIT world that exports a greeting function accepting and returning strings. section 2.4

How Server-Side WebAssembly covers it

How deep it goes
Explains primitive, composite, and user-defined types plus Canonical ABI marshalling, while stopping short of adding core Wasm primitives.
Examples
Uses greeting functions, strings, lists, options, results, tuples, records, and enums as examples.
What it assumes
Assumes familiarity with Wasm module boundaries while introducing richer data representations beyond core numeric types.
What you can do after
Build it from scratch by defining language-neutral component interfaces with WIT types and boundary values.
How it connects
Connects WIT with WebAssembly, interface definition languages, host runtimes, and the Canonical ABI.

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.