Examples

Small syntax samples and larger dogfood projects that compile through the real toolchain.

Generics and fixed shapes

def apply_conv2d[H, W, K](
    image: &array[f32][H, W],
    kernel: &array[f32][K, K],
) -> array[f32][H - K + 1, W - K + 1]:
    out: array[f32][H - K + 1, W - K + 1]
    # ordinary typed loops fill out
    return out

Payload enums and match

enum Message:
    Move(i32, i32)
    Write(str)
    Quit

def handle(message: &const[Message]):
    match message:
        Message.Move(x, y): print(x, y)
        Message.Write(text): print(text)
        Message.Quit: print("done")

Real projects