Skip to content
Trigora
Start building →

Programs

Every Program artifact has one entry function identified by program.entry.

LanguageSource
TypeScriptA default-exported async function
PythonExactly one @program async function
RustExactly one pub async fn main

The program id is not always that function’s name:

  • TypeScript: the named default export, or the file stem when the export is anonymous. An anonymous export’s artifact function name is "default". That name is compiler metadata.
  • Python: the file stem. The @program function may have any name.
  • Rust: the source file stem. For lib.rs and main.rs, the Cargo package name is used instead. The artifact function name is main.

Arguments are an ordered list. A fresh start binds that list to the entry parameters. Resume restores the continuation and does not bind again. After binding, each parameter is an ordinary local.

  • TypeScript: a missing or undefined argument uses a call-time default that may read earlier parameters. Otherwise it is undefined. Extra arguments are ignored. Explicit null stays null.
  • Python: extra arguments are a start error. An omitted argument uses a compile-time constant default when the function has one. Otherwise it is a start error. Explicit None stays null.
  • Rust: exact arity, no defaults. A missing argument is a start error.
export default async function research(topic, limit = 10) {
return { topic, limit };
}
from trigora import program
@program
async def research(topic, limit=10):
return {"topic": topic, "limit": limit}

trigora start research --input '["tcc"]' supplies that vector. TypeScript fills limit from the default. Python does the same because 10 is a compile-time constant. See Start execution and invoke.

import { effect, waitForEvent } from "@trigora/sdk";
export default async function approval() {
const result = await effect("generate", () => 42);
const review = await waitForEvent("approved");
return { result, review };
}

trigora deploy publishes a version of that Program. An Execution is one run of one version.

Progress commits at durable operations. Between them, the program runs ordinary computation: arithmetic, objects and arrays, helpers, closures, branches, and loops. Unsupported constructs fail at compile time. See Supported language semantics.

@trigora/sdk is this model. It is not TCC Engine.