Documentation

Serez Code

Serez Code is a general-purpose programming language designed to feel familiar from day one. If you know JavaScript, Python, or C#, you'll be comfortable in minutes.

It runs scripts from a single file, has an interactive REPL, and ships with a built-in package manager. Types are optional — add them where they help, skip them where they don't. Memory is managed automatically without a garbage collector, so there are no GC pauses.

# Write a script and run it
let name = "world"
out "Hello, {name}!"   // → Hello, world!

Where to start

A taste of the language

// Variables and types
let count = 0
let message = "hello"
const MAX = 100

// Functions — types are optional
fn int add(int a, int b) {
    return a + b
}

// Arrow function
let double = int (int n) => { return n * 2 }

// Arrays with higher-order functions
let nums = [1, 2, 3, 4, 5]
let evens  = nums.filter(x => x % 2 == 0)   // [2, 4]
let doubled = evens.map(x => x * 2)          // [4, 8]

// Classes
public class Point {
    public Point(decimal x, decimal y) {
        this.x = x
        this.y = y
    }
    public decimal distanceTo(Point other) {
        let dx = this.x - other.x
        let dy = this.y - other.y
        return Math.sqrt(dx * dx + dy * dy)
    }
}

let a = new Point(0.0, 0.0)
let b = new Point(3.0, 4.0)
out a.distanceTo(b)   // → 5.0