Configs2026年7月14日·1 分钟阅读

WAMR — WebAssembly Micro Runtime for Embedded and IoT

WAMR (WebAssembly Micro Runtime) is a lightweight, high-performance WebAssembly runtime by the Bytecode Alliance. It supports interpreter, ahead-of-time, and JIT compilation modes, targeting resource-constrained devices from MCUs to cloud edge nodes.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
WAMR
直接安装命令
npx -y tokrepo@latest install d19392cd-7f83-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

WAMR is a compact WebAssembly runtime developed under the Bytecode Alliance. It brings the portability and sandboxing of WebAssembly to environments where Wasmtime or V8 would be too large, including microcontrollers, RTOS-based systems, and edge computing platforms.

What WAMR Does

  • Executes WebAssembly modules on devices with as little as 50KB RAM
  • Offers three execution modes: interpreter, ahead-of-time (AOT) compilation, and JIT
  • Provides WASI (WebAssembly System Interface) support for file and socket access
  • Supports multi-threading with the WASM threads proposal
  • Embeds into C/C++ host applications via a clean native API

Architecture Overview

WAMR includes a stack-based interpreter for minimal footprint, an AOT compiler that translates WASM to native code offline, and an optional LLVM-based JIT for runtime compilation. The runtime manages linear memory, tables, and module instances inside a sandboxed execution environment. A built-in app management framework supports dynamic loading and lifecycle control of WASM apps.

Self-Hosting & Configuration

  • Build with CMake; select execution mode via cmake flags (-DWAMR_BUILD_INTERP, -DWAMR_BUILD_AOT)
  • Cross-compile for Zephyr, NuttX, RT-Thread, or bare-metal ARM targets
  • Use wamrc to ahead-of-time compile WASM to native for production deployment
  • Enable WASI for filesystem and network access in supported environments
  • Embed in a host app by linking libiwasm and calling wasm_runtime_* APIs

Key Features

  • Runs on devices with as little as 50KB RAM (interpreter mode)
  • Three execution modes cover the spectrum from MCU to server
  • WASI support for portable system access
  • Dynamic module loading and unloading at runtime
  • Hardware-sandboxed execution isolates untrusted code

Comparison with Similar Tools

  • Wasmtime — full-featured Bytecode Alliance runtime; WAMR targets smaller footprint
  • Wasmer — developer-friendly with package registry; WAMR focuses on embedded constraints
  • wasm3 — pure interpreter with tiny footprint; WAMR adds AOT and JIT for higher throughput
  • WasmEdge — cloud-native WASM runtime; WAMR targets deeper embedded use cases

FAQ

Q: What is the minimum hardware for WAMR? A: The interpreter runs on Cortex-M4 with 50KB RAM. AOT mode needs more flash but runs faster.

Q: Can I use WAMR in a cloud environment? A: Yes. WAMR runs on Linux, macOS, and Windows and is used in edge computing and serverless platforms.

Q: What languages can I compile to WASM for WAMR? A: C, C++, Rust, Go (TinyGo), AssemblyScript, and any language with a WASM compilation target.

Q: Is WAMR production-ready? A: Yes. It is used in production by Intel, Xiaomi, Midea, and other companies for IoT and edge workloads.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产