Is there anything special about the world name "root" for the entry point to a component? I'm looking at the C-A docs and there doesn't seem to be anything about that specifically?
I'm guessing it's mainly just a convention?
I'm asking because I'm wondering whether when visualizing component structures, we should consider "root" as an inherent part of the component itself, or perhaps as its own world. I'm assuming the latter?
But if that's the case, then I'm confused how anonymous component declarations (e.g. https://github.com/WebAssembly/component-model/issues/598) would interact with it. We'd have this anonymous component {} instance - but that is then wrapped by a named world "root"?
I guess I'm also extra confused because in wac compositions don't ever reference the world "root", even though that is what we call our entry point. For example:
// no reference to "root" here
let my-instance = new example:my-component { ... };
Oh I just found: "Specifying a root package" - though this doesn't talk about the world "root".
TLDR on what my question here is: Is the world "root" an implementation detail of components that we can inline, or is it a genuine addressable world which we should preserve in docs?
it is probably time to make a clear statement on "root"
Maybe answering my own question here: say I define the following WIT:
package yoshuawuyts:wordmark;
world wordmark {
/// Convert a markdown document to a Word (.docx) document.
export to-word: func(markdown: string) -> result<list<u8>, string>;
}
If I compile this then the resulting WIT on the component looks like this:
package root:component;
world root {
export to-word: func(markdown: string) -> result<list<u8>, string>;
}
All references to yoshuawuyts:wordmark are gone, and all we have left is the world root. This to me seems to point at the name "root" being an implementation detail, and not actually worth naming in any visualizations.
for me, it's "magical appearance" would make any engineer ask questions to which there must be answers published so it can be counted on, one way or the other. Everything that "dangles" will attract attention and that distracts from usage. :-)
hah yeah
Nothing special about "root", just a name that had to be invented since something needed to be put there
It's just a wit-bindgen/wit-component thing, right? I.e. not part of the component model or any official specification?
Correct
kinda like all the naming wit-component requires when creating a component, it's all invented and made-up and none of it's official
For those following along at home, this is a step towards making something official.
Talked this over sync with Alex today; inlining the world as part of the component is indeed the right way to go about it.
Yosh Wuyts said:
But if that's the case, then I'm confused how anonymous
componentdeclarations (e.g. https://github.com/WebAssembly/component-model/issues/598) would interact with it. We'd have this anonymouscomponent {}instance - but that is then wrapped by a named world "root"?
Also it turns out this ^ will be really helpful if we can land it
![]()
just for context: this is how I have it rendering now ^^
Last updated: May 03 2026 at 22:13 UTC