Skip to content

Files

Latest commit

16b0879 · Jan 31, 2021

History

History
This branch is 12 commits ahead of, 41 commits behind rhysd/wain:master.

api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jan 29, 2021
Jan 31, 2021
Jan 31, 2021
Jan 31, 2021

This directory shows some examples to know how to use wain interpreter from Rust.

  • execute.rs: Parse .wasm binary file into tree. Then validate and execute it.
  • wat.rs: Parse .wat text file into tree. Then validate and execute it.
  • invoke.rs: Parse and validate Wasm module which only includes one int add(int) function. Then instantiate an abstract machine runtime and invoke the add function with arguments from Rust.

These examples can be run easily via cargo run --example.

$ git clone https://github.com/rhysd/wain.git && cd wain/
$ cargo run --example execute
$ cargo run --example wat
$ cargo run --example invoke