Files
wazero/examples/namespace
Crypt Keeper 92ba4929e5 Drops support for the WebAssembly text format (#614)
This drops the text format (%.wat) and renames
InstantiateModuleFromCode to InstantiateModuleFromBinary as it is no
longer ambiguous.

We decided to stop supporting the text format as it isn't typically used
in production, yet costs a lot of work to develop. Given the resources
available and the increased work added with WebAssembly 2.0 and soon
WASI 2, we can't afford to spend the time on it.

The old parser is used only internally and will eventually be moved to
its own repository named watzero, possibly towards archival.

See #59

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-06-01 19:01:43 +08:00
..

Stateful import example

This example shows how WebAssembly modules can import their own stateful host module, such as "env", in the same runtime.

$ go run counter.go
ns1 count=0
ns2 count=0
ns1 count=1
ns2 count=1

Specifically, each WebAssembly-defined module is instantiated alongside its own Go-defined "env" module in a separate wazero.Namespace. This is more efficient than separate runtimes as instantiation re-uses the same compilation cache.