Topo icon

Topo

Explicit logic declarations for program verification and optimization.

What is Topo

Topo extracts the logical requirements of a program — what's public, what must run before what, what can run in parallel — from implicit code patterns into explicit .topo declarations. These declarations are auditable, machine-verifiable contracts.

🛡

Undeclared behavior is forbidden

Non-external functions cannot access system capabilities. Violations are compile-time errors, not warnings.

Declarations enable optimization

Explicit stage ordering, parallelism, and visibility give the compiler information beyond what traditional analysis can derive.

🔍

Review focuses on declarations

A 1000-line PR might have 3 unsafe points marked external — reviewers check those, not the entire diff.

Three Declaration Types

Every .topo declaration falls into one of three classes.

Boundary

Existence boundary

Which symbols are public API, which are implementation detail. Enables visibility verification, dead code elimination, and symbol obfuscation.

Order

Logic ordering

Which operations must precede which (stage<N>). Enables stage isolation verification and instruction reordering.

Parallel

Logic parallelism

Which operations are independent (pipeline DAG). Enables automatic parallelization and pipeline codegen.

Supported Languages

Per-language SDKs with analysis, transpilation, and LSP support.

C++ Rust Java Python TypeScript