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.
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
I think I follow.
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.
Last updated: Nov 22 2024 at 17:03 UTC