Language overview
ZZ is a small systems language for services, CLIs, and data pipelines.
Mental model
Section titled “Mental model”- Values, not references. Variables hold independent values. Functions receive
copies. There is no
&, no borrow checker, no aliasing to reason about. See Value semantics. - Inferred, then checked.
:=infers,: T =pins. The checker unifies types and reports every error in one pass with a fix hint. See Checker. - Pipelines over nesting.
|>passes left as first arg.match+?+??keep happy-path code flat. - Same on VM and native.
zz run(VM) andzz build(AOT) agree bit-for-bit on ints/floats. If they could diverge, the checker errors instead. See Parity.
A complete program in 30 lines
Section titled “A complete program in 30 lines”import std.http
struct User { name: str, age: int }
func adult(u: User) -> bool { return u.age >= 18}
func main() { users := [User{ name: "Ada", age: 36 }, User{ name: "Bo", age: 12 }] names := [u.name for u in users if adult(u)] println(names) // ["Ada"]
s := http.server() s = s.route("GET", "/", |req| "ok") println("routes ready")}Where to go next
Section titled “Where to go next”- Syntax details: Variables and functions, Control flow, Strings, Collections, Structs and enums, Pattern matching, Modules.
- Complete grammar: syntax.md. Type rules: types.md.