add_one
function of a guest Wasm module, which adds 1
to the value passed as a parameter, and returns the result.Cargo.toml
to add the Wasmer dependencies as shown below:Makefile
:wasmer.h
header file that you need to include to start using Wasm in C.wat2wasm
to do the translation..wasm
file), here is how we would have loaded it:Store
.Store
is 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.Instance
out 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 run
command. The output should look like this:go run main.go
command. The output should look like this:python instance.py
command.php instance.php
command.make clean instance && ./instance
command. The output should look like this:ruby instance.rb
command.