gitmyhub

wasm-micro-runtime

C ★ 6.0k updated 1d ago

WebAssembly Micro Runtime (WAMR)

A tiny engine for running WebAssembly programs on anything from small IoT sensors to cloud servers, with a core as small as 21 KB and support for interpreter, AOT, and JIT execution modes.

CWebAssemblyCMakeRustPythonGosetup: hardcomplexity 4/5

WebAssembly Micro Runtime (WAMR) is a lightweight system for running WebAssembly programs outside of a web browser, on everything from tiny IoT sensors to cloud servers. WebAssembly is a portable code format that lets programs compiled from C, C++, Rust, or other languages run in a sandboxed environment on almost any device. WAMR provides the engine that loads, verifies, and executes those programs.

The runtime is designed to stay very small. The core components can take as little as 21 to 59 kilobytes of binary space depending on configuration, which makes it practical for microcontrollers and embedded hardware where memory is tight. It supports three execution modes: a classic interpreter that steps through code instruction by instruction, an Ahead-of-Time compiler (AOT) that converts WebAssembly to native machine code before running it, and a Just-in-Time compiler (JIT) that converts code on the fly at runtime. AOT mode is typically the fastest and most memory-efficient option for constrained devices.

WAMR runs on a wide range of hardware architectures including X86, ARM, AArch64, and RISC-V, and supports operating systems from Linux and Windows to real-time embedded systems like Zephyr, FreeRTOS (via ESP-IDF), and NuttX. The project also includes security-relevant targets such as Intel SGX, which is a protected execution environment.

Developers can embed WAMR into their own applications using C APIs, or use language bindings for Go, Python, and Rust. A companion tool called wamrc compiles WebAssembly files into AOT format ahead of time. There is also an experimental VS Code extension for writing and debugging WebAssembly applications. Samples and benchmarks are included to help measure performance and tune memory use on specific hardware targets.

Where it fits