Turnturnv1.0.0
v1.0.0

The programming language where agents are the execution model.

Most languages treat agents as a design pattern layered on top of a runtime. Turn makes the actor model, typed inference, and durable state the runtime itself.

the idea

Every general-purpose language lets you build agents. Frameworks give you tools, helpers, and patterns. The runtime still knows nothing about agents. When the system gets complex — multi-agent pipelines, failure recovery, probabilistic decisions — you end up building infrastructure to compensate for a runtime that was never designed for this work.

Turn is a programming language where agents are the execution model. Actors, typed LLM inference, probabilistic control flow, and durable state are not libraries you import. They are how the VM works.

Spawn an actor and the runtime isolates its stack and context window. Call infer and the VM constrains the model to your schema and validates the response before your code touches it. Gate on confidence and the language itself is uncertain-aware. Checkpoint with suspend and the VM writes its full state to disk — not as application code, but as a VM instruction.

what it looks like

analyst.tn
struct Analysis  { verdict: Str, risk_score: Num };
struct NextAction { type: Str, reason: Str };

// each actor has its own isolated stack, heap, and context window
let analyst = spawn_link turn(input: Str) {
    context.system("You are a rigorous analyst. Be concise.");
    return infer Analysis { "Evaluate risk: " + input; };
};

let signal = receive;
let report  = signal["result"];

// confidence is a first-class value — not a parsing concern
if confidence report < 0.82 {
    send supervisor_pid, { "type": "escalate", "payload": report };
    return null;
};

// durable state — persists across VM restarts and suspensions
remember("last_verdict", report.verdict);

let next = infer NextAction {
    "Verdict: " + report.verdict + " — what is the next step?";
};
call("echo", next.type);

A supervisor spawns a child analyst actor. The child infers against a typed schema. The result is confidence-gated before it continues. State is persisted across restarts. No framework. No library. VM instructions.

01 / install

Get Turn.

Single static binary. No runtime dependencies.

shell
curl -fsSL https://turn-lang.dev/install.sh | bash

Downloads the pre-compiled turn binary to ~/.turn/bin and adds it to your $PATH.

Verify:

turn --version
# turn v1.0.0

02 / playground

Try it.

Code runs in an ephemeral server sandbox. Examples without infer need no API key. For inference examples, configure your provider below.

● requires provider
actors.tn

03 / docs

Documentation.

Pick a starting point.

getting started

New to Turn.

Install the binary, write your first program, and understand how the runtime works.

language reference

The full language.

Actors, typed inference, confidence, memory, context, error handling, and ecosystem bridges.

examples

Learn by reading.

Production-grade multi-agent programs you can run, modify, and ship.