function Wasm.instantiate
Instantiate a WASM module with optional WASI configuration and host function imports.
Example
Host Function Signature
Host functions receive two injected arguments followed by WASM arguments:ctx- Task context (currentlyNone, reserved for future use)memory- WASM memory access (currentlyNone, reserved for future use)- Additional arguments correspond to the WASM function signature
path: - Path to the WASM binary fileargs: - Command-line arguments to pass to the WASM module (WASI)env: - Environment variables to set for the WASM module (WASI)preopened_dirs: - Directories to pre-open for filesystem access (WASI). Keys are host paths, values are guest paths.inherit_stdio: - Whether to inherit stdin/stdout/stderr from the host (default: true)imports: - Host function imports, organized by module name and function name. Important: Host functions must be imported from a loaded module viaload(), not defined in the same file. This ensures they are frozen and can be safely stored in the WASM runtime.

