Zerolang
GitHub RepoImpressions106
View on GitHub
@githubprojectsPost Author

When Code Editing Means More Than Text Replacement

You've probably watched an AI assistant try to edit your code and wondered why it's so bad at it. It guesses line numbers, produces patches that break imports, and sometimes changes the wrong thing entirely because it's working with text—not meaning. That's the fundamental problem zerolang, an experimental graph-first programming language from Vercel Labs, is designed to solve. Instead of making agents guess their way through source text, zerolang gives them a compiler-derived graph of semantic facts, letting them inspect and change programs with far less ambiguity.

What It Does

Zerolang is a programming language with a compiler that produces something called a ProgramGraph—a structured representation of your program's semantics derived from source code. You write human-readable .0 source files that look like normal code, but the compiler exposes a graph that agents (or you) can query for node IDs, types, effects, capabilities, and module relationships.

The key insight is that source code remains the source of truth. The graph is derived data, not a replacement. When an agent wants to understand or modify a program, it works through the graph rather than guessing at text ranges. The compiler validates any edits before writing them back to source, so you get a checked transformation rather than a blind text patch.

Zerolang is built with specific design goals in mind: token efficiency, low memory usage, fast startup, fast builds, low runtime latency, and zero dependencies. It's also explicitly not production-ready—the README warns that security vulnerabilities should be expected and recommends running it only in isolated, disposable environments.

Why It's Cool

The graph-first approach solves a problem that's been nagging at anyone who's tried to build reliable code assistants: text is a terrible interface for program understanding.

  • Edits target meaning, not line numbers. Instead of saying "change line 42 to X," an agent says "replace node #610c78bf." The compiler handles figuring out what that means in source terms. This eliminates an entire class of bugs where patches apply to the wrong location because the source shifted between inspection and edit.

  • The graph hash is a stale-context check. When an agent inspects a program, it gets a graph hash. Any subsequent edit request includes that hash, so the compiler can reject edits that were computed against an outdated version. This is a simple but powerful guard against the "I edited something that already changed" problem.

  • Semantic operations instead of regex. Renaming a function or replacing a callee becomes a structural operation, not a search-and-replace that might accidentally hit a comment or a different scope. The compiler validates ownership, types, effects, and imports as part of the edit pipeline.

  • Context gathering is intentional. Instead of dumping the entire file into context, agents can start from a symbol, diagnostic, or node ID and ask for surrounding semantic facts. This keeps context windows focused and reduces the noise that makes current AI code editing so unreliable.

  • Source stays human-readable. The .0 format is described as "durable data"—easy to diff, audit, and regenerate. You're not losing the ability to review code in your normal workflow; you're just giving agents a better map of what that code means.

How to Try It

Zerolang is experimental and not for production use, but you can explore it today. The repository is at github.com/vercel-labs/zerolang.

Start by writing a small .0 source file. The README shows a minimal example:

fn answer() -> i32 {
    return 40 + 2
}

pub fn main(world: World) -> Void raises {
    if answer() == 42 {
        check world.out.write("math works
")
    }
}

Then use the compiler to dump the ProgramGraph and see what agents would work with:

zero graph dump examples/hello.0

You'll get output like this, showing node IDs, types, and edges:

zero-graph v1
origin source-text
module "hello"
hash "graph:b8a019041020df03"

node #ea5ea1ca Function name:"main" type:"Void" public:true fallible:true
node #f9ce8b3e Param name:"world" type:"World"
node #421a4d4b MethodCall name:"write" type:"Void"
node #610c78bf Literal type:"String" value:"hello from zero
"
edge #421a4d4b arg #610c78bf order:0
edge #ea5ea1ca body #6c48dda8

For supported source, you can apply checked graph edits via zero graph patch, which validates the edit before rewriting source.

Final Thoughts

Zerolang is clearly early-stage—the README is upfront about its safety status and the tooling is minimal. But the ideas here are worth paying attention to, especially if you've been frustrated by how poorly current AI tools handle code editing. The shift from text-patching to semantic-graph-operations is a genuinely different approach to the problem, and even if zerolang itself doesn't become mainstream, the concepts around graph hashes, node-targeted edits, and validated transformations are likely to influence how we build the next generation of developer tools.

Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Last updated: May 31, 2026 at 06:43 AM