TYCHO Search

Search documentation

    ↑ ↓ to move · Enter to open · Esc to close

    Tycho language reference

    How each part of Tycho behaves, with runnable examples. New here? Start with the tutorial. Curious why the language works this way? Read From malloc to arenas, then the thesis for the full argument.

    Every example compiles and prints the output shown.

    Pages

    PageCovers
    Basicsprocedures, parameters (inout), declarations and assignment, expressions and operators, control flow
    Typesthe scalar types, bytes, string interpolation, distinct type newtypes, bidirectional type inference
    Stringsa string is BYTES: len, s[i] as a byte value, byte slicing; utf8.count vs len, stepping by codepoint with the mandatory nb <= 0 guard, validating before you trust, and where core:strings and core:utf8 divide
    Arrays and slices[T], nested arrays, element places, slices xs[a:b], fixed-capacity bounded[N]T
    Structs and tuplesstruct, 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
    Subscriptsuser-defined projections: subscript … -> inout U: yield &<place>, a zero-copy view generalizing &m[k]
    Enums, options, and matchsum types, Option(T), Result(T, E), exhaustive match, or_return
    Functions and closuresfirst-class function values, closures, methods (UFCS)
    Generics$T type parameters over functions, structs, and enums
    Concurrencyspawn/wait, parallel for, channels, select
    FFIcalling C: extern fn, handles, bytes across the boundary
    Packagesmulti-file packages, import, the corelib
    Builtinsthe built-in functions, by category

    Conventions

    Before the first real program, read Quiet results — the seven places the language answers instead of refusing.