POLYTONE

The AI-native programming language

polýs + tónos — why the name?

One canonical form for every construct. Errors that teach instead of scold. Tests built into the language. POLYTONE is designed for the way code is written now — by humans and machines, together.

hello.pt
fn main() -> Void:
    let name = "world"
    print("Hello, {name}!")
    print("2 + 2 = {2 + 2}")
v0.44.288

New in this release

Sprint 288 — The sound studio
Every version in the changelog →
Errors that teachEvery diagnostic names the canonical form to write instead. Try them live in the Error Lab.1One canonical formOne spelling per construct, one formatting, named fields in declaration order. Low entropy in, low entropy out.Tests in the languagetest blocks and assert are keywords. Failing comparisons print both operand values.No null, no exceptionsAbsence is Option, failure is Result, and ? propagates both. Matches must be exhaustive.

Fewer tokens, same work

POLYTONE is designed for LLM generation. The effect is measurable: same task, equivalent runnable programs, counted with the cl100k tokenizer.

Generating a program 320×200 poster: gradient, three circles, PPM export — tokens per source
POLYTONE
194
Python + Pillow
314 · +62 %
TypeScript
503 · +159 %
Passing an image to the model the same 96×96 scene: as editable text (.pti) vs. as a binary image — tokens per transfer
Scene as .pti
134
PNG (Base64)
948 · × 7
One IDE edit request program importing images: polytone-context slice vs. file context (project + stdlib source) — tokens per request
Context slice
2 021
File context
15 340 · × 7,6

Measured 2026-07: equivalent, verified-runnable programs (byte-identical output) and the reproducible context benchmark (benchmarks/context, CI-gated); tokenizer cl100k_base. Honestly: on a two-file project the slice is a wash — it wins as soon as real modules are imported.

Code that proves itself

Tests live next to the function, not in a foreign framework. And when one fails, the message already explains what to do:

doubling.pt
fn double(x: Int) -> Int = x + x

test "doubling four":
    assert double(4) == 8

test "this expectation is wrong":
    let xs = [1, 2].map(fn(x: Int) -> Int = double(x))
    assert xs == [2, 5]