Development · Evolving reference
Control flow
Clear branches, loops, and value exits.
Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →
Conditions
if Score > 10 {
return 1;
} else {
return 0;
}Conditions use braces and do not require outer parentheses. The condition must be a bool.
Loops
for var Index: usize = 0; Index < Count; Index += 1 {
Update(Index);
}
while Running {
Tick();
}These fragments assume their input bindings and functions. Sn also provides iterator-style for Item in Items.
Ranges
Start..End excludes End. Start..=End includes End when reached exactly. Ranges evaluate their bounds once; integer range bounds must have compatible types.
Value-producing blocks
let Normalized: i32 = {
if Input < 0 {
break 0;
}
break Input * 2;
};This fragment assumes Input: i32. break Value; supplies a value to the nearest value-producing construct. return always returns from the surrounding function.
Documentation snapshot: October 24, 2026 About versions ↗