POLYTONE — the AI-native programming language

Guide

Functions

Signatures are always fully explicit — you never need to read a body to know what a function takes and returns.

functions.pt
fn greet(name: Text) -> Text:
    return "Hello, {name}!"

// Expression-body short form — same rules, one line.
fn add(a: Int, b: Int) -> Int = a + b

/// Public functions require a doc comment.
pub fn shout(name: Text) -> Text = greet(name).upper()

A function whose return type is not Void must return on every path, and unused results cannot be silently dropped — this Int result is discarded is a compile error, not a lint.