# `nanowasm`, the tiny Wasm interpreter that does not block you **This project is still unfinished and is not meant for production use.** This project aims to provide the most minimal Wasm interpreter possible in strictly portable ANSI C (C89/C90). It can run one or more Wasm applications concurrently, without threading. This project requires the [Nanowasm extensions](https://gitea.privatedns.org/xavi/nanowasm-design/) to the WebAssembly language. A NanoWasm-compatible program can be built from a MVP WebAssembly program with [`nwc`](https://gitea.privatedns.org/xavi/nwc/). ## Features - Portable **ANSI C** implementation. **Runs on bare metal environments**. - **No dependencies** other than an ANSI C (C89/C90) compiler. - Asynchronous interface that allows to **run multiple applications** **concurrently, without threads**. - **I/O-agnostic** implementation for maximum flexibility: read modules from a network, write the stack into a file, implement a MMU in software... Anything is possible! - Suitable for **resource-constrained devices**, such as microcontrollers. - **No memory allocator required**. - Supports both **big-endian and little-endian architectures**. ### Comparison chart | Feature | `nanowasm` | [`wasm-micro-runtime`] | [`wasm3`] | [`wac`] | [`toywasm`] | | ------- | ------- | ------- | ------- | ------- | ------- | | **Asynchronous interface** | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | | **I/O-agnostic** | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | | **No heap required** | ✅ | ❌ | ❌ | ❌ | ❌ | | **Big-endian support** | ✅ | ⚠️ | ✅ | ❌ | ✅ | | **No compiler-specific extensions** | ✅ | ❌ | ❌ | ❌ | ❌ | | **C dialect** | **`c89`** | `gnu99` | `c99` | `gnu99` | `c11` | | **Public functions** | **7** | 156 | 44 | N/A | N/A | | **Minimal `.text` footprint** | **49 KiB** | 452 KiB | 519 KiB | N/A | N/A | | **Per-module memory usage** | ~1016 bytes | N/A | N/A | N/A | N/A | | **Per-instance memory usage** | ~728 bytes | N/A | N/A | N/A | N/A | Also, see a [detailed explanation](COMPARE.md) behind the numbers above. ## What `nanowasm` is not As opposed to other interpreters, `nanowasm` prefers lower memory usage rather than run-time performance. Therefore, it should not be unfairly compared _performance_-wise against other interpreters. ## How to build Use the conventional process in CMake projects: ``` cmake -B