From f3d890a36d6299dbd70377ce57b0bd9d61de5c1b Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Fri, 26 Jan 2024 12:03:59 +0100 Subject: docs: working selfhosted example Signed-off-by: Henry Gressmann --- examples/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/README.md (limited to 'examples/README.md') diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..ce47073 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,22 @@ +# Examples + +## WasmRust + +These are examples using WebAssembly generated from Rust code. +To run these, you first need to build the Rust code into WebAssembly, since the wasm files are not included in the repository to keep it small. +This requires the `wasm32-unknown-unknown` target and `wasm-opt` to be installed (available via Binaryen). + +```bash +$ ./examples/rust/build.sh +``` + +Then you can run the examples: + +```bash +$ cargo run --example wasm-rust +``` + +Where `` is one of the following: + +- `hello`: A simple example that prints a number to the console. +- `tinywasm`: Runs `hello` using TinyWasm - inside of TinyWasm itself! -- cgit v1.3.1