xref: /wasmtime-44.0.1/examples/README.md (revision 7fa89c4a)
1# Examples of the `wasmtime` API
2
3This directory contains a number of examples of using the `wasmtime` API from
4different languages. Currently examples are all in Rust and C using the
5`wasmtime` crate or the wasmtime embedding API.
6
7Each example is available in both C and in Rust. Examples are accompanied with a
8`*.wat` file which is the wasm input, or a Rust project in a `wasm` folder which
9is the source code for the original wasm file.
10
11Rust examples can be executed with `cargo run --example $name`. C examples can
12be built with `mkdir build && cd build && cmake ..`. You can run
13`cmake --build .` to build all examples or
14`cmake --build . --target wasmtime-$name`, replacing the name as you wish. They
15can also be [built manually](https://docs.wasmtime.dev/c-api/).
16
17For more information see the examples themselves!
18