A WebAssembly module is the unit of deployment, loading and compilation in WebAssembly. It collects declarations such as functions, types and memories, can request imports, and can expose exports. Optional initialization includes data segments and a start function. A WebAssembly module is represented in a binary encoding or the readable WebAssembly text format.[ref]
Definitions use zero-based indices, with a separate index space for each kind of definition. Imported functions precede locally defined functions in the function index space. For example, with one imported function and two local functions, their function indices are respectively 0, 1 and 2; memory index 0 belongs to a different space. This explains why inserting a function import can change a numeric call target.[ref]
A WebAssembly module instance is the runtime realization of these declarations, with references to the allocated or imported objects. Keeping a WebAssembly module distinct from a WebAssembly module instance separates a code description from the state used while executing it. Imported state can be shared; the mere use of the same module does not specify all its runtime resources.[ref]

Articles by others on the same topic (0)

There are currently no matching articles.