← All examples

No std listed

No operators and no printing.

ground_only/strike.zg
# No std listed: no operators and no printing (owner, 2026-10-06). Functions, `let`, `if`,
# structs, `match`, and.then / or.else (Ground's, since they skip their right side) still work.

struct Point {
    x: int32,
    y: int32
}

enum Light {
    lit,
    dark
}

fn ready [] -> bool {
    return true;
}

fn origin [] -> Point {
    return Point[x = 0, y = 0];
}

MAIN {
    let 'p' := origin[];
    let 'l' := Light.lit;
    if ready[] and.then false {
        let 'unused': int32 = 1;
    }
    match 'l' {
        lit { }
        dark { }
    }
}

# a fixed array and a text literal are Ground's too (owner, 2026-10-06)
fn greeting [] -> str.utf8 {
    return "hi";
}

fn three [] -> array[int32] {
    return [1, 2, 3,];
}

# std's `exit` is out of reach without std, so this strike's own `exit` is the only one (2026-10-06)
fn exit [] { }

fn stop [] {
    exit[];
}
Output
Prints nothing.