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
