AI Navigate

Turn: A Language for Agentic Computation

arXiv cs.AI / 3/11/2026

Developer Stack & InfrastructureIdeas & Deep AnalysisTools & Practical Usage

Key Points

  • Turn is a new compiled, actor-based programming language designed specifically for agentic software that autonomously reasons and acts by delegating inference tasks to large language models (LLMs).
  • It introduces five key language-level constructs including cognitive type safety for typed LLM output validation, a confidence operator for flow control based on model certainty, an Erlang-inspired actor process model, a capability-based identity system to protect credentials, and compile-time schema absorption for generating typed API bindings.
  • Turn provides stronger language guarantees for bounded context, typed inference output, credential isolation, and durable state, addressing limitations of existing frameworks that rely on application-level conventions.
  • The language is implemented with a Rust-based bytecode virtual machine and evaluated on representative agentic workloads, and it is available as an open-source project on GitHub.
  • Turn supports integration with popular schema specifications like OpenAPI, GraphQL, FHIR, and MCP, enhancing its practical utility for agentic software development.

Abstract

We present \textbf{Turn}, a compiled, actor-based programming language -- statically typed for schema inference, dynamically typed at the value level -- for agentic software: programs that reason and act autonomously by delegating inference to large language models (LLMs). Existing approaches augment general-purpose languages with frameworks, encoding critical invariants (bounded context, typed inference output, credential isolation, durable state) as application-level conventions rather than language guarantees. Turn introduces five language-level constructs that address this gap. \emph{Cognitive Type Safety} makes LLM inference a typed primitive: the compiler generates a JSON Schema from a struct definition and the VM validates model output before binding. The \emph{confidence operator} enables deterministic control flow gated on model certainty. Turn's \emph{actor-based process model}, derived from Erlang, gives each agent an isolated context window, persistent memory, and mailbox. A \emph{capability-based identity system} returns opaque, unforgeable handles from the VM host, ensuring raw credentials never enter agent memory. Finally, \emph{compile-time schema absorption} (\texttt{use schema::}) synthesizes typed API bindings from external specifications at compile time; the \texttt{openapi} adapter is shipped with \texttt{graphql}, \texttt{fhir}, and \texttt{mcp} in active development. We describe the language design, type rules, schema semantics, and a Rust-based bytecode VM, and evaluate Turn against representative agentic workloads. Turn is open source at https://github.com/ekizito96/Turn.