The Tempus Script Language Specification

A reference for the scripting language embedded in Tempus. It defines the language's syntax and behavior: how source is written and parsed, the type and value model, declarations and scope, expressions and control flow, the catalog of built-in operations, and how scripts are initialized and run in response to game events.

Chapters

  1. Notation — grammar conventions, terminology, how to read examples.
  2. Source code representation — characters, lines, comments, the embedded world-file forms.
  3. Lexical elements — tokens, integer/boolean literals, barewords, separators, the two string forms, sigils.
  4. Constants — literals, compile-time typing, named values (const).
  5. Variables — the variable namespace, let/set, persistent state (store/recall).
  6. Types — the closed type set: scalars, entity references, iterables, blocks, lists.
  7. Properties of types and values — equality, boolean contexts, string conversion, binding and sharing.
  8. Blocks — block bodies, parameter forms, arity, block value and return.
  9. Declarations and scope — the two namespaces, def/const, lexical scope and lookup.
  10. Expressions — argument forms, command calls, substitution, operators, control flow.
  11. Built-in functions — the catalog of built-in functions.
  12. Program initialization and execution — top-level forms, hoisting, handlers, phases, filters.
  13. Error conditions — compile-time versus run-time errors.
  14. Run-time — control-flow propagation, suspension, execution limits, and determinism.

Orientation

A complete script is a sequence of top-level forms — def, const, and event handlers (Declarations and scope, Program initialization and execution). Most examples throughout are fragments: read a bare statement as if it sat inside an enclosing block body.

# a representative handler
after command (say sayto) {
  require [keyword $args chat gossip]
  store $self 'state' 'gossip'
  do ">$actor Let's talk."
}

Examples are drawn from or modelled on working scripts.