A world is written in two kinds of name. The world's own names are the paths of its parts and the designs, fields and functions it declares. The browser's vocabulary is every other name a world uses: a point light, the sculpt package's lathe, a walking gait, a particle effect, the dusk message, the transition animator. Behind each vocabulary name is code shipped with the browser, written in Cone, and trusted because the browser's makers chose it.
This page says how a world uses the vocabulary, why a world never names a package, how the vocabulary is versioned, and how approved extensions could add to it.
The browser's one vocabulary
What it is. The vocabulary is the set of named types, tools, messages and actions the browser exposes to worlds. Packages register them: a point light, a glass material, subdivide, a hairstyle, a flock. A world composes them into designs of its own, such as a lantern.
How you write it. A vocabulary name is written where it is used, with no import line; the browser finds the names where they are used. A name is qualified when it would be ambiguous:
part post: lathe(profile: ..., steps: 14), material: materials.lanternBlack area(self, sphere(radius: 4 m, at: (0, 0.2, 0))) on(dusk, start(transition(lampLevel, to: 1, over: world(15 min), begin: dusk.due)))
lathe, area, sphere, dusk, start and transition are the vocabulary's; post, lampLevel and materials.lanternBlack are the world's. Shape tools are written bare, without their package's name: lathe, not sculpt.lathe (Appendix: shape tools).
What it means.
- New capability arrives as new names, never as new syntax, as HTML can use a new tag that CSS still styles. The format is fully specified and open-ended.
- The type makes the mapping safe: the name says which engine, and the type guarantees the data fits it.
- A world composes tools; it never builds them. Capability lives in the tools. When an author needs more, the package's owners extend the tool, and every world gains it. A world's own logic is for what is truly its own, such as the riddle's rule; heavy computation (meshes, physics) belongs in packages.
- Built-in rules come with the browser, always on for every world: the clock's mechanics, possession and the camera, carrying on moving platforms, crossing gates in step with prediction, replicating shared state. A world sets their numbers (day length, spawn points, landing thresholds), not what they do.
No import line: a world never names a package
The rule. A world names tools the browser exposes; it never names a package to load.
Why. A world that could name any package could name a network library. Because no name in the vocabulary offers the network, files or memory, a world cannot reach them, and a visitor can portal into a stranger's world safely (Portals: crossing into another world). Content says how the world looks and behaves; it never holds a reference into an engine's memory.
A package's name as a qualifier. Most vocabulary names are written bare, as the shape tools are (lathe, box). Some carry the name of the package that provides them, npcbehave.patrol(...), noiserock.rockMesh(...), to tell them apart. That is a qualifier on a name the browser already exposes, not a request to load a package. Whether the vocabulary's namespaces are the packages' names or names of their own is part of the open namespacing question (below).
One vocabulary version, and a minimum browser level
The rule. The vocabulary has a single version for the whole browser. A world states the minimum browser level it needs, so that an older browser can say so instead of showing half a world.
needs(browser: 1.4) // illustration: the spelling is not chosen
Why. Reconciling separate versions of many tool sets is not worth its complexity. One number answers "can this browser show this world?", and every tool a world uses was tested with every other at that level.
Approved extensions
What it is. A world may need a capability the vocabulary lacks. An approved extension would add it:
- written in Cone, like the browser's own packages;
- compiled from reviewed source by our build service, so what runs is what was reviewed, not a binary someone uploaded;
- signed, so a browser can tell an approved build from anything else;
- limited by declared permissions, so an extension that draws hair cannot open a network connection unless it declared that it would and was approved to;
- revocable, so an extension found to be harmful can be withdrawn from every browser.
How it changes the rule above. The reason a world never names a package was that a world could then name a network library. Declared permissions answer that reason, as browser-extension stores do, so the hypothesis narrows to "a world names only approved packages". The ban on arbitrary code stays; what changes is that the vocabulary can grow between browser releases, from outside the browser's makers.
What it means for a world. A world using an extension says so, since the extension is not in every browser; the browser fetches it (a signed build) and grants it only its declared permissions. How the world names it, and how its version is stated, are open.
World-defined functions handed to tools
A world may hand a tool a calculation of its own, an open function: the fresco's texels, the coast, the conifers' sizes (Open functions). It is math only, with no input or output, checked and bounded like any block, so it needs no permission. Whether such functions may also be steps of a pipeline, interoperating with the vocabulary's tools, is open.
How it connects
- Construction from the vocabulary's tools: Construction, Sculpting.
- Behaviors a package provides whole (walking, minds, faces): Package behaviors.
- Animators from the vocabulary: Animators.
- Content arriving into a running world: Loading.
- Trust between machines: Distribution.
Open questions
- Versions with extensions. Extensions join the vocabulary at browser releases; or a world names an extension and a minimum version of it.
- An unknown name. What a browser does with a vocabulary name it does not know. The minimum browser level answers it for the core vocabulary; not yet for extensions.
- Namespacing. Whether the qualifiers other names carry are package names (
npcbehave.patrol) or names of the vocabulary's own. Shape tools are written bare (lathe); a world's own name hides a tool of the same spelling, and the tool is reached through its package (sculpt.face). - Which permissions an extension may declare, who approves them, and what a world that uses a revoked extension shows.
- World-defined pipeline steps in the content language, math only.
- The ceiling on world logic: how far a world's own designs may go before a capability belongs in a package.