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.

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:

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

Open questions

← Cameras and views | Contents | Distribution →