#wasm-interpreter #wasmi #interpreter

sys no-std wasmi_c_api_impl

C bindings for the Wasmi WebAssembly interpreter

46 releases (8 stable)

1.0.7 Jan 9, 2026
1.0.6 Dec 25, 2025
0.51.5 Dec 6, 2025
0.51.2 Nov 19, 2025
0.36.0 Jul 24, 2024

#1329 in WebAssembly

Download history 1303/week @ 2025-09-30 1306/week @ 2025-10-07 492/week @ 2025-10-14 1335/week @ 2025-10-21 935/week @ 2025-10-28 1221/week @ 2025-11-04 1175/week @ 2025-11-11 1858/week @ 2025-11-18 2062/week @ 2025-11-25 1101/week @ 2025-12-02 1550/week @ 2025-12-09 750/week @ 2025-12-16 209/week @ 2025-12-23 539/week @ 2025-12-30 1032/week @ 2026-01-06 1222/week @ 2026-01-13

3,213 downloads per month
Used in 3 crates (via wasmer)

MIT/Apache

1.5MB
30K SLoC

Wasmi C-API

Usage in a C Project

If you have a C project with which you want to use Wasmi, you can interface with Wasmi's C API:

Prerequisites

From the root of the Wasmi repository, run the following commands:

cmake -S crates/c_api -B target/c_api --install-prefix "$(pwd)/artifacts" &&
cmake --build target/c_api --target install

These commands will produce the following files:

  • artifacts/lib/libwasmi.{a,lib}: The static Wasmi library.
  • artifacts/lib/libwasmi.{so,dylib,dll}: The dynamic (or shared) Wasmi library.
  • artifacts/include/**.h: The header files for interfacing with Wasmi from C or C++.

Usage in a Rust Project

If you have a Rust crate that uses a C or C++ library that uses Wasmi, you can link to the Wasmi C API as follows:

  1. Add a dependency on the wasmi_c_api_impl crate to your Cargo.toml. Note that package name differs from the library name.
[dependencies]
wasmi_c_api = { version = "0.35.0", package = "wasmi_c_api_impl" }
  1. In your build.rs file, when compiling your C/C++ source code, add the C wasmi_c_api headers to the include path:
fn main() {
    let mut cfg = cc::Build::new();
    // Add the Wasmi and standard Wasm C-API headers to the include path.
    cfg
        .include(std::env::var("DEP_WASMI_C_API_INCLUDE").unwrap());
        .include(std::env::var("DEP_WASMI_C_API_WASM_INCLUDE").unwrap());
    // Compile your C code.
    cfg
        .file("src/your_c_code.c")
        .compile("your_library");
}

Dependencies

~3MB
~60K SLoC