Hi! I'm trying to figure out if there's a way to remove my dependence on WASI by directly using host functions provided by the underlying engine to print to the console. For example, (import "wasmtime" "putc" (func $putc (param i32))
.
Do you know if this exists in wasmtime? If so, where would I be able to find such a list of host functions that I can directly import/leverage in my own modules?
(To give context, I'm working on the Wasm instrumentation DSL called whamm!
and am trying to extend the portability of some of the features to application contexts that are unable to run WASI.)
Wasmtime doesn't provide built-in functions like this, no. In that sense it's like JS where the wasm engine doesn't provide any imports by default and all imports must be supplied by JS. In a Wasmtime embedding (e.g. Rust for example) you can define any function with any name. On the CLI you're limited to WASI functions as the only ones that are built-in by default.
Alrighty, thanks for the quick response @Alex Crichton !
Last updated: Nov 26 2024 at 01:30 UTC