A statically typed, effect-inferred, embeddable application language. It aims for the simplicity of Lua, the algebraic effects of Koka, ML-style inference, and an engine designed for hot reload and near-native speed. It is implemented in Odin and designed for AI agents as first-class authors.
type User
id: Int
name: String
end
effect Users
find(id: Int) -> User
end
fn greet(id)
user = Users.find(id)
"Hello, {user.name}"
end
-- zl sig: fn greet : (Int) -> String ! {Users}
handler TestUsers: Users
fn find(id) { id, name: "Ada" } end
end
fn main()
print(handle greet(1) with TestUsers end)
end
- Design:
spec/zlang-design.md. It starts with a challenge register covering every assumption. - How to write Zlang:
docs/idioms.md, also available aszl idioms. - What is implemented:
docs/status.md. The current build is a bootstrap slice: front end, type and effect inference, the T0 reference evaluator, and the agent tooling.
Requires the Odin compiler.
ODIN=odin ./build.sh
./bin/zl run examples/effects.zl
./bin/zl check examples/effects.zl --json # structured diagnostics with fixes
./bin/zl sig examples/effects.zl # inferred signatures, including effects
./bin/zl explain Z0307
tests/run.sh
The toolchain is built to be driven by agents (spec §13):
zl idiomsprints the canonical style guide: one idiomatic form per construct.zl check --jsonreturns structured diagnostics with stable codes and exact fixes.?holes ask the compiler what fits at that point.zl sigshows every inferred signature, including effects, which are the code's exact authority.zl diff --git HEAD file.zlreviews what new authority a change grants.zl run --allow Console --fuel N --max-memory 64Mruns untrusted code safely.zl run --trace t.jsonlrecords every input;zl run --replay t.jsonlreproduces the run exactly.zl dis file.zlshows the bytecode the VM runs.
Editors (and agents with LSP support) can use zl lsp: diagnostics, hover types, go-to-definition and symbols.
Agents can also call the toolchain as an MCP server:
claude mcp add zl -- /path/to/zscript/bin/zl mcp
Its tools are zl_check, zl_sig, zl_run, zl_test, zl_type, zl_fmt, zl_diff, zl_explain and zl_idioms. Each accepts a file path or inline source.