functions, enclosed in braces and introduced with the interface keyword: use types.{dimension, point}; interface types { type dimension = u32; record point { x: dimension, y: dimension, } } interface canvas { type canvas-id = u64; draw-line: func(canvas: canvas-id, from: point, to: point, thickness: dimension); }
yue’s understanding: World is imports.d.ts + exports.d.ts of the component boundary. Interfaces are not exposed without world. Files can be mixed like golang. interface printer { print: func(text: string); } interface error-reporter { report-error: func(error-message: string); } world multi-function-device { // The component implements the `printer` interface export printer; // The component implements the `scan` function export scan: func() -> list<u8>; // The component needs to be supplied with an `error-reporter` import error-reporter; }
a related set of interfaces and worlds. Example: a http package = proxy interfaces + server Platforms Runtime: host env WASI The WebAssembly System Interface (since 2019?)
compile via WIT will be a part of frontend Anything that can be compile via WIT can run inside wasm/wasi’s secruity sandbox To explore Run as k8s wasm workload Can wasmtime itself compile to android app?