Systems programming language with manual memory management, generics, interfaces, and zero-cost abstractions. Compiles to native code via LLVM.
- Explicit ownership — values with destructors require
moveor.clone(); scalars copy implicitly - Generics —
fn identity<T>(value: T) -> T,struct Container<T> - Interfaces — structural contracts with dynamic dispatch
- Enums with payloads —
Option<T>::Some { value: T },Result<T, E>::Ok { value: T } - Struct inheritance — single inheritance with
override fn - defer — scope-exit cleanup in reverse order
- when — multi-branch matching with guards and destructuring
- Primitive facades —
32.to_string(),"zep".to_string() - C FFI —
extern fn,extern varwith variadic support - Zero-cost abstractions —
@sizeof(T),@length(array),Type.proto.fields
import std.io
struct Point : Copy {
public:
var x: i32
var y: i32
fn Point(x: i32, y: i32) -> Point {
return Point { x: x, y: y }
}
fn distance() -> f64 {
return ((x * x + y * y) as f64).sqrt()
}
}
interface Shape {
public:
fn area() -> f64
}
struct Circle : Shape, Copy {
public:
var radius: f64
fn Circle(radius: f64) -> Circle {
return Circle { radius: radius }
}
override fn area() -> f64 {
return 3.14159 * radius * radius
}
}
fn main() -> i32 {
var point = Point(3, 4)
io.printf("distance: %f\n", point.distance())
var circle = Circle(5.0)
io.printf("area: %f\n", circle.area())
return 0
}Prerequisites: CMake 3.30+, Ninja, Clang with C++26 support
cmake --preset debug
cmake --build cmake-build-debugctest --test-dir cmake-build-debug --output-on-failureUse ctest --test-dir cmake-build-debug -N to list the currently discovered tests.
Use -o with levels 0, 1, 2, or 3:
cmake-build-debug/cli/zep/zep build -o 2
cmake-build-debug/cli/zepc/zepc --input path/to/file.zep -o 3Level 0 is the default. Higher levels run LLVM optimization passes before object emission.
cd examples/api
../../cmake-build-debug/cli/zep/zep build
./build/apiProjects use zep.json:
{
"name": "project",
"version": "0.1.0",
"type": "executable",
"libs": {
"std": "0.0.1"
}
}See DESIGN.md for the full language specification and CONTRIBUTING.md for build, test, and contribution details.