mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Co-Authored-By: Valentyn Faychuk <valy@faychuk.com> Co-Authored-By: Lee Dogeon <dev.moreal@gmail.com>
617 B
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) -> i32kv_get(key_ptr: i32, key_len: i32, val_ptr: i32, val_len: i32) -> i32print(msg_ptr: i32, msg_len: i32) -> i32