WASI 需额外引入 wasmi_wasi crate,C-API 需 wasmi_c_api_impl crate;部分 Wasm 提案(如 gc、threads、exception-handling)尚未支持;README 未给出 CLI 用法,需按 docs/usage.md 通过 Rust API 集成

wasmi
wasmi-labsApache-2.0活跃维护轻量高效的 WebAssembly 解释器,专为嵌入式系统和插件运行时设计,提供确定性执行和燃料计量,适合资源受限环境。
WebAssembly (Wasm) Interpreter - An efficient, lightweight, and deterministic WebAssembly interpreter for embedded systems and plug-in runtimes.
cargo add wasmiREADME 未说明具体硬件要求;作为 Rust 解释器,可在 no_std 嵌入式环境及跨平台运行,未提及 GPU 或显存。
轻量高效的 WebAssembly 解释器,面向嵌入式与插件运行时,提供确定性执行
轻量高效的 WebAssembly 解释器,专为嵌入式系统和插件运行时设计,提供确定性执行和燃料计量,适合资源受限环境。
核心能力
- 以解释方式执行 Wasm,无需 JIT,可抵抗编译器/JIT 炸弹
- 支持 no_std 嵌入式环境,跨平台运行
- API 大致对齐 Wasmtime,可作为其替代品
- 内置 fuel 计量,可限制执行开销
- 100% 通过 WebAssembly 官方规范测试套件
容易踩的坑
- v2.0.0v2.0.0 - 2026/09/01最新正式版2026-09-01 · 2026-09-01 11:56 UTC
This release comes with an article: Wasmi 2.0 - Engineering Of The Fastest WebAssembly Interpreters
Upgrading from Wasmi
1.x? Please refer to the Wasmi v1 to v2 migration guide which lists all the changes that require action from users.Wasmi
2.0.0includes all changes of the2.0.0-beta.0up to2.0.0-beta.10releases. Since those are far too many to repeat here, this entry only lists the highlights. For the complete, PR-by-PR record please refer to the respective beta release entries:- [Wasmi v2.0.0-beta.10]
- [Wasmi v2.0.0-beta.9]
- [Wasmi v2.0.0-beta.8]
- [Wasmi v2.0.0-beta.7]
- [Wasmi v2.0.0-beta.6]
- [Wasmi v2.0.0-beta.5]
- [Wasmi v2.0.0-beta.4]
- [Wasmi v2.0.0-beta.3]
- [Wasmi v2.0.0-beta.2]
- [Wasmi v2.0.0-beta.1]
- [Wasmi v2.0.0-beta.0]
Highlights
A completely new interpreter core
- Wasmi has an entirely new internal IR and executor. 🚀 [#1655]
- Benchmarks conclude that Wasmi v2.0 is geomean roughly 2.2x faster than Wasmi v1.0.
- Wasmi IR operators now store their results in accumulator registers, the same
interpreter architecture used by the fastest Wasm interpreters, Wasm3 and Stitch.
- PRs: [#1827] [#1855]
- Benchmarks concluded that Wasmi is on par and sometimes even exceeds performance of its competition now.
- Wasmi's executor now uses fixed 64-bit cells. [#1755]
- Enabling the
simdcrate feature no longer affects memory consumption or execution performance of non-simdWasm code.
- Enabling the
- Operator dispatch is tail-call based on targets that are known to support it and
falls back to the portable (loop-based) dispatch automatically via the new
default-enabled
auto-dispatchcrate feature. [#1968] - Re-designed
CodeMapto be lock-free and append-only significantly improving Wasm to Wasm call performance.- PRs: [#1898] [#1893]
- A new
InstanceEntitylayout plus caching greatly improved access to all instance related data, namelyFunc,Global,Memory,Table,DataandElem.- PRs: [#1940] [#1996] [#1997]
- Despite Wasmi's module independent bytecode, instance access is now as efficient as in Wasm3's or Stitch'es executors with their instance-related bytecodes.
- The
count/globalsbenchmark improved by a whopping ~35%. wasmi::Tableelements shrank from 64-bit (or even 128-bit with thesimdcrate feature enabled) to flat 32-bit references, shrinking Wasm tables by a factor of 2-4x.- PRs: [#1747] [#1776]
Binary artifact size
- Added a new
validatecrate feature that controls whether Wasmi supports Wasm validation. [#1902]- Users who have full control over the Wasm inputs to Wasmi can reduce binary artifact sizes by ~200-300kB by disabling it.
- Support for
memory64is now optional via thememory64crate feature. [#1934] - Richer
Opdebug output moved behind a new, default-disableddebugcrate feature and generic monomorphization in translation was replaced by explicit V-Tables.- PRs: [#1959] [#1961] [#1960]
Fuel metering
- Wasmi's fuel metering is now stable: it is tied to the input Wasm bytecode instead of
Wasmi's internal bytecode. [#2013]
- While less precise, it stays relatively stable and is the same technique that is also used in Wasmtime.
- Fuel costs can now be customized via the new
Config::operator_costandConfig::fuel_costAPIs. [#2025]
Crate Features & configuration
- Added support for the Wasm deterministic profile via the new
deterministiccrate feature. [#1947] - Added a
Configoption to disallow running thestartfunction of Wasm modules. [#1985] - Added a new
libmcrate feature to enforcelibmusage. [#1860] - Added a new
unstablecrate feature which enables Rust's unstablebecomekeyword to enforce tail calls in Wasmi's operator dispatch on nightly Rust. [#1825] - Added richer
- v2.0.0-beta.10v2.0.0-beta.10 - 2026/08/10pre-release2026-08-10 · 2026-08-10 14:57 UTC
查看更新说明
Added
- Added way to customize dynamic fuel metering. #2025
- Added stable fuel metering. #2013
- This replaces Wasmi's old fuel metering that was tied to its internal bytecode.
- The new stable fuel metering is tied to the input Wasm bytecode instead.
- While less precise, it has the big advantages that it stays relatively stable and that it is the same technique that is also used in Wasmtime.
- Added more optimizations to make Wasmi execute even faster:
- Massively improve performance across the board with fix that improves branch prediction. #2027
- Re-use
spin Wasm calls. #2014- This improves performance of host calls primarily.
- Add
InstanceEntitypointer toWasmFuncEntity. #2018- This improves performance of
call_indirectandcall_imported.
- This improves performance of
- Add special
call_indirectoperator variants for(table 0). #2019- This is very beneficial since more
call_indirectoperators work on(table 0).
- This is very beneficial since more
- Reduce tons of unnecessary indirections in Wasmi's executor:
Internal
- v2.0.0-beta.9v2.0.0-beta.9 - 2026/07/29pre-release2026-07-29 · 2026-07-29 00:43 UTC
查看更新说明
Internal
- Add
inlineannotations to prevent spilling in some execution handlers. - Simplify fetching memory bytes in the executor. #2010
- This improves codegen for some
loadandstoreexecution handlers.
- This improves codegen for some
- Make the
Insttype wrap usize on platforms with enough GPRs. #2011- This improves performance on platforms such as
aarch64(a.k.a Apple Silicon).
- This improves performance on platforms such as
- Add
- v2.0.0-beta.8v2.0.0-beta.8 - 2026/07/27pre-release2026-07-27 · 2026-07-27 18:41 UTC
查看更新说明
Added
- Added
Configoption to disallow running thestartfunction of Wasm modules. #1985 - Added some more optimizations to Wasmi:
- Greatly improved speed for accessing instance related objects in the executor. #1940
- This optimization builds on a new improved internal Wasm instance layout + caching.
- Improve performance of
call_importedandcall_indirectvia caching. #1996 - Improve performance for accessing instance related objects on 32-bit platforms. #1997
- Resolve deduplicated function types at translation time to improve
call_indirectperformance. #2006 - All in all the
count/globalsbenchmark saw a whopping ~35% improvement in performance.- Despite Wasmi's module related bytecode, instance access is now as efficient as in Wasm3's or Stitch'es executors with their instance-related bytecodes.
- Greatly improved speed for accessing instance related objects in the executor. #1940
Fixed
- Fix potential memory invadliation bug when tail calling host functions. #1999
Internal
- Added benchmark to test
call_indirectperformance. #1993 - Added benchmark to test
call_importedperformance for non-host calls. #1994 - Added
Stable{Arena,Vec}towasmi_collections. #1987- These new collections are similar to
ArenaandVecrespectively but with stable internal pointers to their contained items. - These collections were required to implement #1940.
- These new collections are similar to
- Added
- v2.0.0-beta.7v2.0.0-beta.7 - 2026/07/09pre-release2026-07-09 · 2026-07-09 12:09 UTC
查看更新说明
Fixed
- Fixed an issue that
cmp+branchfusions were not applied in all valid cases. #1975
- Fixed an issue that
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
| Continuous Integration | Test Coverage | Documentation | Crates.io |
|---|---|---|---|
Wasmi - WebAssembly (Wasm) Interpreter
Wasmi is an efficient and lightweight WebAssembly interpreter with a focus on constrained and embedded systems.
Distinct Features
- Simple, correct and deterministic execution of WebAssembly.
- Efficient and cross-platform WebAssembly runtime for
no_stdembedded environments. - Compiler/JIT bomb resisting translation.
- Loosely mirrors the Wasmtime API to act as drop-in replacement.
- 100% WebAssembly spec testsuite compliance.
- Built-in support for fuel metering.
- Supports the official Wasm C-API.
Security Audits
Wasmi is suitable for safety critical use cases and has been audited twice.
| Wasmi Version(s) | Auditor | Contractor | Report |
|---|---|---|---|
0.36.0-0.38.0 | Runtime Verification Inc. | Stellar Development Foundation | |
0.31.0 | SRLabs | Parity Technologies |
Docs
- 📖 Usage Guide: learn how to use the Wasmi API properly.
- 🛠️ Development Guide: learn how to develop for Wasmi.
- ✨ Crate Features: learn about
wasmicrate features.
WebAssembly Features
| Embeddings | ||
|---|---|---|
| ✅ | WASI | WASI (wasip1) support via the wasmi_wasi crate. |
| ✅ | C-API | Official Wasm C-API support via the wasmi_c_api_impl crate. |
Used by
If you want your project on this list please inform me about you project and how Wasmi is used.
Soroban · Typst · Zellij · Josh · Ripple · Firefly Zero · icu4x · orbitinghail · smoldot · Munal OS · Ayaka · Project Oak
Sponsors
Special thanks to the past and present sponsors of the Wasmi project.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.