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.
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.
The Plato geometry library compiled to TypeScript. Fluent math on plain numbers, immutable value types, and code that reads like the C# original.
Open the TypeScript demo →The same Plato source compiled to Rust, built to WebAssembly, and computing every sample live in your browser — straight out of wasm linear memory.
Open the Rust demo →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))); }
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.
Terse declarations are amplified into large, monomorphized, zero-dispatch libraries. A three-field vector type comes out the other side with hundreds of members.
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.