Stream: wasmtime

Topic: Audio (soundcard) host functions?


view this post on Zulip logical (Nov 07 2022 at 16:07):

Hi. So, my limited understanding is that modules can only make calculations with integers and floats unless they use "host functions" that are exposed in the host environment (Wasmtime). Are groups of related host functions called a component (in the component model)? Where can I see a list of all the host functions and track the progress of any new host functions that are being added? And finally, is audio possible in Wasmtime yet? Can I write a buffer of audio to the soundcard using some Wasmtime host function?

view this post on Zulip Alex Crichton (Nov 07 2022 at 16:29):

The wasmtime crate embedding API is sort of at a different abstraction level than you may be thinking. Using the wasmtime crate you have the ability of providing any host function as input, but there are no pre-defined host functions for you to choose from. Audio for example is possible but you would need to design yourself what the API looks like, how to expose it, and how to implement it. Currently there is no name for a group of host functions at the embedder level.

What you may be referring to though is WASI which is a standard definition of host APIs (e.g. file reading/writing/etc). I'm not personally aware of audio APIs in WASI but others may be. WASI is going to be defined in terms of "instances" sort of but I don't think any official name has been decided on for a group of functions, but it is organized into modules/instance along the lines of wasi-fs, wasi-random, wasi-clock, etc.

view this post on Zulip code red art (Nov 07 2022 at 16:33):

a follow up question, but where can i track the progress of component model? I have been following the issues like https://github.com/bytecodealliance/wit-bindgen/issues/314 for a while now.

is https://github.com/bytecodealliance/wasmtime/issues/4185 where i can see the rest of the progress happen?

I'm opening this issue to document my thinking as a result of trying to resolve issues like #214, #34, and #201. I mentioned a number of issues with the current wit-bindgen architecture in #214...
This is intended to be a tracking issue for the implementation of the component model proposal of WebAssembly. I'm in the progress of implementing this with work in Wasmtime starting at #4005 a...

view this post on Zulip bjorn3 (Nov 07 2022 at 17:01):

I think https://github.com/webassembly/component-model/ is the right repo.

Repository for design and specification of the Component Model - GitHub - WebAssembly/component-model: Repository for design and specification of the Component Model

view this post on Zulip Alex Crichton (Nov 07 2022 at 17:27):

I don't think there's a great place for centrally tracking the progress on the component model unfortunately, there's a lot of pieces in a lot of places at this time, but the component-model repo is definitely a good one to follow


Last updated: Nov 22 2024 at 17:03 UTC