sprig and prose docs classic docs
Syntax› Dimension

Dimension

Stable — Stable features are ones that have earned their place in the core prose language.

universe ClockworkVillage {
  describe { ... }
}

dimension place {
  describe {
    Places are where the life of the village happens.
  }
}

dimension thing {
  describe {
    Things are objects the villagers make, carry, and use.
  }
}

concept Villager {
  describe { ... }
}

place Well {
  describe { ... }

  thing WellRope {
    describe { ... }
  }
}

What it is

A kind. A dimension groups concepts that are the same sort of thing, so the world can say what something is and not only what it is called.

Nothing above moved. Well and WellRope are the same two things they were on the last page — they have simply been sorted. Well is a place, WellRope is a thing, and Villager is still a plain concept because no kind has been named for people yet.

Dimensions are lowercase. Concepts are capitalized. That difference is the whole convention: a lowercase word is a kind, a capitalized word is a named individual.

Where it can live

Anywhere a concept can. Once declared, the dimension's word replaces concept in front of a name.

The dimension has to be in reach when it is used — declared in the same scope, or in one that encloses it.

How names find it

The word in front of a name says which dimension the name belongs to, and that is the only thing that says it.

WellRope sits inside Well, which is a place. It is still a thing. Nesting arranges the world; the dimension word classifies it, and the two are independent. Where a concept sits never changes what kind it is.

A dimension name cannot be declared again further down its own scope chain. An inner place would quietly change what the outer place meant for everything below it, so the language refuses instead of guessing.

How it breaks

  • SP010 DimensionNotFoundError — The word in front of a concept has to be a dimension that is already in reach.
  • SP011 DimensionAlreadyExistsError — That dimension name is already taken in this scope.
  • SP021 DimensionAlreadyDeclaredInChainError — A dimension cannot be redeclared down its own scope chain.
  • SP024 AmbiguousEndpointError — The same word is a concept and a dimension in one place.

Decided in

  • ADR003 EndpointDimensionPairs — Endpoint dimension relationship pairs. Accepted.
  • ADR004 NestedDimensions — Nested dimensions. Deferred.
  • ADR006 DimensionsInRelationships — Dimension relationship endpoints. Accepted.
  • ADR007 RelatesEndpointDimensionPairs — Relates endpoint dimension pairs. Accepted.
  • ADR008 RelationshipChainUniqueness — Relationship chain uniqueness. Accepted.
  • ADR011 ExpectsBlock — Expects block. Proposed.
  • ADR012 FileScopeUniverse — File-scope universe. Accepted.
  • ADR018 TemporalDimensions — Temporal dimensions. Proposed.
  • ADR019 DeclaredDimensions — Declared dimensions. Accepted.