POLYTONE — the AI-native programming language

Guide

Standard library

The stdlib is written in POLYTONE itself — plain .pt modules, self-tested with test blocks, imported like any module.

uses_stdlib.pt
import lists
import texts

fn main() -> Void:
    let squares = lists.range(1, 6).map(fn(x: Int) -> Int = x * x)
    print("sum: {lists.sum(squares)}")
    print("padded: {texts.pad_left("7", 4, "0")}")

import resolves next to your file first, then in the stdlib ($POLYTONE_STDLIB or the checkout's stdlib/) — a local file always shadows the stdlib. v0.1 ships ints (min, max, clamp, sign, is_even, pow, gcd), lists (sum, product, range, largest, smallest, count_where), and texts (repeat, pad_left, pad_right, is_blank).