Besides interfaces, a world can contain inline functions. What's the use case for this?
The docs[^1][^2] specifically mention that such a component can't be composed with other components, only if the world contains only interfaces.
[^1]: "to use your component from another component, it must export an interface." source
[^2]: "The component's world (.wit file) must export an interface. (Do not export functions directly, only interfaces.)" source
my observation as a user was that "export and import functions" was the default about a year or so ago when I started toying with wit, but the closer we got to preview2, the more problems arose with directly exported functions and it feels like they should be deprecated soon. I don't know if that's correct, as I said that's what I experienced from the outside
The use case depends on the world in question, mostly the perspective from an embedding. For example it might be a good model for what the host wants to give a component or what the host would require from a component.
The limitations in the documentation refer to conventions around the wasm-tools compose
subcommand. That's not a limitation of components or component runtimes in general, so it might be something worth clarifying in the documentation but I wouldn't say for sure without reading more closely
Last updated: Nov 22 2024 at 16:03 UTC