Repository navigation
Reference index
StefanVonRanda edited this page Jul 18, 2026
·
1 revision
Mirrored from docs/reference/index.md in the repo — that is the canonical source; edits to this wiki page are overwritten when the wiki is re-synced.
This reference catalogs every feature of the language and how it behaves. Each feature exists to stress-test the arena model in a different dimension — the thesis explains the argument; this reference documents the evidence.
Start with the thesis for why, then come here for what. Every example on every page compiles on both transpilers and produces the shown output.
| Page | Covers |
|---|---|
| Basics | procedures, parameters (inout), declarations and assignment, expressions and operators, control flow |
| Types | the scalar types, bytes, string interpolation, distinct type newtypes, bidirectional type inference |
| Arrays and slices |
[T], nested arrays, element places, slices xs[a:b]
|
| Structs and tuples |
struct, nested and recursive fields, tuples and multiple return values |
| Maps |
[K: V] for scalar and composite keys, any value type, m[k] as a place |
| Subscripts | user-defined projections: subscript … -> inout U: yield &<place>, a zero-copy view generalizing &m[k]
|
Enums, options, and match |
sum types, Option(T), Result(T, E), exhaustive match, or_return
|
| Functions and closures | first-class function values, closures, methods (UFCS) |
| Generics |
$T type parameters over functions, structs, and enums |
| Concurrency |
spawn/wait, parallel for, channels, select
|
| FFI | calling C: extern fn, handles, bytes across the boundary |
| Packages | multi-file packages, import, the corelib |
| Builtins | the built-in functions, by category |
- One way to do each thing. Tycho is kept small; where two spellings would do, only one exists. The reference says which.
-
Everything is a value. The one idea behind the whole language is that data has
value semantics: assignment, arguments, and returns copy, and the copy is deep, so
two variables never share storage. Each page says how this plays out for its types
instead of restating the principle; the thesis explains the claim
and the evidence (no GC, no
free, no data races on owned values). - Examples are real. Every code sample compiles and runs under both the C reference transpiler and the self-hosted transpiler — the language has two implementations that must agree (see The evidence). Output shown in a comment is the actual output.
The reader docs here are mirrored from /docs in the repo — the canonical source. · tycho-lang.com · MIT licensed
- Tutorial
- The Tycho thesis: value semantics makes implicit arenas work
- Architecture & project status
- From
mallocto implicit arenas
- Tycho language reference
- Basics
- Types
- Functions and closures
- Structs and tuples
- Enums, options, and
match - Arrays and slices
- Subscripts (user-defined projections)
- Maps
- Generics
- Concurrency
- FFI (calling C)
- Packages
- Builtins
- Memory model in the self-hosted compiler
- Tycho aggregates: arrays & structs under value semantics
- Maps with arbitrary value types
m[k]as a place: in-place map-value mutation- Generics (monomorphized)
- Concurrency in Tycho
- FFI — calling C from Tycho
- Packages & modules
- corelib — Tycho's standard library
- Performance: the self-hosted transpiler vs the C one
- Debugging generated C