Programs
Every Program artifact has one entry function identified by program.entry.
| Language | Source |
|---|---|
| TypeScript | A default-exported async function |
| Python | Exactly one @program async function |
| Rust | Exactly 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
@programfunction may have any name. - Rust: the source file stem. For
lib.rsandmain.rs, the Cargo package name is used instead. The artifact function name ismain.
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
undefinedargument uses a call-time default that may read earlier parameters. Otherwise it isundefined. Extra arguments are ignored. Explicitnullstaysnull. - 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
Nonestays 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
@programasync 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.