* Move all examples to a top-level directory This commit moves all API examples (Rust and C) to a top-level `examples` directory. This is intended to make it more discoverable and conventional as to where examples are located. Additionally all examples are now available in both Rust and C to see how to execute the example in the language you're familiar with. The intention is that as more languages are supported we'd add more languages as examples here too. Each example is also accompanied by either a `*.wat` file which is parsed as input, or a Rust project in a `wasm` folder which is compiled as input. A simple driver crate was also added to `crates/misc` which executes all the examples on CI, ensuring the C and Rust examples all execute successfully.
14 lines
315 B
Plaintext
14 lines
315 B
Plaintext
(module
|
|
(memory (export "memory") 2 3)
|
|
|
|
(func (export "size") (result i32) (memory.size))
|
|
(func (export "load") (param i32) (result i32)
|
|
(i32.load8_s (local.get 0))
|
|
)
|
|
(func (export "store") (param i32 i32)
|
|
(i32.store8 (local.get 0) (local.get 1))
|
|
)
|
|
|
|
(data (i32.const 0x1000) "\01\02\03\04")
|
|
)
|