Skip to content

Language Reference

Variables & Math

int count = 10;
double rate = 5.5;
boolean active = true;
string msg = `Items: ${count}`;

Structs & JSON

type User { string name; int age; }
User u = { name: "Alice", age: 30 };
json generic = u; // Implicit upcast
User specific = generic as User; // Explicit downcast (validates at runtime)

Functions & UFCS

int calculate(int a, int b = 0) { return a + b; }
// UFCS usage:
int result = 5.calculate(10);

Control Flow

if (count > 0) { ... } else { ... }
for (int i = 0; i < 10; i++) { ... }
int[] items = [1, 2, 3];
foreach (int x in items) { ... }

Streaming & Errors

yield "Progress...";
try {
throw "Oops";
} catch (err) {
yield err;
}

int, double, boolean, string, json, void, true, false, null, if, else, while, for, foreach, in, return, yield, break, continue, try, catch, throw, type, main, as, import

PrecedenceOperatorsAssociativity
1 (highest)!, -, ~ (unary), ++, --Right
2*, /, %Left
3+, -Left
4<<, >>, >>>Left
5<, <=, >, >=Left
6==, !=Left
7&Left
8^Left
9|Left
10&&Left
11 (lowest)||Left
From \ TointdoublestringjsonStruct
int-Implicit.toString()NONO
double.toInt()-.toString()NONO
string.toInt().toDouble()-NONO
StructNONONOImplicitExplicit as
jsonNONONO-Explicit as