⚡ Zero:Vercel Labs 出品 865★ 的 Agent 编程语言,一个 curl 命令安装,专为 AI Agent 写原生工具而生
项目地址:vercel-labs/zero | ⭐ 865 Stars | 🛠 C | 📅 2026-05-15 | 作者 Vercel Labs
老实说,现在让 AI Agent 写代码,99% 的时间它都在写 JavaScript、Python 或 TypeScript。然后跑起来——内存几百 MB,二进制十几 MB,启动还得等半天。Vercel Labs 前两天扔出来一个叫 Zero 的东西,说是"编程语言 for agents",我第一反应是又一个大饼。结果看了代码,有点东西。
Zero 不是框架,不是库——是一门从零设计的系统语言。目标很直接:让 Agent 能编译出几十 KB 的静态二进制,零依赖,启动毫秒级。每行代码都显式标注副作用(raises),内存分配可预测,编译器输出结构化的 JSON,Agent 可以直接解析。
⚡ 安装:一行命令
curl -fsSL https://zerolang.ai/install.sh | bash
export PATH="$HOME/.zero/bin:$PATH"
zero --version
装完就能用,不需要装 Go / Rust / Node 任何运行时。
🔧 写一个 Hello World
Zero 的源码后缀是 .0:
pub fun main(world: World) -> Void raises {
check world.out.write("hello from zero\n")
}
raises 是强制声明的——这个函数可能会失败,调用者必须处理。没有隐藏的异常,没有未捕获的崩溃。
编译运行:
zero check examples/hello.0
zero run examples/hello.0
zero check 做静态检查,zero run 编译+运行,一步到位。
🎯 显式内存
Agent 写代码最容易翻车的地方就是内存——LLM 生成的 Rust 代码经常借检查过不去,Python 代码 GC 抖动。Zero 选择了简单路径:
shape Point {
x: i32,
y: i32,
}
fun sum(point: Point) -> i32 {
return point.x + point.y
}
没有生命周期标注,没有引用计数,直接值语义。Agent 不会写错所有权。
🛠 构建原生二进制
zero build --emit exe --target linux-musl-x64 examples/add.0 --out .zero/out/add
输出是一个静态链接的 musl 二进制,塞进 30MB 的 Docker 镜像里毫无压力。zero size --json examples/point.0 直接告诉你输出的二进制大小。
🤖 它是为 Agent 设计的
Zero 最骚的操作是 zero graph --json 和 zero routes --json——它们输出的是结构化 JSON,不是给人看的终端颜色。Agent 可以直接 parse 代码的依赖图、函数调用链、模块路由,不需要额外的 AST 解析库。
zero graph --json examples/systems-package
zero routes --json examples/web/hello
Agent 想重构代码?直接读 JSON 就知道哪些函数被谁调了,比 grep 整个项目靠谱。
🧠 总结
Zero 目前还很早期(866 Stars,才发布两天),但方向很有意思。不是要取代 Rust/Go,而是给 AI Agent 一个专门写小型原生工具的语言。几个要点:
- 安装一行命令,编译器是 C 写的,几个 ms 编译完
- 显式副作用、可预测内存、零运行时依赖
- 输出结构化 JSON 让 Agent 直接解析代码图
- 适合场景:CLI 工具、sidecar 代理、边缘函数、WebAssembly 模块
- 不适合:复杂应用、GUI、需要 GC 的场景
如果你在用 Claude Code / Codex 写自动化脚本,试试让 Agent 用 Zero 写几个小工具——编译出来的二进制比你想象的还要小。
Zero: Vercel Labs' 865★ Programming Language for Agents — One curl Command Installs It, Built for Native Agent Tooling
Project: vercel-labs/zero | ⭐ 865 Stars | 🛠 C | 📅 2026-05-15 | by Vercel Labs
Let's be honest — 99% of the time when you ask an AI agent to write code, it reaches for JavaScript, Python, or TypeScript. The result? A few hundred MB of runtime, a double-digit MB binary, and a startup that takes longer than the actual task. Vercel Labs dropped something called Zero two days ago — "the programming language for agents." I was skeptical. Then I read the code.
Zero isn't a framework or library — it's a systems language designed from scratch. The goal: let agents compile tiny (tens of KB), statically-linked, zero-dependency native binaries with millisecond startup. Every function explicitly declares its side effects (raises), memory allocation is predictable, and the compiler outputs structured JSON that agents can parse directly.
Install in one command:
curl -fsSL https://zerolang.ai/install.sh | bash
export PATH="$HOME/.zero/bin:$PATH"
zero --version
Write a hello world:
pub fun main(world: World) -> Void raises {
check world.out.write("hello from zero\n")
}
Build a native binary:
zero build --emit exe --target linux-musl-x64 examples/add.0 --out .zero/out/add
The killer feature: zero graph --json and zero routes --json output structured JSON instead of colored terminal output. Agents can parse dependency graphs, call chains, and module routes directly — no extra AST parsing library needed.
Key takeaways:
- One-command install, C-based compiler compiles in milliseconds
- Explicit effects, predictable memory, zero runtime deps
- Structured JSON output lets agents parse code graphs natively
- Best for: CLI tools, sidecar proxies, edge functions, WASM modules
- Not for: complex apps, GUI, GC-heavy workloads
If you're using Claude Code or Codex for automation scripts, try asking your agent to write a few small tools in Zero — the resulting binaries are smaller than you'd expect.