Concepts

Compile Path

How Zerolang's graph-native compile path compares with traditional parse-first compilers.

From Graph To Code

Zerolang is easiest to understand against parse-first compilers. Most languages have a parse-first compile path: the normal compiler input is text, so every compile starts by parsing text into compiler data structures. Zerolang's package path is graph-first. It is the same kind of pipeline with fewer stages, and the input is the graph store instead of text:

Parse-first compile path vs Zero graph-first path
source files
lexer / parser
AST
name resolution
type checking
IR lowering
optimization
codegen
artifact
zero.graph
repository graph tables
semantic validation
type checking
MIR and backend facts
direct codegen
artifact

Rust, Go, Zig, C, and many other languages differ in details, but the normal compiler input is text. The .0 projection can be exported and imported, but it is not the normal package compile input. The compiler loads the graph store directly.

why is this less work for the agent?
The agent can ask the compiler for graph facts, submit one checked semantic patch, and avoid a separate write-format-parse cycle. The compiler still checks and builds, but the edit itself is closer to the final compiler model.

Why The Path Matters

For agents, the compile path is also the authoring path. If text is primary, the agent writes text and waits for the compiler to tell it whether the text meant what it intended.

If the graph is primary, the agent can ask the compiler for node handles, symbol facts, calls, references, diagnostics, and patch operations before it edits. The edit is already expressed in compiler terms.

That is why Zero keeps investing in binary graph storage and direct graph loading. The long-term goal is to memory-map final compiler IR and codegen from semantic data with as little redundant parsing and reconstruction as possible.

Performance And Size Angle

The graph model is not only about agent ergonomics. It also supports Zero's systems goals:

  • fewer reparsed text inputs on normal package commands
  • deterministic graph identity and stable diff/review output
  • pay-as-used standard library helpers
  • explicit capability and allocation facts
  • small direct artifacts when the selected profile and target support them

Use zero size --json, zero mem --json, and the benchmark docs to inspect those facts for a graph input instead of treating performance claims as prose.

Current Boundary

Zero is still experimental. Some commands and targets expose readiness facts or structured diagnostics when a backend cannot build a graph shape yet. That is intentional: the docs should show what works today and what the compiler can explain, not imply production completeness.