Skip to content

Internal documentation — Work in progress

This page has not been confirmed as accurate or approved for publication. Current documentation version: 0.1.0-internal.1.

Functions

Settled design: functions use fun, may have typed parameters and return types, and may be overloaded by parameter types.

fun distance(a: Vector, b: Vector): Float {
  return (a - b).magnitude()
}

Expression bodies and lambdas use =>:

let greater = fun(a: Float, b: Float) => a > b

A mutating counterpart may conventionally end in !, and the tokenizer emits a distinct method-identifier token:

vector.normalize!()

Implementation status

Named, block-bodied functions with optional parameter and return type annotations now parse into the AST. Calls and bare or value-bearing return statements also parse. Expression-bodied functions, lambdas, name resolution, typing, overloads, and execution remain future work.

Provisional design: multiple returns, destructuring, variadic parameters, yielding, overload selection, capture behavior, and inference rules.