Files
Jeong YunWon eac8968f84 Add wasm runtime and fix the example code to actually run
Co-Authored-By: Valentyn Faychuk <valy@faychuk.com>
Co-Authored-By: Lee Dogeon <dev.moreal@gmail.com>
2025-11-17 21:30:28 +09:00

617 B

Simple WASM Runtime

WebAssembly runtime POC with wasmer with HashMap-based KV store. First make sure to install wat2wasm and rust.

# following command installs rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

cargo run --release <wasm binary>

WASM binary requirements

Entry point is eval(code_ptr: i32, code_len: i32) -> i32, following are exported functions, on error return -1:

  • kv_put(key_ptr: i32, key_len: i32, val_ptr: i32, val_len: i32) -> i32
  • kv_get(key_ptr: i32, key_len: i32, val_ptr: i32, val_len: i32) -> i32
  • print(msg_ptr: i32, msg_len: i32) -> i32