The MoonBit "Hello World" project does not work by default with Wasmtime (or other runner).
cd moonbit
moon run ./src/main
# Hello, world!
cd moonbit
moon build --target wasm
wasmtime target/wasm/release/build/main/main.wasm 1 master
# Error: failed to run main module `target/wasm/release/build/main/main.wasm`
#
# Caused by:
# 0: failed to instantiate "target/wasm/release/build/main/main.wasm"
# 1: unknown import: `spectest::print_char` has not been defined
Let implement spectest::print_char
in wasmtime
cd ext_wasmtime
cargo build --release
We have now a compatible wasm runtime
./ext_wasmtime/target/release/ext-wasmtime
# Hello, world!