On this page

Tenon Mental Model & Concepts

A 1-page guide to how Tenon projects, files, capabilities, and modern (M26–M30) language features fit together.

Project lifecycle & directory layout

A Tenon project is a directory with a tenon.toml manifest and one or more .tn source modules (entry point main.tn by default):

Path Committed? Purpose
tenon.toml Yes Package manifest: [package] name/version/platform, [capabilities] ceiling, [dependencies], and [embed.*] assets.
tenon.lock Yes Deterministic lockfile written by tenon add / tenon fetch. Pins bundled edition plugins, git commits, registry packs, and process-plugin executable SHA-256 hashes.
.tenon/ No (.gitignored) Local toolchain state: offline materialized dependencies (.tenon/deps/), implicit derive companion cache (.tenon/cache/gen/), fetch lock, and local vc store. Safe to delete and recreate via tenon fetch.
gen/ Optional Explicit checked-in output directory for derive G for T generators. By default, derives materialize implicitly in memory and .tenon/cache/gen/; use tenon gen --eject to write gen/ to disk, tenon gen --print to inspect, or TENON_STRICT_GEN=1 to require checked-in gen/ files.

Editions & bundled plugins

Edition "2026" ships a curated catalog of first-party plugins embedded directly inside the tenon binary so projects build offline:

Capabilities (explicit authority)

Tenon has no ambient I/O. Programs receive authority through explicit capability values (Cli, Fs, Net, Env, Process, Clock, Stdin, Stdout, Stderr, Traps) passed from fn main(cli: Cli) -> result<unit, CliError>:

Modern Tenon ergonomics (M26–M30)

Canonical Tenon source is readable UTF-8 (.tn). The compiler still dual-reads legacy ~1 compact syntax; convert older files with tenon fmt --migrate-utf8.

Profiling: tenon profile vs tenon build --profile

Tenon has two distinct profiling tools that serve different layers:

Command What it does When to use it
tenon profile [--dev] [path] [--json] [-- args...] Built-in runtime profiler. Compiles with runtime instrumentation (TRT_PROFILE=1, TRT_STATS=1), runs the program, and prints wall time, arena allocations/copies/peak bytes, top function hotspots, and static copy/check summaries. First stop for optimizing Tenon code, arena churn, copies, or runtime checks.
tenon build --profile / tenon run --profile Build optimization flag (mutually exclusive with --debug). Compiles native C with -g -O2 and frame pointers so external OS profilers (perf, Instruments, addr2line) can sample tn_* symbols. Native CPU flamegraphs and low-level C/kernel profiling (debugging guide).

Where to go next