TYCHO Search

Search documentation

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

    The Tycho language specification

    Status: ratified — Tycho 0.5, maintained against the current release (0.9.2). Where the two differ, CHANGELOG.md records the change. This document is the normative contract a conforming implementation must satisfy.

    Internal links, §-labels, and section cross-references are verified mechanically. The make spec-check gate regenerates the collected grammar (Appendix A) from the defining chapters §3/§4, asserts every fixture the conformance matrix (Appendix E) cites exists, and builds and runs every runnable tycho/output example (§2.3) against its shown output.

    What this document is

    Where the reference pages teach the language by example, this document defines it by rule. On any conflict, the specification governs, and the divergence is logged in Appendix H.

    How to read it

    The files are numbered in normative reading order. Requirement keywords (MUST, SHOULD, MAY) follow RFC 2119/8174. The grammar is W3C-style EBNF over lexer-produced tokens (Tycho is indentation-sensitive; see §3).

    Contents

    #FileChaptersStatus
    —READMEindex—
    00Conventions1 Scope & conformance · 2 Notation1.0
    01Lexical structure3 Source text, tokens, indentation1.0
    02Grammar4 The phrase grammar1.0
    03Types51.0
    04Type inference61.0
    05Generics71.0
    06Conversions81.0
    07Memory & object model9 Value semantics · 10 Arenas · 11 inout1.0
    08Declarations & scoping121.0
    09Expressions131.0
    10Statements & control flow141.0
    11Functions151.0
    12Aggregates16 arrays · 17 structs/tuples · 18 maps · 19 enums/match1.0
    13Concurrency20–231.0
    14FFI24–261.0
    15Program & packages27 Program structure · 28 Packages & modules1.0
    16Builtins291.0
    17Runtime behavior301.0
    18Standard library31–33 corelib1.0
    ACollected grammarcollected EBNF (§3–§4)1.0
    BKeywordsreserved + contextual1.0
    CPrecedenceoperator table1.0
    DBuiltin indexlocator1.0
    EConformance mapclause → fixture1.0
    FImpl-defined registerunspecified + impl-defined1.0
    GGlossaryterms1.0
    HDifferencesreference-doc drift log1.0

    Conformance in one paragraph

    An implementation conforms at the core tier iff, across the conformance suite (Appendix E), it accepts exactly the programs the reference accepts, rejects exactly those it rejects, and produces byte-identical program output — for the language and the pure-Tycho + libc-only corelib. The extended tier additionally provides the deps/pkg-config corelib packages (http, crypto, compress, image, tls); an implementation MAY omit them and still conform at the core tier (§1).