Chris Tate afcc72da64
CI / Conformance Suite (push) Has been cancelled
CI / Native Preflight (push) Has been cancelled
CI / Native Runtime Cases (1/2) (push) Has been cancelled
CI / Native Runtime Cases (2/2) (push) Has been cancelled
CI / Native Metadata Reports (push) Has been cancelled
CI / Native Direct Backend Artifacts (push) Has been cancelled
CI / Native Sanitizer Smoke (push) Has been cancelled
CI / Command Contract Snapshots (push) Has been cancelled
CI / Graph Build Perf (push) Has been cancelled
CI / Deep Conformance Suite (push) Has been cancelled
CI / Deep Native Preflight (push) Has been cancelled
CI / Deep Native Runtime Cases (1/6) (push) Has been cancelled
CI / Deep Native Runtime Cases (2/6) (push) Has been cancelled
CI / Deep Native Runtime Cases (3/6) (push) Has been cancelled
CI / Deep Native Runtime Cases (4/6) (push) Has been cancelled
CI / Deep Native Runtime Cases (5/6) (push) Has been cancelled
CI / Deep Native Runtime Cases (6/6) (push) Has been cancelled
CI / Deep Graph Build Perf (push) Has been cancelled
CI / Workspace Checks (push) Has been cancelled
Speed up cached graph runs for real CLI startup (#427)
* Add process stdout capture

- Add std.proc.capture for host stdout capture into caller-owned buffers

- Wire process capture through direct MIR lowering, verification, and native emitters

- Cover capture behavior in native conformance and stdlib docs

* Add process file capture

- Add std.proc.captureFiles for stdout and stderr redirection to files.

- Wire captureFiles through runtime, MIR lowering, verification, and native emitters.

- Cover the API in docs, skills metadata, native conformance, and compiler metrics.

* Add terminal ANSI helpers

- Add std.term ANSI style, color, cursor, clear, and alternate-screen helpers.

- Lower terminal helpers to target-neutral static string views for source and graph inputs.

- Document and cover the terminal helper surface with a native conformance fixture.

* Add terminal key decoding

- Add std.term key constants plus byte decoding for arrows, control keys, and printable UTF-8.

- Lower key helpers through source and graph inputs using the existing target-neutral parse runtime.

- Document and cover terminal key decoding in the native terminal fixture.

* Add terminal metadata helpers

- Add hosted std.term TTY checks and terminal size fallback helpers.

- Lower terminal metadata through source and graph inputs with direct runtime support across object backends.

- Document and cover terminal metadata in the native terminal fixture.

* Add terminal raw mode helpers

- Add hosted std.term enterRawMode and leaveRawMode helpers with runtime restore support.

- Lower and verify raw-mode operations for source and graph-backed programs.

- Document raw mode and cover it in the terminal conformance fixture.

* Add hosted time sleep

- Add std.time.sleep as a hosted duration wait helper.

- Route graph clock reads and Darwin entropy through hosted runtime helpers.

- Document sleep and cover zero-duration sleep in platform conformance.

* Add terminal input read helper

- Add hosted std.term.readInput lowering, runtime support, and direct emitter hooks.
- Document the terminal input API and update the stdlib skill data.
- Cover the helper in the terminal conformance fixture and metrics budgets.

* Add process child stream primitives

- Add ProcChild std.proc APIs for spawn, wait, kill, close, and nonblocking child stdio.

- Lower child process helpers through graph, MIR verification, runtime import auditing, and direct native emitters.

- Cover the process handle flow with a native conformance fixture and target metadata updates.

* Support Mach-O fs path primitives

- Add hosted runtime helpers for path writes, directory checks, directory creation, removal, and rename.

- Wire AArch64 Mach-O emission and buildability for the fs primitives needed by Zero-authored CLIs.

- Simplify std.fs.writeFile through std.fs.writeBytes and refresh metrics/stdlib graph artifacts.

* Fix Mach-O fs write optional results

- Preserve Maybe<usize> results from std.fs.writeBytes in Mach-O local assignment and returns.

- Add a native writeFile boolean regression fixture and wire it into conformance/native coverage.

* Add inherited stdio process spawn

- Add std.proc.spawnInherit for argv-style child commands that inherit the parent terminal and return ProcStatus.

- Wire the helper through the runtime, MIR verifier, direct backends, buildability metadata, and stdlib docs/skills.

- Cover inherited stdout and exit-status behavior with a native conformance fixture.

* Add filesystem append support

- Add hosted std.fs append byte and file helpers for append-only writes.

- Wire runtime, lowering, verification, and direct backend support.

- Document and cover append behavior with native conformance.

* Add cwd-aware process child spawn

- Add std.proc.spawnChildIn for hosted child processes launched in a working directory.

- Wire runtime, lowering, verification, and direct backend helper support.

- Cover process child spawning with native conformance fixtures.

* Add terminal cursor movement helpers

- Add std.term cursor positioning and directional movement helpers backed by caller-owned buffers.

- Wire the terminal helper graph, stdlib metadata, docs, skills, and ANSI conformance coverage.

- Tighten embedded stdlib pruning and lowering so std helper modules do not collide with app modules.

* Add env-aware child process spawn

- Add std.proc.spawnChildInEnv for cwd-aware child processes with explicit newline-separated environment bindings.

- Wire hosted runtime imports, direct emitters, MIR lowering, docs, skills, and process conformance coverage.

- Validate child env propagation and invalid env rejection through native conformance.

* Add structured process argv helpers

- Add structured argv variants for inherited spawn, capture, file capture, and streaming child processes.

- Wire the new process helpers through graph/source lowering, MIR verification, runtime imports, and direct emitters.

- Cover argv/env behavior in native conformance and update std.proc docs and skill signatures.

* Expand terminal TUI primitives

- Add terminal background, underline, partial-clear, cursor-save, and bracketed-paste helpers across direct and graph lowering.
- Decode Insert, Shift-Tab, F1-F12, and bracketed paste markers with conformance coverage.
- Refresh std.term docs, embedded skill/runtime sources, and metric budgets for the expanded terminal surface.

* Add pid-backed process control

- Add std.proc helpers for child pids, stdin close, interrupts, and pid-level process control.
- Expand process conformance and docs for persistent child lifecycle handling.
- Update compiler metrics budgets for the larger process-control surface.

* Add hosted PTY process primitives

- Add std.pty runtime support, compiler lowering, direct emitter hooks, and runtime import reporting.

- Document the PTY API and expose version-matched stdlib skill guidance.

- Cover PTY spawn, resize, IO, env, lifecycle, and native runner behavior in conformance.

* Remove internal project reference from eval docs

- Keep eval sandbox docs public-facing

- Avoid internal project context in repository docs

* Support World capability helper functions

- Allow first-position World parameters in direct helper calls

- Lower source and graph calls without passing World through the ABI

- Add conformance coverage for output helpers that receive World

* Add process group signal helpers

- Add std.proc helpers for interrupting and killing hosted process groups by pid

- Start hosted child processes in their own process group and route handle cancellation through it

- Cover process-group cancellation in native process conformance

* Add std cli help formatting

- Add std.cli helpers for help headers, sections, and padded rows.

- Document and expose the new signatures through bundled stdlib skills.

- Cover formatter output in hosted CLI conformance.

* Add terminal mouse capture helpers

- Add std.term mouse capture enter and leave ANSI helpers

- Document and cover the helpers in terminal conformance

* Support atomic fs writes on Mach-O

- Lower std.fs.atomicWrite through the AArch64 Mach-O runtime helper

- Add a runtime helper for caller-provided temp path writes

- Share Mach-O byte-view argument setup across runtime calls

* Expose width-aware CLI help rows

- Add std.cli.formatHelpRowWithWidth to the public stdlib surface

- Cover custom CLI row padding in conformance and docs

- Keep embedded stdlib skill signatures in sync

* Add custom CLI help row formatting

- Add std.cli.formatHelpRowCustom for caller-controlled help indentation and label width.

- Keep existing help row helpers routed through the shared formatter.

- Cover the new formatting contract in hosted CLI conformance and docs.

* Add filesystem directory entry names

- Add std.fs.dirEntryName for caller-buffered directory entry scanning

- Wire graph lowering, MIR verification, native emitters, runtime helpers, docs, and skills

- Add native conformance coverage for directory entry name lookup

* Improve zero run startup performance

- Compact repeated array initialization in MIR and native emitters to shrink large generated programs.

- Index stdlib graph merge and MIR lowering lookups to reduce cold graph preparation time.

- Reuse native runtime object cache across workspaces by default while keeping project executable caches local.

* Share graph executable cache across workspaces

- Store graph-keyed linked executable cache entries in the shared native cache by default.

- Keep source-input executable cache entries package-local.

- Add a metrics guard for the shared graph executable cache branch.

* Avoid graph loads on cached zero run

- Run exact graph executable cache hits before repository graph resolution.

- Key graph linked executables from graph hash plus package metadata.

- Guard the fast cached run path in compiler metrics.

* Tighten cached zero run hot path

- Read graph hashes from binary store headers without loading full stores.

- Avoid duplicate manifest parsing while probing cached package runs.

- Execute early cached run artifacts directly and guard the path in metrics.

* Stabilize graph executable cache keys

- Remove path-derived dependency facts from graph executable cache keys.

- Bump the linked executable cache namespace for the stable key shape.

- Guard path-stable cache inputs in compiler metrics.

* Share mapped MIR cache across graph workspaces

- Move graph-store mapped MIR entries into the shared native cache by default while preserving ZERO_CACHE_DIR isolation.

- Update conformance/parity checks for shared mapped-MIR cache paths.

- Guard the shared cache behavior in compiler metrics and refresh bundled skill text.

* Speed hot graph run startup

- Precompute the embedded stdlib graph fingerprint during stdlib graph embedding.

- Add a dependency-free manifest metadata path for cached repository graph runs.

- Guard the hot executable cache path with compiler metrics.

* Fix process runtime audit and Mach-O arg staging

* Fix process close and executable output validation

* Fix process stream review issues

* Fix AArch64 process spawn arg staging

* Fix direct runtime and graph freshness regressions

* Fix process child wait and close semantics

* Address PR 427 validation fixes

* Fix stdlib contract CI failures

* Fix stdlib merge edge index ownership

* Restore cached graph run startup

* Fix process helper execution and test caps

* Fix process fd and cached run regressions

* Fix std.proc.spawn status handling

* Fix stale process child handles

* Fix std module basename collisions

* Fix std.proc process edge cases

* Fix ELF64 fs Maybe direct returns

* Fix proc runtime edge cases

* Fix proc child cleanup failures

* Gate proc capability on Windows hosts

* fix: normalize hosted main fallthrough exit

* Fix linked executable cache identity

* Fix process cleanup and graph projection guards

* Fix projection fast-path safety

* Validate binary graph fast-path records
2026-06-27 19:24:59 -05:00
2026-06-09 00:40:45 -05:00
2026-06-13 10:56:23 -05:00
2026-06-13 10:56:23 -05:00
2026-06-08 10:28:48 -05:00
2026-06-09 00:00:00 -05:00
2026-06-13 10:56:23 -05:00
2026-05-16 13:35:27 -05:00
2026-06-13 12:47:53 -05:00
2026-05-19 11:47:13 -05:00

Zerolang

The programming language for agents.

Zerolang is an experimental graph-native programming language where the semantic graph is the program database. Humans ask for outcomes. Agents query the graph, submit checked edits, and prove the result.

Safety warning

Zerolang is experimental. Expect breaking changes, rough edges, and security issues. Run it in isolated workspaces, not against production systems or sensitive data.

Start With a Request

The expected workflow is a normal conversation:

build hello world for zerolang

The agent should use the compiler, not guess from source text:

zero init
zero patch --op 'addMain' --op 'addCheckWrite fn="main" text="hello from zero\n"'
zero run

The result is still reviewable as a text projection:

pub fn main(world: World) -> Void raises {
    check world.out.write("hello from zero\n")
}

That .0 file is a projection of zero.graph. Humans can read it, review it, and occasionally edit it. Agents should normally keep using zero query and zero patch.

The Program Database

Traditional agent coding loops treat text as the source of truth:

flowchart LR
    A[agent writes text] --> B[check]
    B --> C[format]
    C --> D[build]
    D --> E[inspect failures]
    E --> A

Zerolang moves the agent closer to the compiler:

flowchart LR
    A[agent queries graph] --> B[agent submits checked patch]
    B --> C{compiler accepts?}
    C -- invalid or stale --> A
    C -- valid --> D[agent runs task validation]
    D --> E[human reviews projection when useful]

The graph gives agents explicit handles: symbols, node IDs, graph hashes, types, effects, ownership facts, capabilities, imports, call edges, and target facts. Edits can target semantic structure instead of line ranges. Stale graph hashes, unexpected field values, invalid shapes, and type errors fail before the store is written.

What Exists Today

  • zero.graph is the checked compiler input for graph-first packages.
  • .0 files are human-readable projections, not the normal agent authoring surface.
  • zero patch applies checked graph edits and rejects stale or invalid changes.
  • zero query, zero inspect, zero check, zero test, and zero run expose compiler facts through agent-friendly commands.
  • zero import and zero export make the projection boundary explicit, so human text edits do not silently diverge from the graph.

Install

Install the compiler:

curl -fsSL https://zerolang.ai/install.sh | bash
export PATH="$HOME/.zero/bin:$PATH"
zero --version

Install the agent bootstrap skill:

npx skills add vercel-labs/zerolang

The compiler bundles version-matched skills for agents:

zero skills
zero skills get agent
zero skills get graph
zero skills get language
zero skills get stdlib

Daily Loop

For most package work:

zero query
zero patch --op help
zero patch --op 'addMain'
zero check
zero test
zero run -- <args>

The default input is the current directory. Use . only when you want to be explicit.

When a human wants to review projection text:

zero export
zero verify-projection

When a human intentionally edits a projection:

zero import
zero check

Runtime Goals

The graph-first model should reduce agent guessing without relaxing the runtime goals:

  • Token-efficient inspection
  • Low memory usage
  • Fast startup and builds
  • Low runtime latency
  • Explicit capabilities
  • Small, dependency-free artifacts

Developing Zerolang

Build the local compiler:

pnpm install
make -C native/zero-c
bin/zero --version

Useful checks:

pnpm run docs:build
pnpm run conformance
pnpm run native:test
pnpm run command-contracts

For local iteration:

pnpm run conformance:local -- --list
pnpm run conformance:local -- --shard 1/4
pnpm run command-contracts:local

Read the docs at zerolang.ai.

S
Description
面向 Agent 的编程语言|GitHub 镜像 5.3k · 🍴 339
https://github.com/vercel-labs/zerolang Readme 74 MiB
Languages
C 75.9%
TypeScript 15%
C++ 4%
JavaScript 3.8%
Shell 1.3%