All languages

Zed languageexperimental

Category-theory language where a program is a graph of values: the compiler derives parallel scheduling, last-use memory freeing, and safety from that graph, with units, refinements, and machine-checked laws in the type system.

Overview

Zed is an experimental programming language in which a program is a graph of values and the dependencies between them, so the compiler derives parallel scheduling, memory management, and safety from that graph. Its design is rooted in category theory: morphisms are ordinary values, and units, refinements, and machine-checked laws live in the type system.

Code

x = 42;                        // int, inferred domain int[42..=42]
port: int[1..=65535] = 8080;   // a refinement: the domain carries intent
name = "Zed";
color = #green;                // an atom: a value that is its own type
pair = (1, "one");             // a tuple
a, b = pair;                   // destructuring; arity must match
first = pair[0];               // a tuple is indexed like any morphism
One tab per slot. Values carry refinements and units; collections are morphisms the compiler can remap, join, or fold; a struct and a function are the definable unit. The last tab is the flagship: a join plans like a loop, a fold with a named reducer runs in parallel and gives bit-identical results, a law is discharged by the checker, and a key remapping is a category-theoretic rekey. Not shown, but in the design: partial evaluation specializes a generic decoder at build time, a grammar clause gives a type its parser and printer, taint tracking makes an unsanitised query a compile error, and an edit recomputes only the values that depend on it.

Distinctive traits

  • A program is a graph of values and their dependencies, so the compiler schedules, frees, and proves safety by reading that graph.
  • Collections are morphisms: xs as (i -> x) into (k -> x) remaps keys; a loop, a join, and a query share one form.
  • Parallel by default, bit-identical on any core count; an edit recomputes only the values that depend on it.
  • No garbage collector: memory is freed at each value's last use, computed statically, so there are no collection pauses.
  • Units live in the type system: metres per second times seconds is metres, and adding seconds is a compile error.
  • A failure is an ordinary value: #notFound rides in the type, and the checker makes every caller handle it.

Status

Under construction: the README says "coming soon" and no releases are published. The Rust-hosted compiler zedc implements the lower layers (lexer, parser, checker, native code generation via Cranelift); the higher ones are still to come. MIT licensed.

History

Luke Hutchison announced Zed on 2 November 2026, describing twenty years of design notes compiled with several AI models into one plan, then built by coding agents against a dependency graph of tasks. The repository was created on 25 October 2026; the language has no public release yet.

Sources & references