bytecodealliance / bytecodealliance/wasmtime
Add Additional Modules
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
In the readme, it says "Initially, the focus is on WASI Core, an API module that covers files, networking, and a few other things. Additional modules are expected to be added in the future."
I'm curious as to what it would take to start adding additional modules (I'm interested in contributing, and possibly helping design APIs outside of file management and networking).
#### Feature
Adding an API modules to cover something like a canvas (using JavaScript terminology), audio support, etc.
#### Benefit
Opens up possibilities to make graphics applications on WASI, or make a WASI virtual machine operating system (both are things I'm interested in doing).
#### Implementation
I think fairly minimal and simple asynchronous APIs inspired from [cala::speaker](https://docs.rs/cala/0.8.0/cala/speaker/index.html)/[cala::microphone](https://docs.rs/cala/0.8.0/cala/microphone/index.html) and [cala::pixels](https://docs.rs/cala/0.8.0/cala/pixels/index.html)/[cala::draw](https://docs.rs/cala/0.8.0/cala/draw/index.html) could be used (Cala is my project that I would like to use these features for). wasmtime could possibly depend on it too or borrow some of the code from it in order to implement a "canvas" or "audio" module in the runtime. A current issue with that proposal at the moment, is that most of the cala APIs currently only work on Linux, but that will likely change in the (hopefully) near future.
#### Alternatives
I'm guessing there's a way to link a WASI program to a native program, with some FFI calls, say between a Rust program that includes wasmtime to run the web assembly (similar to just using the wasm32-unknown-unknown target). Although, at that point it would be fine to just use the wasm32-unknown-unknown target. I think it would be better if wasmtime included the additional modules.
Also, has any work been done to add any other modules besides WASI Core, that I am not aware of?
**edit**: A WebGPU-based API could work as a (probably better) alternative for graphics
Contributor guide
Assessment
This issue has not been assessed yet.