Plato

Write geometry once. Run it everywhere.

Plato is a small, pure, statically-typed language for writing geometric and numeric libraries once, and compiling them into fast, idiomatic code for other platforms — C# in daily production use, with working TypeScript and Rust proofs of concept. Developed at Ara 3D.

Live demos

Twelve geometry algorithms — Delaunay, convex hull, BVH, half-edge meshes, raycasting, and more — written once in Plato, running below in two different languages, rendered with Three.js.

One source of truth

Real code from the shared demo library — both sample browsers above are generated from it.

library Vectors3
{
    Lerp(a: Vector3D, b: Vector3D, t: Number): Vector3D
        => a.Scale(1.0 - t).Add(b.Scale(t));

    MidPoint(a: Vector3D, b: Vector3D): Vector3D
        => a.Add(b).Scale(0.5);

    Reflect(v: Vector3D, normal: Vector3D): Vector3D
        => v.Subtract(normal.Scale(2.0 * v.Dot(normal)));
}

Pure and immutable

Every value is immutable and every function is pure. No mutation, no exceptions, no hidden state — which is exactly what makes retargeting to new languages credible.

Compiled, not interpreted

Terse declarations are amplified into large, monomorphized, zero-dispatch libraries. A three-field vector type comes out the other side with hundreds of members.

Idiomatic output

Generated C# uses structs and aggressive inlining; TypeScript gets fluent methods on native numbers; Rust gets extension traits. Each target reads like a native library.