The trine command (M9)
Every command, its flags, and whether it is stable (kept working, with the same meaning, in every later 1.x release; COMPATIBILITY.md) or internal (for developing Trine itself: the output can change any time). trine with no arguments prints a summary.
Flags any command accepts:
--json: diagnostics as JSON lines on standard error (AGENTS.md); stable.--locked: use only whattrine.lockpins (PACKAGES.md); stable.--edition E: the edition for files outside a package that names one (SPEC.md §6); stable.
Exit status: 0 on success; 1 on an error in the program (or a failed test); a program's own exit(n) gives n.
Programs
trine run
trine run <file.tr> [flags] [-- args...]: type-check, then run main. Stable.
- engine: by default a cached native build if there is one, else the interpreter (building natively in the background for next time);
--interp,--vm,--native [--debug]. --stats: the cost lens (calls, allocations, copies, in-place updates).- permissions (CAPABILITIES.md):
--allow-read=DIR,--allow-write=DIR,--allow-env[=NAMES],--allow-run,--allow-net[=HOSTS],--allow-python,--allow-c. - limits:
--max-steps=N,--max-time=SECONDS,--max-mem=SIZE,--max-output=SIZE.
trine check
trine check <file.tr>: type-check, print each function's inferred type and the number of tests. Stable.
trine build
trine build <file.tr> [-o exe]: a native executable (NATIVE.md). Stable. --debug (bounds re-checked, call stacks in errors), --release (-O3), --pgo (profile-guided: trains by running it once with the arguments after --), --target T (cross-compile with zig cc), --emit-c FILE.
trine test
trine test [files or dirs]: run the test "name": blocks (TESTING.md). Stable. --filter TEXT, --interp, --native.
trine repl
trine repl: definitions show their types, expressions their values. Stable.
Code
trine fmt
trine fmt <file.tr> [--check | --stdout]: format the file and its project's modules. Stable (the layout itself may get better).
trine lint
trine lint <file.tr> [--strict]: warnings; --strict exits 1 if there are any. Stable.
trine fix
trine fix <file.tr> [--apply]: the fixes for the first error, or apply them. Stable.
trine doc
trine doc <file.tr>: a Markdown reference with inferred types. Stable.
trine caps
trine caps <file.tr>: what each function can reach in the outside world (CAPABILITIES.md). Stable.
trine hints
trine hints <file.tr> [--overflow]: where native code borrows, shares, may copy and still checks bounds (EDITOR.md). The command is stable; the text of its output is internal.
trine lsp
trine lsp: the language server, on standard input and output (EDITOR.md). Stable.
Meaning and history
trine hash
trine hash <file.tr>: the content hash of every definition (HASHING.md). Stable: a definition's hash never changes.
trine store
trine store <file.tr>: record the definitions in .trine/ and show what changed. Stable.
trine semdiff
trine semdiff <old.tr> <new.tr>: what changed in meaning: renames, code changes, changes only through dependencies. Stable.
trine migrate
trine migrate [path] [--to EDITION] [--check]: move a package to an edition (the latest by default), proving every definition means the same afterwards; --check proves without writing. Stable.
Packages
trine new
trine new <dir>: a package at the latest edition: trine.toml, main.tr (with a test) and .gitignore. Stable.
trine update
trine update [names...]: re-resolve git dependencies and rewrite trine.lock (PACKAGES.md). Stable.
trine version
trine version (or --version): the compiler's version, the language version and the editions it compiles. Stable.
Internal
trine ir
trine ir <file.tr> [--naive | --no-borrow | --reuse]: the ownership IR. Internal.
trine rc
trine rc <file.tr>: reference-counting operations, naive against Perceus. Internal.
trine bounds
trine bounds <file.tr> [--smt out.smt2]: which index operations are proven in bounds. Internal.
trine tokens
trine tokens <file.tr>: the lexer's tokens. Internal.
trine fuzz
trine fuzz [--cases N] [--seed S] [--threads T] [--native] [--syntax] [--show SEED]: differential fuzzing of the engines. Internal.
trine toolchain
trine toolchain: the C compiler native builds use, or how to install one. Internal.