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.

Logic is written in words

&& and || do not exist: and, or, not read the same in every language a model has seen, and & / | stay unambiguous as the bitwise operators on Int.

broken.pt
let ready = true
let paid = false
if ready && paid:
    print("ship")
The compiler answers
error: '&&' does not exist — POLYTONE writes logic as words: 'a and b' ('and', 'or', 'not'); a single '&' / '|' is the bitwise operator on Int (line 3, column 10)