Stream: general

Topic: Simple FaaS approach with witx-bindgen


view this post on Zulip arctic-alpaca (Oct 04 2021 at 18:05):

Hi,
I want to understand WASM-based FaaS systems better by building a very simple version myself. I'm currently experimenting with witx-bindgen, is this the current, correct/easiest approach for defining an interface between wasmtime and a wasm module?
Besides the test in the witx-bindgen repo, are there any examples of/with it?
Also, but I haven't actually looked into this yet, is it currently possible to stream data into/out of a wasm module with wasmtime?

view this post on Zulip Alex Crichton (Oct 05 2021 at 14:17):

The idea is that we'll be centralizing on witx-bindgen in the future with interface-types for modules interacting with the host. I don't personally know of examples beyond those in the repo (it's still in a pretty early state and isn't intended for general consumption yet, but it should be somewhat solid implementation-wise, mostly just missing polish).

Streaming data in/out is going to become easier in the future with an interface-types stream<T> type (yet to be implemented, but WASI has had a number of presentations about this). Today it can be somewhat manually done through constructing various APIs.

view this post on Zulip arctic-alpaca (Oct 05 2021 at 15:32):

After a bit of trial and error with the tests, witx-bindgen actually seems quite straight forward, at least for simple usecases. It really helps getting started with playing around with wasmtime and wasm-modules!
Is there a way to tell how far along interface types or other proposals itself or implementation of proposal in wasmtime are? I can't really tell from the discussions I found on Github.
I imagine Streaming currently could roughly work by repeatedly calling an imported/exportedchunks(...)function in a loop and dealing with the content part by part. Is this the right idea or am I missing something in the context of witx-bindgen, I'd like to avoid dealing directly with memory?

view this post on Zulip Alex Crichton (Oct 05 2021 at 15:36):

interface types and various proposals are making progress but there's not an official timeline for when things will be done or something like that. For more information on streaming though you can look through some past agendas for the WASI subgroup and there's some linked presentations there

view this post on Zulip arctic-alpaca (Oct 05 2021 at 16:00):

I'll check those presentations, thank you!


Last updated: Dec 23 2024 at 12:05 UTC