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.
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
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.
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.
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.
@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
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.
yup! as I say, it's an example of a no-longer-current tutorial in this space.
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.
there's only so many of us after all
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.
we bleed a little bit here on the cutting edge :tear:
Ok, I have found (and even made) some example projects, so here is the list that I currently have for using the component model:
wasi_snapshot_preview1.wasm
adapter, even though the plugin is build for wasm32-unknown-unkown
target, so I don't really understand what is going on there.These links are helpful! Thank you for sharing
Last updated: Nov 22 2024 at 17:03 UTC