sprig and prose docs classic docs
Syntax› Concept

Concept

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

universe ClockworkVillage {
  describe {
    A quiet village simulation where the focus is observation,
    relationships, and small moments.
  }
}

concept Villager {
  describe {
    Villagers are people who live in the village.
  }
}

concept Well {
  describe {
    The well is where the villagers gather water.
  }

  concept WellRope {
    describe {
      Twisted twine that lifts water out of the well.
    }
  }
}

What it is

The nouns of a universe. A concept names something that exists in the world — the things you would point at if you were standing in it. In a village, that is a Villager, a Well, the rope that hangs in it.

Concept names are capitalized, which is how prose marks a named individual. That convention holds everywhere in the language.

The village now has three things in it. Notice that they are written beside the universe block rather than inside it — they belong to ClockworkVillage anyway.

Where it can live

Anywhere. At file scope beside the universe, or nested inside another concept.

Nesting is the only hierarchy prose has. Where a declaration sits is where it lives, so WellRope is ClockworkVillage.Well.WellRope.

Use concept for anything you have not sorted into a kind yet. Everything above is a concept right now for exactly that reason — a villager, a place, and a piece of equipment are plainly not the same sort of thing, and the language has not been given a way to say so yet.

How names find it

A bare name reaches a sibling, declared in the same scope as whatever uses it: from Well, the name Villager is enough, because both sit beside the universe. It also reaches an enclosing concept by that concept's own name. Anything else takes a path. WellRope sits inside Well rather than beside it, so even from Well it is written Well.WellRope. Nothing looks outward on its own: from inside WellRope, a bare Villager is not found, and that is an error rather than a guess.

A name does not have to move for its meaning to hold. Where an idea sits is a fact about arrangement, not about what it is.

How it breaks

  • SP008 ConceptAlreadyExistsError — That concept name is already taken in this scope.

Decided in

  • ADR002 NestedNameResolution — Nested name resolution. Accepted.
  • ADR012 FileScopeUniverse — File-scope universe. Accepted.
  • ADR019 DeclaredDimensions — Declared dimensions. Accepted.