POLYTONE — the AI-native programming language

Error Lab

Every diagnostic below is the real output of ptc, not a mock-up. Pick a mistake, read how the compiler teaches the canonical form, then flip to the fix.

No hidden globals

Functions see parameters and locals, nothing else. Every dependency is in the signature — which is exactly what makes functions testable.

broken.pt
let limit = 10
fn over(n: Int) -> Bool = n > limit
The compiler answers
error: 'limit' is a top-level variable — functions only see their parameters and locals in POLYTONE; pass it as a parameter (line 2, column 31)