Developer docs/Guides
Plugins in other languages
Any language that can build a WASI preview 2 component for the WIT world can be used to write an addon. Rust is the language we test. pelty-cli addon wasm-scaffold --lang c|tinygo writes starter templates for C and TinyGo. These templates are not compiled in CI. The scaffold labels them as untested, so treat them as a starting point.
#C (wasi-sdk + wit-bindgen)
// UNTESTED template. Generate bindings first:
// wit-bindgen c --world pelty-addon path/to/pelty.wit
// then build with wasi-sdk:
// clang --target=wasm32-wasip2 -mexec-model=reactor -o addon.wasm main.c pelty_addon.c pelty_addon_component_type.o
static void
void
bool
bool #TinyGo
// UNTESTED template. Generate bindings first:
// go run go.bytecodealliance.org/cmd/wit-bindgen-go generate -o internal path/to/pelty.wit
// then build:
// tinygo build -target=wasip2 --wit-package path/to/pelty.wit --wit-world pelty-addon -o addon.wasm .
package main
import (
"go.bytecodealliance.org/cm"
addon "__MODULE__/internal/pelty/addon/addon"
)
func init()
func main() #Rust template
//! Generated by `pelty-cli addon wasm-scaffold`.
use serde_json;
;
export!;