A7compiler docsv0.16

AOT / ZIG 0.16 / SINGLE-FILE OUTPUT

.a7 parse check zig binary

A7

AOT compiler: .a7 source to a native binary via Zig 0.16.

Python compiler, no runtime. One Zig file out. Source recursion rejected at compile time.

Examples
verified
Target
Zig 0.16
Output
1 file
Recursion
banned
A7 compiler system map
FIG.01 · COMPILER PIPELINE
NO SOURCE RECURSION MULTI-FILE INPUT SINGLE ZIG OUTPUT RAW MARKDOWN FOR AGENTS

§02 · Documentation

Read in
order.

Nine pages grouped by task: install first, then language and compiler reference, then project status and agent fetch paths.

g s Start g l Language

Open Start ↗

§03 · Language

Syntax from
working examples.

Top-level bindings with ::, typed functions, structs, and iterative loops. See examples/037_language_tour.a7 for a full walkthrough.

  • :: module and const binding
  • fn typed functions, explicit ret
  • for indexed and value iteration
  • ret explicit return
Language reference ↗
EXAMPLES / 004_func.a7
// Functions in A7

io :: import "std/io"

// Typed function with a single return value
add :: fn(x: i32, y: i32) i32 {
    ret x + y
}

// Iterative — A7 source recursion is banned
factorial :: fn(n: i32) i32 {
    result := 1
    for i := 2; i <= n; i += 1 {
        result *= i
    }
    ret result
}

main :: fn() {
    io.println("5 + 7 = {}", add(5, 7))
    io.println("6! = {}", factorial(6))
}

§04 · Toolchain

Compile and
verify.

Run the compiler through semantic checks, emit Zig, and build with the host toolchain. Full gates are on the Release page.

~/a7
$ uv run a7 examples/001_hello.a7 --mode compile
[compile] tokenize     ok
[compile] parse        ok
[compile] name-resolve ok
[compile] type-check   ok
[compile] safety       ok
[compile] emit zig     ok  -> examples/001_hello.zig
$ zig run examples/001_hello.zig
Hello, World!
chord: g