summaryrefslogtreecommitdiff
path: root/examples/README.md
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2024-01-26 12:03:59 +0100
committerHenry Gressmann <mail@henrygressmann.de>2024-01-26 12:03:59 +0100
commitf3d890a36d6299dbd70377ce57b0bd9d61de5c1b (patch)
tree36b51022af641c0f464fd0c5d4456b722e5f735b /examples/README.md
parent461126ce309f99e4ad2a6ddcbc175ea01c5e8fee (diff)
docs: working selfhosted example
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'examples/README.md')
-rw-r--r--examples/README.md22
1 files changed, 22 insertions, 0 deletions
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 <example>
+```
+
+Where `<example>` 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!