The Language

How Naze is structured: three layers, a tiered grammar, and code that reads like a document.

The Three-Layer Architecture

One source file compiles into three distinct layers. Humans need all three. AI agents typically need only Layer 1.

L3

Presentation

UI tree, themes, animations, layout, colors, typography

L2

Interaction

Event handlers, navigation, actions, validation

L1

Data

State, computed values, server functions, data bindings

Three Outputs From One Source

app_data.bin
Layers 1 + 2 + 3 · ~7KB
Browsers / Humans
naze-manifest.json
Layers 1 + 2 · ~1KB
AI Agents
Headless binary
Layers 1 only · ~500B
Agent-to-Agent

The HTML/CSS/JS stack forces AI models to navigate three separate languages, a virtual DOM, bundler configurations, and framework-specific abstractions. Naze eliminates this waste — the compiled binary is the API.

Tiered Grammar

The grammar is partitioned into independent tiers. Lower tiers never depend on higher ones. An agent building dashboards needs only Tier 0.

T0
Core UI

Layout, elements, state, events, themes, components

T1
Data

Fetch, streams, server functions, storage, timers

T2
Database

Models, declarative queries

T3
AI

Prompt blocks, provider configuration

T4
Systems

Concurrency, file IO, networking (future)

The command nazec grammar --format gbnf exports the grammar for constrained decoding, enabling local 3-7B models to match cloud-scale quality at zero cost.

“Simplicity is the ultimate sophistication.”

— Leonardo da Vinci

See It in Action

Components compose with use, themes resolve with dot notation — and the compiler inlines it all. σ stays at 1.

app "Counter" {
    state count = 0
    let title = "My Counter"

    column padding: 20px, gap: 16px {
        heading "{title}"
        text "Current count: {count}"

        rect width: 200px, height: 50px,
             color: #2563eb, radius: 8px {
            text "Increment"
            on click: set count = count + 1
        }

        rect width: 200px, height: 50px,
             color: #dc2626, radius: 8px {
            text "Reset"
            on click: set count = 0
        }
    }
}

Why curly braces? Modern LLMs handle indentation well in fresh code, but still miscount whitespace when editing existing files — exactly the agentic workflow Naze targets. In Python, one wrong indent is a syntax error; with braces, it's cosmetic. Braces make Naze fault-tolerant by design. Research source ↗

No build step requiredCompiles in millisecondsWASM output