I am trying to find information on how to add a new API to WASI. I understand I should start with a wit-file, just like creating a component, but what are the steps to integrate it intoe a runtime, e.g. Wasmtime. This blog post by Radu was the old way of doing it, and I guess it would still work, but I am not intimately familiar with the steps needed.
Basically, I am looking for something like the component tutorial, but where the called component is a WASI API.
Some steps here: https://docs.wasmtime.dev/contributing-implementing-wasm-proposals.html?highlight=adding%20wasi#adding-component-functionality-to-wasi
Bailey Hayes said:
Some steps here: https://docs.wasmtime.dev/contributing-implementing-wasm-proposals.html?highlight=adding%20wasi#adding-component-functionality-to-wasi
Thanks @Bailey Hayes , but it was not exactly what I was looking for. I want to implement a new interface to WASI in Wasmtime. Is https://radu-matei.com/blog/adding-wasi-syscall/ still the right way to do it?
Do you want to propose a new interface for standardization or are you just looking to expose some host functionality to a wasm guest in your own environment?
For now it's about experimenting with exposing some host functionality to a wasm guest. Eventually, it might become a proposal for new interface fow wasi.
I believe this is the best documentation at the moment for wasmtime: https://docs.rs/wasmtime/32.0.0/wasmtime/component/macro.bindgen.html (the linked bindgen_examples are a good quickstart)
The resource that helped me out the most was the wasmtime repository itself. It has implementations for the wasi-xx proposals under the crates folder. It was really helpful regarding resource table handling, inner state and linking of new wasi APIs.
Last updated: Dec 06 2025 at 06:05 UTC