Expand description
Host-side runtime for executing wasm guests via wasmer. Used by Holochain ribosomes to instantiate, cache and call zome wasms, and by anything else that needs to embed wasm with a similar shape: a long-lived host process making short-lived calls into many guest modules built from cached compiled artifacts.
The two entry points most callers reach for are
module::ModuleCache for managing compiled-module reuse and
guest::call for invoking a guest function with a serializable
payload. Errors from both sides flow through prelude::WasmError.
§Cargo features
At least one wasmer backend must be enabled. The two backends are
independent and can be enabled simultaneously; the choice is then
made at the call site by passing the appropriate engine factory to
module::ModuleBuilder::new.
wasmer-sys(default) — enables the wasmer native backend that compiles wasm via a real compiler. Requires at least one of the compiler sub-features below.wasmer-sys-cranelift(default) — Cranelift compiler. Fast to compile, good runtime performance, the default development compiler.wasmer-sys-llvm— LLVM compiler. Slower to compile, faster at runtime, the recommended choice for production deployments where compile time is amortised over many calls. Can be enabled alongsidewasmer-sys-cranelift.
wasmer-wasmi— enables the wasmi pure-Rust interpreter backend. No native code generation; suitable for environments where a compiler is not available or not desired (e.g. iOS, sandboxed builds).error-as-host(default) — when constructing aprelude::WasmErrorfrom a bareString, classify it asprelude::WasmErrorInner::Hostrather thanprelude::WasmErrorInner::Guest. Hosts that build error strings should enable this; guests should leave it off.debug-memory— enable verbosetracing::debug!logging for every host↔guest memory copy. Off by default; useful only when chasing memory bugs.