KAI distributed computing framework

Distributed computing · C++23 · Est. ~2003

KAI is a distributed computing
framework written in modern C++.

Full reflection, network-transparent continuations, and three custom languages — without requiring modification to existing source code.


01

Network-transparent continuations

Computations migrate between processes without the caller's knowledge. The continuation is the unit of distribution.

Live demo →

02

Tri-colour incremental GC

Generational, incremental collection across distributed object registries. No stop-the-world pauses.

03

Full reflection, zero annotation

Any registered C++ type becomes inspectable, persistable, and network-accessible without source changes.

04

Structural persistence

Freeze and thaw are symmetric operations. The object graph serialises to disk or across the network identically.


Three purpose-built languages with a defined compilation relationship. Rho compiles to Pi; Pi is what the executor runs. Tau is orthogonal — it defines distributed interfaces.

π  Pi Execution substrate RPN stack language. Minimal and imperative. The executor runs Pi directly; the stack and instruction pointer are the complete continuation state.
ρ  Rho Scripting layer Structured syntax that compiles to Pi bytecode. Exists so that humans don't have to write Pi directly.
τ  Tau Interface definition Describes distributed object contracts across process boundaries. Orthogonal to Pi and Rho.

Rho → Pi: adding two numbers

Rho (source)

// structured syntax
let a = 3
let b = 4
let c = a + b
// c == 7
→

Pi (compiled output)

// RPN stack execution
3 4 +
// stack: [ 7 ]
// executor resumes here

Because Pi's RPN form makes the entire execution state explicit, continuations can be frozen, transmitted, and resumed on a remote executor without loss.

RhoMog model — continuation migration view ↗