Wasmrt: Portable, lightweight and embeddable WebAssembly runtime in C
Wasmrt is a portable and lightweight WebAssembly runtime designed for embedding in C projects. It supports WASI preview1 and allows for the execution of sandboxed plugins and scripts. The runtime requires Clang and wasm-ld for building and includes various features for handling WebAssembly modules.
- ▪Wasmrt is a single-header WebAssembly runtime that targets embedding in C projects.
- ▪It supports WASI preview1 and allows for the execution of sandboxed plugins and scripts.
- ▪The runtime requires Clang and wasm-ld for building and includes a variety of features for WebAssembly module handling.
Opening excerpt (first ~120 words) tap to expand
wasmrt A portable, lightweight, single-header WebAssembly runtime with full WASI preview1 support. It targets the use case of embedding a WASM interpreter in a C project to run sandboxed plugins, scripts or portable modules. Building make # builds wasmrt / wasmrt.exe make wasm # compiles all test/*.c to test/*.wasm make test # runs the test suite make clean Requires Clang and wasm-ld. On Linux, clang + lld. On Windows, set CC in the Makefile to the Clang path. Embedding One translation unit defines the implementation. All others include the header without the macro. #define WASMRT_IMPLEMENTATION #include "wasmrt.h" wasm_module and wasm_instance are large structs. Declare them static or allocate them on the heap, not on the stack.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.