Skip to main content

Types

Primitive types​

TypeValue
booltrue, false
int32-bit signed integer
float64-bit floating point; always finite
stringan immutable Unicode string
timea minute of the day, 00:00–23:59
durationa signed span of whole minutes
colorfour channels (.r .g .b .a) on a 0–1 scale
  • There is no none or null. Object references come in the next version.
  • Colour channels are not clamped while computing; they are clamped where they reach the screen.

Conversions​

The only implicit conversion is int → float. The others are written with as:

WrittenResult
f as inttruncates toward zero (2.7 → 2, -2.7 → -2)
x as stringworks from every primitive type
t as int, n as timethe minute of the day; outside 0–1439 is an error
d as int, n as durationminutes

There is no conversion from a string to a number. A failing conversion is a runtime error.

What as string writes: int in decimal, float in its shortest round-trip form, bool as true/false, time as HH:MM, duration as 1h30m, color as #rrggbbaa.

Equality and comparison​

  • Equality is exact: float without tolerance, strings code point by code point, colours channel by channel.
  • <, <=, >, >= are defined on numbers, time, duration and strings.
  • Comparisons do not chain: a < b < c is an error.

Arithmetic​

  • + - * / work on numbers; % on int only.
  • Mixing int and float gives a float.
  • time ± duration → time, wrapping within the day: 23:30 + 1h == 00:30.
  • duration ± duration and duration * int are defined.
  • + joins strings; a string does not join another type: use {…} or as string.
  • int overflow, division by zero, and a float operation that gives infinity or NaN are errors (Determinism).