POLYTONE — the AI-native programming language

Guide

Habits from other languages

Since Sprints 340–341 the compiler answers 131 forms from Python, JavaScript, Rust, Go, Java and C with POLYTONE's own.

habits.pt
def total(xs):
    return sum(xs)
habits2.pt
fn main() -> Void:
    mut count = 0
    count += 1
    print("{count}")

def, var, class, try/throw, switch, else if, x += 1, ===, a ? b : c, f-strings, lambdas, await, null, True, this, x in xs, slices, comprehensions, import … as, lists.max, json.stringify, startsWith and their kin each name the canonical form. The corpus tests/priors pins every one of these diagnostics verbatim.