FREAKV3 docs freak 0.15.1 (Maverick)

FREAK V3#

The complete, verified reference for the language the shipping FREAK V3 compiler actually accepts.

FREAK is a programming language written entirely by AI. Its compiler is self-hosted: the compiler that builds FREAK programs is itself written in FREAK. This site documents V3 "Maverick" — the shipping, self-hosted generation that lives in src/compiler/v3/.

84/84
executable examples compile and passVerified with freak 0.15.1 (Maverick) on 2026-10-18T21:50:54Z. Every code block on this site marked compiles was built, executed, and checked against its reviewed expected output.

Why this site exists#

The project ships a specification, freak-full-bible.md, that describes the complete language: variants, doctrines, closures, generics, lifetimes, squadron concurrency, probability types, and more. That document is explicit that it describes the destination, not the present.

The V3 compiler implements a much smaller language than the bible. Not a slightly smaller one — a fundamentally smaller one. Roughly a fifth of the bible's surface compiles today.

Badged executable examples are real files under examples/, compiled by the released V3 compiler, executed, and checked against reviewed expected output. Inline illustrative fragments are labelled separately; they are not independently verified programs. Proposed or unsupported syntax must not borrow a working example's verification badge.

For the feature-by-feature comparison against the specification, see Bible vs V3. For what to write instead of the features that are missing, see Not in V3.

Hello, FREAK#

examples/hello.fk compilesruns
-- The smallest FREAK program.
-- `say` is always available; no import is needed.
task main() -> void {
    say "Hello from FREAK"
}
Program output
Hello from FREAK
shell
freak run hello.fk

The language in one screen#

This is close to the whole language. If a construct is not on this list, check Not in V3 before reaching for it.

Illustrative snippet; not independently verified. Use the badged executable examples for tested programs.

FREAK
-- comments start with a double dash

pilot x = 42                    -- binding, type inferred
pilot y: word = "text"          -- explicit type annotation
fixed pilot LIMIT: int = 100    -- immutable binding
pilot mut counter: int = 0      -- reassignable binding

task add(a: int, b: int) -> int {
    give back a + b             -- explicit return, always
}

shape Point { x: int  y: int }  -- record type

impl Point {
    task make(v: int) -> Point { give back Point { x: v, y: v } }
    task sum(self) -> int { give back self.x + self.y }
}

task main() -> void {
    pilot p: Point = Point::make(3)
    say "sum={p.sum()}"          -- (interpolates paths, not calls)

    if p.x > 2 { say "big" } else { say "small" }

    when p.x {
        3 -> say "three"
        _ -> say "other"
    }

    repeat 3 times { say "again" }
    repeat until counter == 3 { counter += 1 }
    training arc until counter > 99 max 10 sessions { counter += 1 }

    pilot names: List<word> = ["alpha", "bravo"]
    say names[0]
    say word_from_int(names.length())

    say "\x1b[1;32mok\x1b[0m"        -- ANSI colour, no library needed
}

What makes V3 unusual#

No visibility keywords. launch does not parse. A single file shares one global scope with the standard library. A project splits its code into the modules listed in hangar.toml and imports between them, and from other projects, with use. See Hangar & packages.

Keywords are reserved in every letter case. pilot, Pilot and PILOT are all reserved, though only the lowercase spelling works as the keyword. This makes a surprising number of natural names illegal — Pilot, Result, Max, Route and Check cannot name your shapes or bindings. See reserved words.

**Type annotations are one identifier, plus List<T>.** pilot x: int and pilot x: List<int> both work; List is the only generic form, and it does not nest.

Four scalars, shapes, and two builtin types. int, num, word, bool, void, the shape records you declare, plus List<T> and ByteBuffer. No maybe<T>, no result<T,E>, no Map<K,V>, no tuples. Alongside List<T> an older untyped array handle survives, addressed by an int.

No implicit returns. Every value-returning path needs give back.

Two backends#

V3 emits either LLVM IR or portable C.

BackendFlagStatus
LLVM IR--llvm (default)Full surface, including shapes, methods and std::ui
C--cScalars, control flow, words, arrays and native calls. Shape storage is not a claimed executable path

If your program uses shapes, use the default LLVM backend. Every example on this site was verified through it.

Where to go next#

Badged executable examples were compiled and run with the released freak 0.15.1 (Maverick). 84/84 examples match their reviewed expected output. Illustrative snippets are labelled separately. Regenerate with python tools/refresh.py.

V4 boxes were checked against the development snapshot 7c9a1f3c27 (2026-10-04); 46/46 V4 examples match their reviewed expectation. Regenerate with python tools/verify_v4.py --checkout <Freak-lang>.