Types
Every type in Balaur Script: numbers, booleans, strings, lists, maps, optionals, any, vectors, and how one becomes another.
Types overview
How Balaur Script is typed: every type at a glance, where annotations are required, and which types copy and which share.
Numbers
int and float in Balaur Script: literals, arithmetic, wrapping, division, mixing the two, and math functions that give the same bits everywhere.
Booleans
bool in Balaur Script: true and false, comparisons, the logical operators, and why a number is never a condition.
Strings
str in Balaur Script: interpolation, escapes, joining, byte offsets, and every string method with an example.
Lists
[T] in Balaur Script: literals, indexing, push, pop, insert, remove, extend and sort, walking a list, and how lists are shared.
Maps
{str: V} and {int: V} in Balaur Script: literals, reading a missing key, has, remove, keys and values, ordering and sharing.
Optionals and nil
T? and nil in Balaur Script: what nil is, where it may go, comparing with nil, or and unwrap, and how nil differs from an empty map.
The any type
any holds a value whose kind is read at run time: an HTTP reply, a save file or an event payload. Read it, write it and turn it into typed values.
Vectors and colours
Vec2, Vec3 and Color in Balaur Script: making them with vec2, vec3 and color, reading and writing fields, and how they behave as values.
Conversions
How one type becomes another in Balaur Script: as, an int meeting a float, text and numbers, and reading typed values out of an any.