wasmi

wasmi-labsApache-2.0活跃维护

轻量高效的 WebAssembly 解释器,专为嵌入式系统和插件运行时设计,提供确定性执行和燃料计量,适合资源受限环境。

WebAssembly (Wasm) Interpreter - An efficient, lightweight, and deterministic WebAssembly interpreter for embedded systems and plug-in runtimes.

v2.0.0发布于 2026-09-01 11:56 UTC2,344star +2 / 7 天379fork同步于 2026-11-10 23:45 UTC

怎么上手

由 README 提炼,执行前请确认
cargo add wasmi
硬件要求按 README 说明

README 未说明具体硬件要求;作为 Rust 解释器,可在 no_std 嵌入式环境及跨平台运行,未提及 GPU 或显存。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

轻量高效的 WebAssembly 解释器,面向嵌入式与插件运行时,提供确定性执行

轻量高效的 WebAssembly 解释器,专为嵌入式系统和插件运行时设计,提供确定性执行和燃料计量,适合资源受限环境。

核心能力

  • 以解释方式执行 Wasm,无需 JIT,可抵抗编译器/JIT 炸弹
  • 支持 no_std 嵌入式环境,跨平台运行
  • API 大致对齐 Wasmtime,可作为其替代品
  • 内置 fuel 计量,可限制执行开销
  • 100% 通过 WebAssembly 官方规范测试套件

容易踩的坑

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

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.0.0
  1. 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.0 includes all changes of the 2.0.0-beta.0 up to 2.0.0-beta.10 releases. 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 simd crate feature no longer affects memory consumption or execution performance of non-simd Wasm code.
    • 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-dispatch crate feature. [#1968]
    • Re-designed CodeMap to be lock-free and append-only significantly improving Wasm to Wasm call performance.
      • PRs: [#1898] [#1893]
    • A new InstanceEntity layout plus caching greatly improved access to all instance related data, namely Func, Global, Memory, Table, Data and Elem.
      • 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/globals benchmark improved by a whopping ~35%.
      • wasmi::Table elements shrank from 64-bit (or even 128-bit with the simd crate 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 validate crate 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 memory64 is now optional via the memory64 crate feature. [#1934]
    • Richer Op debug output moved behind a new, default-disabled debug crate 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_cost and Config::fuel_cost APIs. [#2025]
    Crate Features & configuration
    • Added support for the Wasm deterministic profile via the new deterministic crate feature. [#1947]
    • Added a Config option to disallow running the start function of Wasm modules. [#1985]
    • Added a new libm crate feature to enforce libm usage. [#1860]
    • Added a new unstable crate feature which enables Rust's unstable become keyword to enforce tail calls in Wasmi's operator dispatch on nightly Rust. [#1825]
    • Added richer
  2. 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 sp in Wasm calls. #2014
        • This improves performance of host calls primarily.
      • Add InstanceEntity pointer to WasmFuncEntity. #2018
        • This improves performance of call_indirect and call_imported.
      • Add special call_indirect operator variants for (table 0). #2019
        • This is very beneficial since more call_indirect operators work on (table 0).
      • Reduce tons of unnecessary indirections in Wasmi's executor:

    Internal

    • Add new sort-dyn benchmark test case to test call_indirect performance. #2017
    • Simplify Wasmi users README listing. #2021
  3. v2.0.0-beta.9v2.0.0-beta.9 - 2026/07/29pre-release2026-07-29 · 2026-07-29 00:43 UTC
    查看更新说明

    Internal

    • Add inline annotations to prevent spilling in some execution handlers.
    • Simplify fetching memory bytes in the executor. #2010
      • This improves codegen for some load and store execution handlers.
    • Make the Inst type wrap usize on platforms with enough GPRs. #2011
      • This improves performance on platforms such as aarch64 (a.k.a Apple Silicon).
  4. v2.0.0-beta.8v2.0.0-beta.8 - 2026/07/27pre-release2026-07-27 · 2026-07-27 18:41 UTC
    查看更新说明

    Added

    • Added Config option to disallow running the start function 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_imported and call_indirect via caching. #1996
      • Improve performance for accessing instance related objects on 32-bit platforms. #1997
      • Resolve deduplicated function types at translation time to improve call_indirect performance. #2006
      • All in all the count/globals benchmark 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.

    Fixed

    • Fix potential memory invadliation bug when tail calling host functions. #1999

    Internal

    • Added benchmark to test call_indirect performance. #1993
    • Added benchmark to test call_imported performance for non-host calls. #1994
    • Added Stable{Arena,Vec} to wasmi_collections. #1987
      • These new collections are similar to Arena and Vec respectively but with stable internal pointers to their contained items.
      • These collections were required to implement #1940.
  5. 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+branch fusions were not applied in all valid cases. #1975

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译
    Continuous IntegrationTest CoverageDocumentationCrates.io
    cicodecovdocscrates

    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_std embedded 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)AuditorContractorReport
    0.36.0-0.38.0Runtime Verification Inc.Stellar Development FoundationPDF
    0.31.0SRLabsParity TechnologiesPDF

    Docs

    WebAssembly Features

    WebAssembly ProposalWebAssembly Proposal
    ✅mutable-global≥ 0.14.0✅custom-page-sizes≥ 0.41.0
    ✅saturating-float-to-int≥ 0.14.0✅memory64≥ 0.41.0
    ✅sign-extension≥ 0.14.0✅wide-arithmetic≥ 0.42.0
    ✅multi-value≥ 0.14.0✅simd≥ 0.43.0
    ✅bulk-memory≥ 0.24.0✅relaxed-simd≥ 0.44.0
    ✅reference-types≥ 0.24.0📅function-referencesTracking Issue
    ✅tail-calls≥ 0.28.0📅gcTracking Issue
    ✅extended-const≥ 0.29.0📅threadsTracking Issue
    ✅multi-memory≥ 0.37.0📅exception-handlingTracking Issue
    Embeddings
    ✅WASIWASI (wasip1) support via the wasmi_wasi crate.
    ✅C-APIOfficial 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

    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.