Stream: wit-bindgen

Topic: Component model tutorials / documentaion


view this post on Zulip Karel Hrkal (kajacx) (Jul 13 2023 at 11:05):

Are there any tutorials / documentation on how to use wasmtime's component model? For example, wasmtime's documentation doesn't mention anything about the component model.

There is this example repo that has a full example of using the components model (and is a godsend), but other that that, I didn't really find anything useful.

I had to write my own tutorial with detailed steps on how to actually use the component model.

For example, I cannot find any such tutorial on how to use wasi with the component model.

This repository demonstrate how to use component model with wasmtime. - GitHub - MediosZ/component-model-demo: This repository demonstrate how to use component model with wasmtime.

view this post on Zulip Mossaka (Joe) (Jul 13 2023 at 17:33):

I am not aware of a comprehensive documentation on the usage of component model, but I believe @Ryan Levick (rylev) 's component book is a good source of knowledge to throw in to this chat. https://github.com/rylev/component-book

A high-level explanation of the low-level details of WebAssembly components - GitHub - rylev/component-book: A high-level explanation of the low-level details of WebAssembly components

view this post on Zulip Mossaka (Joe) (Jul 13 2023 at 17:34):

It hasn't been updated for quiet some time, but I think it's really valuable and I personally, if time permitted, want to contribute to it.

view this post on Zulip Karel Hrkal (kajacx) (Jul 13 2023 at 19:47):

Mossaka (Joe) said:

It hasn't been updated for quiet some time, but I think it's really valuable and I personally, if time permitted, want to contribute to it.

Thanks, that's definitely better than nothing, but not really what I am looking for. What I want is to write my plugin in Rust with idiomatic bindings created from the wit file, and then compile it to a wasm component, and then load that component in Rust using wasmtime with idiomatic bindings generated.

This repo has an example of a wit wasi plugin in rust, and a runtime in JS, so that is definitely a good resource, but I'm still missing a rust wasmtime component model example with wasi support.

Rollup Plugin the bundles your wasm component JS glue for you - GitHub - DougAnderson444/rollup-plugin-wit-component: Rollup Plugin the bundles your wasm component JS glue for you

view this post on Zulip Robin Brown (Jul 13 2023 at 19:50):

People have written tutorials on this subject including @Radu Matei on his blog but these things have historically become outdated fairly quickly. As we build up to Preview 2 I expect a lot of people will be making content in this space.

view this post on Zulip Till Schneidereit (Jul 13 2023 at 19:51):

@Karel Hrkal (kajacx) we're just getting started on a much more comprehensive set of docs/tutorials/etc on Components. @Ivan Towlson and @Kate G have put together an initial outline of that here

Getting the ball rolling! Thanks to @kate-goldenring for all the work on this!

view this post on Zulip Karel Hrkal (kajacx) (Jul 13 2023 at 19:52):

Kyle Brown said:

People have written tutorials on this subject including Radu Matei on his blog but these things have historically become outdated fairly quickly. As we build up to Preview 2 I expect a lot of people will be making content in this space.

Hm, it's still using the wit_bindgen_rust::import!("../cache.wit"); macro, that must be older than wit worlds, no? Anyway, it's probably unusable today from what I can tell.

view this post on Zulip Robin Brown (Jul 13 2023 at 19:53):

yup! as I say, it's an example of a no-longer-current tutorial in this space.

view this post on Zulip Robin Brown (Jul 13 2023 at 19:54):

like Till and I were saying, this work is beginning again and people are trying to create new comprehensive up-to-date content for this but it's not there yet.

view this post on Zulip Robin Brown (Jul 13 2023 at 19:54):

there's only so many of us after all

view this post on Zulip Karel Hrkal (kajacx) (Jul 13 2023 at 19:55):

Kyle Brown said:

yup! as I say, it's an example of a no-longer-current tutorial in this space.

Tell me about it. this repo of mine with example of how to use wit bindgen (but without wasi) is already outdated too since the release of jco 0.9.4.

Various projects related to WASM, each in it's own branch, so that I don't have 50 repositories. - GitHub - kajacx/wasm-playground at wit-bindgen

view this post on Zulip Robin Brown (Jul 13 2023 at 19:59):

we bleed a little bit here on the cutting edge :tear:

view this post on Zulip Karel Hrkal (kajacx) (Jul 17 2023 at 10:37):

Ok, I have found (and even made) some example projects, so here is the list that I currently have for using the component model:

Various projects related to WASM, each in it's own branch, so that I don't have 50 repositories. - GitHub - kajacx/wasm-playground at wit-bindgen-examples
This repository demonstrate how to use component model with wasmtime. - GitHub - MediosZ/component-model-demo: This repository demonstrate how to use component model with wasmtime.
Contribute to DougAnderson444/wit-wasm development by creating an account on GitHub.
Rollup Plugin the bundles your wasm component JS glue for you - GitHub - DougAnderson444/rollup-plugin-wit-component: Rollup Plugin the bundles your wasm component JS glue for you

view this post on Zulip Mossaka (Joe) (Jul 17 2023 at 20:12):

These links are helpful! Thank you for sharing


Last updated: Nov 22 2024 at 17:03 UTC