Code that reads like thought
Zero combines the performance of systems languages with the expressiveness of modern high-level languages. Inline modifiers, array broadcasting, built-in differentiation, and errors as values — all in a clean, readable syntax.
fun square(x: i32) -> i32 => x * x
fun main()
let nums = [1, 2, 3, 4, 5]
# Filter and transform arrays inline
let evens = nums[x => x % 2 == 0]
let squared = nums[].square()
println("Squared: \(squared)")
println("has evens") if evens.count > 0
end
Clean, Flexible Syntax
Use end blocks or {} braces — your choice, even in the same file. Inline modifiers like return x if condition and x++ while n < 10 keep simple logic on one line.
Automatic Differentiation
Compute derivatives symbolically at compile time. Write f'x(1.0) to get the partial derivative, f'() for the gradient, or f''() for the Hessian. No libraries, no approximation.
Errors Without Exceptions
Declare error types with sym and return them as union values. Use !! to coalesce errors, !. for error-conditional access, and ? for nullable types. Errors are always explicit.
Expressive Type System
Full type inference, union types, nullable T?, arbitrary-width integers like u5, range-bounded types like 0..100, and fixed-point i8.8. The type system works with you, not against you.
Extend Any Type
Add methods to built-in types with extend. Overload operators as free functions. Call any function with dot syntax via unified call syntax: 5.square() is just square(5).
Built-in Concurrency
Parallelize loops with parallel for. Use async/await for tasks and scope blocks for structured concurrency. Race tasks with select. No third-party runtime needed.
Ready to get started?
Jump into the interactive tutorial or try the playground.