Skip to content
Trigora
Start building →

Supported language semantics

Supported language profiles: TypeScript (ts.subset.v1), Python (py.subset.v1), and Rust (rust.subset.v1).

TCC’s execution model does not depend on a single source language. Each frontend compiles its supported syntax into an artifact that the engine can resume, and reports unsupported syntax at compile time. Support for additional authoring languages is planned. See Unsupported constructs.

Each language profile defines a single Program entry point. Starting an Execution binds an ordered argument list to that entry point; resuming an Execution restores the existing continuation without binding the arguments again.

  • TypeScript: a default-export async function. A missing or undefined argument uses a call-time default from earlier parameters, otherwise it is undefined. Extra arguments are ignored. Explicit null stays null.
  • Python: one @program async function. Extra arguments are a start error. An omitted argument uses a compile-time constant default when one exists, otherwise it is a start error. Explicit None stays null. The program id is the file stem.
  • Rust: one pub async fn main. Exact arity, no defaults. A missing argument is a start error. Rust Program ids use the source file stem. For lib.rs and main.rs, the Cargo package name is used instead.

Durable operations are explicit imports: effect, waitForEvent / wait_for_event, sleep, invoke, and in Rust also join and race. A local function with the same name is not a durable operation. Durable operations stay in the program entry. Effect keys and event names are string literals.

Between durable operations, the supported language profiles include:

  • Arithmetic, short-circuit logic, branches, loops, index and length, in-place updates, and one-level destructuring.
  • Objects, arrays, structs, enums, Option, Result, and Vec are continuation values. Assignment copies a reference for TypeScript and Python objects and arrays. Mutation is visible through aliases.
  • Helpers and closures that do not suspend. A helper or closure frame cannot perform a durable operation. A closure value may live across a wait.
  • NaN, Infinity, -Infinity, and -0 round-trip where the language has them. An unsupported mix of operators is a runtime type error.
  • Explicit null / None stays null.

Each language keeps its own rules:

  • TypeScript defaults run at the call and may use earlier parameters. Python assignment in a nested function is a new local unless declared nonlocal.
  • Python defaults are compile-time constants: None, a bool, a finite number, or a string. True + 1 is 2. Divide-by-zero raises.
  • Rust numbers are f64. A capturing effect closure is move.

Structured concurrency uses the same durable join semantics across languages: TypeScript await Promise.all / await Promise.race, Python await gather / await race, and Rust join / race. See Structured concurrency.

Engine-native authoring is a separate integration model. See Engine-native primitives.