add_onefunction of a guest Wasm module, which adds
1to the value passed as a parameter, and returns the result.
Cargo.tomlto add the Wasmer dependencies as shown below:
wasmer.hheader file that you need to include to start using Wasm in C.
.wasmfile), here is how we would have loaded it:
Storeis a representation of the actual state of the module: it represents the state of every entity in the module during its lifecycle. It also holds the engine which is what will be used to actually compile the module.
Instanceout of the Wasm module. As for the previous step, here we need more than just the compiled module: we also need to define imports.
cargo runcommand. The output should look like this:
go run main.gocommand. The output should look like this:
make clean instance && ./instancecommand. The output should look like this: