Skip to content
zedlanguagePublic

About

A reactive dataflow programming language for the AI era, with automatic parallelization and very high standards of static verification

Resources

Stars

262 stars

Watchers

7 watching

Forks

Repository files navigation

Zed programming language

Zed Compiler & Runtime (zed-impl)

Zed is a dataflow programming language built from a single core premise: removing the ability to read the "current" value of a mutable place turns every program's source text into an explicit, acyclic value-dependency DAG. From that single premise follow automatic multicore/GPU parallelization, zero data races, exact pause-free reference counting with in-place reuse, bit-identical deterministic parallel reductions, set-theoretic failure-as-data typing, partial-evaluation staging, and reactive incrementality over a 7-generator core (fam, reindex, discard, fold, fix, gen, port).

Current Implementation Status (R0–R2 Active): Organized across 22 focused crates in a strictly acyclic 5-layer DAG (zedc check, run, build, test, fmt, replay, pin, info), backed by a 4-way differential oracle (zed-kernel == pre-PE JIT == post-PE JIT == standalone stripped AOT ELF) and O(n log n) scaling verification. Live milestone progress is tracked in docs/plan_dag.md (viewable interactively via make-no-mistakes). The complete, self-contained language specification and compiler architecture lives in design/README.md.


Workspace Architecture (5-Layer Strictly Acyclic DAG)

Every crate dependency flows strictly downward, verified mechanically by cargo run -p xtask -- check-dag:

Layer Crates Role
Layer 0 zed-span, zed-intern, zed-hash, zed-num, zed-diag, zed-ds Zero/minimal-dep foundation: Copy spans & SymId interner, framed BLAKE3 content addressing, exact Int/Rat/CanonF64, structured diagnostics, shared arenas & graph algorithms.
Layer 1 zed-syntax, zed-kernel, zed-domains, zed-zir Lexer & arena AST; small trusted 7-generator kernel evaluator; exact unbounded integer intervals, congruences & reduced products; canonical RVSDG ZIR, dominator contification & RC memory planner.
Layer 2 zed-types, zed-resolve, zed-check Hash-consed set-theoretic type arena; lexical & acyclic multi-unit resolution with capability grants & @hash pinning; local bidirectional checker & AST-to-ZIR elaborator.
Layer 3 zed-stage, zed-opt, zed-verify Interleaved partial evaluation (mix); certificate-emitting optimizer; independent zero-shared-code verifier.
Layer 4 zed-rt, zed-codegen, zed-driver, zedc Standalone minimal RC runtime (zero compiler dependencies); SSA Cranelift JIT/AOT + LLD backend; incremental compiler driver & prelude linker; thin zedc CLI.
Tooling zed-benchkit, xtask Strict O(n log n) 1x-vs-8x scaling harness (<= 9.0x goal / < 10.5x hard ceiling); typed Rust workspace verification CLI.

Repository layout outside crates/:

  • design/ — complete 7-part language specification and compiler architecture
  • docs/ — live milestone DAG (docs/plan_dag.md) and project artwork
  • zed/grammar/ — PEG lexical, surface syntax, and notation grammars
  • zed/prelude/ — standard Zed prelude library (core.zed, math.zed), embedded at compile time
  • zed/corpus/ — 31 end-to-end reference Zed programs, input/output fixtures, and standalone Rust reference oracle (zed/corpus/ref/)

Quick Start

# Run full verification checks (DAG check, fmt, clippy -D warnings, tests, rustdoc)
cargo run -p xtask -- check

# Verify crate DAG layers and docs/plan_dag.md integrity alone
cargo run -p xtask -- check-dag

# Run scaling benchmarks under optimized bench-test profile
cargo test --workspace --profile bench-test -- --test-threads=1

# Run the zedc CLI
cargo run -p zedc -- info

# Launch the live plan DAG viewer on http://127.0.0.1:4317 (from a make-no-mistakes checkout)
node ../make-no-mistakes/src/server.ts --repo . --plan docs/plan_dag.md --port 4317

Engineering Standards

All code follows RUST_STANDARDS.md:

  • Zero borrow-checker .clone() / Rc / RefCell / unsafe dodges; flat owning arenas with Copy u32 IDs.
  • Pure value-to-value data-flow passes ready for future self-hosting.
  • Strict workspace Clippy & rustc lints (unsafe_code = "forbid" by default, unwrap_used = "deny", allow_attributes = "deny", zero ignore-interior-mutability exemptions).
  • Fast incremental builds via opt-level = 0 in dev, LLD linking, and zero dylib workarounds.

License

Licensed under the MIT License.

About

A reactive dataflow programming language for the AI era, with automatic parallelization and very high standards of static verification

Resources

Stars

262 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

Languages