Stream: general

Topic: Basic example of a plugin and host world


view this post on Zulip Damian Reeves (Apr 04 2024 at 18:21):

I want to try and build up an extensible CLI host using WIT and the Component Model and I'm wondering if there are any good examples in the wild I can look at for getting started with understanding how to define the WIT for an extension model. I'll have different kinds of extensions (this is for AST manipulation) so frontend-language-extension , code-generation-extension, 'rewriter-extension` ... I'm a little lost around the setup for this in WIT when you will have multiple components meeting the interface like a plugin/extension model.

view this post on Zulip Alex Crichton (Apr 04 2024 at 19:24):

This might be a case where you'd have a different world per-plugin-"shape" (e.g. one for frontend, one for code), and then the host would have buckets of loaded-extensions-per-type perhaps using bindgen-generated interfaces to work with loaded components

view this post on Zulip Damian Reeves (Apr 04 2024 at 19:26):

I think I follow.

view this post on Zulip Karel Hrkal (kajacx) (Apr 13 2024 at 06:39):

For wit examples, I have https://github.com/MediosZ/component-model-demo/tree/main and also https://github.com/DougAnderson444/wit-wasm in my bookmarks for reference. I also have this playground project: https://github.com/kajacx/wasm-playground/tree/wit-bindgen

I don't think you will see multiple worlds in these examples, but it's something that can help you get started with wit components.

This repository demonstrate how to use component model with wasmtime. - MediosZ/component-model-demo
Wasm Interface Types Demo. Contribute to DougAnderson444/wit-wasm development by creating an account on GitHub.
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

Last updated: Nov 22 2024 at 17:03 UTC