Settled decisions

Every language and project decision made so far, in one terse list — settled and open.

This page is the single record of decisions. A chapter of this specification elaborates each one; when a decision changes, this page and the chapter change together.

Settled

Identity and direction

  • Avin is a natively compiled, garbage-collected application language with a deliberately small type system, a rich standard library and ergonomic syntax.
  • Its type system, runtime and library are designed together: see design choices.
  • Syntax stays very close to Sysl. Where Sysl has no form, this specification defines one in the same style.
  • Execution speed is a primary goal.
  • Programs are multi-threaded: threads run in parallel and share one garbage-collected heap.
  • Typing is nominal. Classes instantiate objects; there are no duck-typed objects.
  • Inference is a useful approximation of Hindley–Milner, not full HM: see inference.
  • A call’s type argument that nothing at the call decides stays open until the end of the enclosing function body, settled by the first later use that needs it (a branch it joins, a store, a use as a value of a known type). If nothing settles it, it is Nothing where the call names it only where a value is read out (settled 2026-11-04, below), and an error at the call otherwise.
  • The compiler is written in Sysl. Self-hosting is optional.
  • The standard library is written in Avin. Sysl is reached through bindings written in Avin, which the compiler turns into shims that Sysl checks. The runtime is written in Sysl.
  • The domain is avinlang.dev. Compiler modules use dev.avinlang.compiler, and the standard library uses the reserved root avin. A library the project publishes outside the core library is a package in its own repository of the avin-lang organization, with modules under dev.avinlang: parser combinators are github.com/avin-lang/parsing, module dev.avinlang.parsing, written as literate Avin.
  • Building the Kutter video editor natively is a long-term application goal.
  • Sysl’s Ada-inspired features (contracts and the like) are a long-term direction.

Syntax

  • Functions and function types use ->, never =>.
  • match is postfix, with indented pattern -> body arms.
  • data declares algebraic data types.
  • Classes are final unless declared open or abstract; overriding requires override.
  • Inheritance is written with :: class C(…): Base(…), Trait, one superclass with its constructor arguments and then traits, as in trait A: B.
  • The receiver is implicit: members are in scope by their bare names, and self names the instance.
  • Any method taking one argument can be called infix, a max b for a.max(b), at the caller’s choice: there is no annotation that permits or forbids it. There is no postfix form.
  • An infix call names a method of its receiver’s type, resolved as the dotted call is; it never falls back to a function m(a, b), and a method of two parameters is not called infix with a tuple. It stays on one line unless the line ends with the method’s name, and then the argument is the indented block below. Keywords such as then, do, is and match never name the method.
  • A subclass’s constructor evaluates the superclass’s arguments, runs the superclass’s body on the object, then stores its own parameters and runs its own body. The superclass’s arguments cannot call a method or use self; a parameter’s name in them reads the argument.
  • A subclass’s fields are its superclass’s, in order, then its own. Fields are never overridden.
  • Only public methods can be overridden. An override takes the same parameter types and yields the same result or a type seen as it with no conversion (covariant results; see the Proposed entry on override results below). An override cannot be private. A method with type parameters of its own is overridden by one declaring as many, matched by position (bounds, once they exist, must match too).
  • An abstract method is a method without a body, allowed only in an abstract class; an abstract class cannot be instantiated, and every concrete subclass implements each abstract method.
  • A call through a receiver whose static type is an open or abstract class reaches the override of the object’s class; a call through a final class’s type, and super.m(), are direct.
  • if and match branches yielding different classes join to their nearest common superclass; where they have none, to the expected type when both conform to it, such as a trait.
  • A class implementing a trait’s method marks it override, whether the trait’s method is abstract or has a default body, as an override of a superclass’s method is marked. A trait’s methods are public. A trait may override a default of a trait it requires, marked override and with a body; in every type conforming to it, its body replaces the default. Redeclaring a required trait’s method without override is an error.
  • A class conforms to a trait once: two different type argument lists for one trait, reached by any paths, are an error. A trait’s own default bodies count as inherited implementations, so a superclass’s method and a trait’s default of one name, or two traits’ defaults, must be overridden.
  • A trait-typed call reaches the implementation through the class’s method table, at a position the trait has in every conforming class’s table (the whole program is known), so it costs one virtual call.
  • A trait’s abstract val name: T is supplied by a public field of that name of each conforming type: a class’s val or var field, own or inherited, or a one-variant data type’s field through an impl. A var field satisfies a val; a method or a private field does not. Read through the trait it is a method table entry the compiler fills with a method that loads the field; read through a class type it is the field. It is never assigned through the trait.
  • Traits may hold state (settled, user, 2026-11-04). A trait declares a field with a value, val name: T = expr or var name: T = expr, and every class and object conforming to it stores one of its own. Through the class’s type it is the class’s field; through the trait, or a type parameter the trait bounds, it is read and assigned through method table entries the compiler fills with a method that loads or stores the class’s field. Construction runs the superclass first, then stores the class’s parameters, then computes the fields of the traits the superclass does not already conform to, a trait’s required traits before it and each trait once, in the order of the : list, then runs the class body. A trait’s field’s value may read the fields initialized before it and uses self for nothing else. Only a class or an object conforms to a trait holding state, or requiring one that does: an impl of it for a data type, a built-in type or a tuple is an error. A class declaring a field of a trait field’s name, or conforming to two traits that declare fields of one name, is an error.
  • A trait may re-declare a method of a trait it requires without a body, marked override, with a narrower result (settled, user, 2026-11-04): trait SortedMap[K, +V]: Map[K, V] re-declares override updated[W >: V](key: K, value: W) -> SortedMap[K, W], so a call through the sub-trait yields the sub-trait. The re-declaration takes the same parameters, type parameters and lower bounds and yields a result conforming to the overridden one, and shares its position in the method table, so one implementation serves both traits and must yield the narrowest result. Re-declaring a method that has a default makes it abstract again in the sub-trait: its implementers give their own. Declarations.
  • An object may extend an open or abstract class, constructed from the top down as a subclass is, overriding its methods and conforming to it; it implements every abstract member it inherits.
  • A trait’s method, or an overridable class method, may have type parameters of its own and be called dynamically. The whole program is known, so each list of its own type arguments that a call through a table uses gets a slot of its own in the table of every type implementing the method, filled with that type’s implementation instantiated at those arguments; such a call also costs one virtual call.
  • An impl adds methods and conformances, never state. Written in a class’s or an object’s module, its methods are the class’s own; for a data or built-in type, or written elsewhere, they are called directly. Inside them the receiver is implicit, as in a class, with a one-variant data type’s fields in scope by bare name.
  • The methods of impl Trait for Type implement the trait’s methods without override, and each is a method of the trait or of one it requires. A data type’s method implementing a trait method is declared in an impl of that trait.
  • A data type conforming to a trait gives every variant’s descriptor the same method table, at the trait positions classes use, so a trait-typed call costs the same whatever the value is.
  • A generic impl of a trait writes the type’s parameters, in order, as its own: impl[T] Show for Box[T]. An impl without for may also name a type built from its parameters (settled 2026-11-04, below).
  • Settled 2026-11-03: bounds are traits or classes, written [T: A & B] (spelled + until the intersection-bounds entry under Proposed made & the one spelling). A value of a bounded T has its bounds’ methods, vals and visible fields, and is a value of each bound’s type; type arguments are held to their bounds where written and where inferred, and a bound’s own type arguments are inferred from the argument. A call through a bound is direct in each instance, and goes through the method table only where the type argument is a trait type or an open class. An impl’s type parameters take its type’s bounds and write none of their own.
  • Settled 2026-11-03: Self is written only in a trait’s methods and names the implementing type; a trait mentioning it, itself or through a trait it requires, is only a bound. In its default bodies self is a Self. A trait type is a type argument for its own bound when it does not mention Self.
  • Settled 2026-11-04 (user): polymorphic recursion, a cycle of generic code whose type arguments grow on every round, is a compile-time error naming the cycle, through functions, methods, local functions, lambdas and calls through traits and bounds alike; recursion whose type arguments do not grow is legal. Checking never runs without end on it.
  • Variance applies only where both type arguments are reference types, so it never converts: List[string] is a List[Any], List[int] is not. Tuple parts and function results are covariant and function parameters contravariant on the same terms.
  • A variance error is reported in private members as in public ones; there is no escape for a private var. The methods an impl adds to a data type are not variance positions; the traits its impls name are, except a trait whose members are all static (revised 2026-11-19, below).
  • Settled on the user’s delegation 2026-11-19 (branch static-traits): static members are not variance positions of a class or data type, and neither is a conformance to a trait whose members are all static (with those of the traits it requires, at least one); the entry above read “the traits its impls name are” without exception, which refused abstract class Vector[+T] stating impl[T] Buildable[T] for Vector[T] with static newBuilder() -> Builder[T, Vector[T]]. Why it is sound: a static member is reached through a type, never a value. On the type, the call names the arguments (Vector[Animal].newBuilder() is that instance’s own impl); through a bound C: Buildable[A], C‘s own impl at C‘s own arguments runs, and a Vector[Cat] is a Buildable[Cat], not a Buildable[Animal], so build[Vector[Cat], Animal](dog) is refused. No value of the trait exists (a trait with a static member is a bound, not a type), so no value path from Vector[Cat] to Buildable[Animal] exists either. The one path left is a type parameter bounded by a widened instance, U: Box[Animal] with U = Box[Cat]: a bound whose class or data type has a covariant or contravariant parameter reaches neither the type’s static members nor its conformances to all-static traits (U.make(dog) is an error saying to bound U by the trait). Kept as positions: a trait’s own static members (a type conforming to Take[Cat] conforms to Take[Animal] through the trait’s variance, so trait Take[+A] with static take(x: A) is refused), a trait requiring an all-static trait, and a conformance to a trait with any member of a value. Alternatives: exempting every trait’s statics (unsound as shown); exempting only impl statics and not the trait argument (still refuses Buildable[T] on Vector[+T]); refusing static calls through every class bound (narrower than needed: an invariant class’s bound widens nothing). Tests: static_trait_variance, static_trait_variance_attacks, static_trait_variance_kept, programs/run/static_trait_modules. Review with the user: the widening-bound rule is new and visible (“bound U by the trait declaring make“).
  • Settled on the user’s delegation 2026-11-19 (branch static-traits): a trait type may implement a trait whose members are all static, as its own conformance: impl[A] Buildable[A] for Set[A]. It holds of the trait type itself, as the type a call names (Set[int].newBuilder()) or a bound’s argument, and is not inherited by the trait’s implementers (a HashSet[A] has its own or none) nor reached through a type parameter bounded by the trait type, whose argument may be any implementer. An impl of a trait with a member of a value for a trait type is still refused with the old message. Why: a collection literal typed by a trait (val s: Set[int] = {1, 2}) needs a builder the trait type names, and a trait’s conformance cannot be its implementers’ (each builds its own collection). It is built on the impls for instances of a type, matched against the trait type exactly rather than through its subtypes. Alternatives: inheriting it (wrong: HashSet‘s literal would build through Set‘s builder); a companion object’s newBuilder reached by name (the convention Buildable replaces). Tests: trait_own_static_conformance, trait_own_static_refusals, programs/run/static_trait_modules.
  • A type pattern matches an object whose type conforms to the pattern’s type through variance, as the checker’s subtyping does: a List[Dog] held as an Any matches List[Animal].
  • Settled by the user 2026-11-04: lower bounds on a function’s or a method’s own type parameters, written first: [W >: T], [W >: T: Display]. A lower bound is a covariant position, so a covariant trait declares put[W >: V](key: K, value: W) -> Bag[K, W] as a virtual method; impl methods that are not variance positions are no longer the only way a covariant type takes its parameter in. A value of the bound is one of the parameter with no conversion, so a type argument is the bound or a reference type it is seen as. A call infers the join of the bound and the arguments, Any where they are references with no nearer common type; a written or expected type argument is held to the bound (the expected type’s part is refined, proposed below). An override writes its method’s lower bound or none. A type’s and an impl’s parameters take none.
  • The built-in types belong to the core library’s module, avin; a conformance of one is written there or in the trait’s module. An impl that only adds methods may be written in any module (settled 2026-11-04, below).
  • Functions and methods may be overloaded by parameter types. A call takes the most specific overload that accepts its arguments, chosen at compile time; an ambiguous call is an error. Same-named declarations with the same parameter types are an error.
  • Overloads are the functions of one name in one scope. A block’s local functions of a name hide every outer function of that name, whatever their parameter types, and a program’s own top-level functions hide the prelude’s of the same name.
  • A local value (val, var or a pattern binding) and a local function of the same block may not share a name, whichever is written first (settled, user, 2026-11-04). In a nested block, a lambda or as a parameter of the enclosing function, a local may hide an outer local function like any outer name (settled, user, 2026-11-04).
  • Generic local functions (declarations): a local function’s type parameters follow the enclosing ones it shares, which its calls never write, so pair[int](1) writes only pair‘s own. A local function’s type parameter may not take the name of one already in scope rather than hiding it. Written type arguments and those an expected type gives a generic function used as a value are held to its bounds, as a call’s are (settled, user, 2026-11-04).
  • Choosing an overload tries integer literals and lambdas against each candidate’s parameter; every other argument is checked once on its own, and only its type is tried. A literal fits any parameter that can hold it.
  • An integer literal prefers its own type, int (or long for a literal too large for int), when that is all that separates the overloads: f(1) with f(int) and f(long), or with f(int) and f(real), calls f(int). This applies only where no overload is the most specific, and only to an overload that is also the most specific by the arguments that are not literals; f(1) with f(long) and f(real) stays ambiguous, and a generic f[T](x: T) loses to f(x: long) by specificity before any literal rule applies.
  • A method named without a call, account.deposit, is a function value bound to its receiver: a closure holding account, of the method’s type without the receiver. Inside the class, a bare method name is the same closure over self. This holds for a method declared with a parameter list, () included; a method declared with none (settled by the user 2026-11-12, below) is called by its name and has no method value. One declared with an empty list () is a value only where a function type is expected (Proposed 2026-11-12, below).
  • Settled 2026-11-03: a method value evaluates its receiver once, where the value is made. Through a trait-typed or open-class receiver it calls the implementation the object’s class has, through the object’s method table at each call; the object is fixed, so this is the implementation it had when the value was made. The class’s type arguments come from the receiver’s type; a method’s own are written (box.pair[bool]) or decided by the expected function type, and one left undecided is an error. A method value takes every parameter, by-name ones still by name, and private methods are values only where they could be called. Two values of one method on one object are two closures, so === tells them apart.
  • Settled 2026-11-03: loop is a statement that repeats its indented body (or loop do body on one line) until a break or return leaves it. loop is a keyword.
  • Settled 2026-11-03: do … while tests at the end, so its body runs at least once. The body is an indented block closed by a line starting while test, or one statement written do stmt while test; an optional else runs when the test fails. break carries the loop’s value as in while, continue runs the test, and the test cannot read names the body declared.
  • string is a built-in type, not a class: it is final, has its own representation, gets its methods from the library through impl string, conforms to traits through impl, and is matched by the type pattern s: string like any other type.
  • Settled 2026-11-03: the library’s string methods are byteLength, charCount, isEmpty, nonEmpty, startsWith, endsWith, contains, slice, toUpper, toLower (named toUpperCase and toLowerCase until the Proposed entry on one family of case names), trim, strip, stripLeading, stripTrailing, repeat, replace and padTo beside padStart and padEnd, with the reference library’s names (user, 2026-11-04), and, with the reference’s names and behaviour (user, 2026-11-04), stripPrefix, stripSuffix, capitalize (only a lower-case first character changes), stripMargin with the bar or a given margin character (the characters up to U+0020 and the margin removed from each line’s start, the terminators kept), and head, last, headOption and lastOption of the characters, head and last trapping on the empty string. A slice traps at its call when its offsets are out of order or outside the string, or either falls inside a character; repeat traps on a negative count. Casing is the simple mapping, one character for one; stripping removes Unicode White_Space, and trim, as the reference’s, the characters up to U+0020; replace replaces every occurrence, left to right and not overlapping, and an empty pattern occurs nowhere. Methods yielding a collection or iterator (split, chars, bytes) wait for the collections.
  • Settled 2026-11-03: a built-in type’s impl in the core library may declare a method as an @intrinsic, whose type takes the receiver first.
  • Settled 2026-11-03, the searches revised 2026-11-04 by the user: indexOf (with an optional starting offset), lastIndexOf (with an optional last offset), indexWhere (with an optional starting offset) and lastIndexWhere answer a byte offset, -1 when there is none, as the reference library’s do, and so do a sequence’s indexOf, indexWhere, lastIndexOf and lastIndexWhere, each with the same optional bound; a string’s indexOf and lastIndexOf take a char as well as a string. Offsets are bytes. A number is read whole: toInt and toLong take an optional + or - and ASCII digits, so "+3" is 3 and "-0" is 0, and refuse white space, separators and overflow ("-9223372036854775808" is a long); toReal is correctly rounded, takes decimal only, and refuses white space, nan, inf, hexadecimal and a value too large to be finite. Revised 2026-11-04 by the user to the reference library’s: toInt, toLong and toReal answer the number and trap on a refusal with For input string: "…", and toIntOption, toLongOption and toRealOption answer None for it.
  • Settled 2026-11-04: the core library follows the reference language’s library in names and behaviour unless it genuinely improves on it. Option has isDefined, isEmpty and nonEmpty (not isSome/isNone), get (trapping on None) and filterNot; there is no orNull, since there is no null. char has isDigit, isLetter, isLetterOrDigit, isWhitespace, isSpaceChar, isUpper, isLower, isControl, toUpper, toLower and asDigit, classifying by the Unicode Character Database. isWhitespace is true for the space separators except the non-breaking ones (U+00A0, U+2007, U+202F) and for U+0009 to U+000D and U+001C to U+001F, so it differs from strip‘s White_Space; isSpaceChar is the categories Zs, Zl and Zp. asDigit is the digit’s value in radix 36 (Unicode decimal digits give their value, ASCII and fullwidth letters give 10 to 35) and is -1 for any other character, never a trap.
  • Settled by the user 2026-11-04 (collections): Map[K, +V] and Set[A] are traits, as in the reference library. The hash-based collections are HashMap and HashSet; TreeMap and TreeSet conform to SortedMap[K, +V] and SortedSet[A], which require Map and Set and re-declare the updating methods with the sorted result. Map and set literals, Map(…), Set(…), Map.empty, Set.empty and the two builders make the hash-based ones, typed as the traits; SortedMap and SortedSet companions, and a literal where one is expected, make tree ones. A method putting a value in takes [W >: V]. An update through a trait answers the same kind; map, collect and flatMap through the trait answer a hash-based collection. Maps and sets of different kinds with equal contents are equal, through the traits and Any, and hash alike. A map has no mkString of its own: it joins its entries as pairs, (a, 1), through Iterable‘s. The ordered operations take the reference library’s names (user, 2026-11-04): headOption and lastOption, head, last, firstKey and lastKey (trapping when empty), minAfter(k) (the least at least k), maxBefore(k) (the greatest less than k), rangeFrom and rangeTo (inclusive), rangeUntil (exclusive), range (from inclusive, until exclusive), iteratorFrom (and a map’s keysIteratorFrom and valuesIteratorFrom), and reverseIterator, which the reference’s sorted collections lack and which is kept; the tree is balanced by weight, each side at most three times the other.
  • Settled by the user 2026-11-04: the elementary functions are a module, avin.math (system library), with the reference library’s names, called as math.sqrt(x) after import avin.math or imported by name: Pi and E; sqrt, cbrt, exp, expm1, log (natural), log10, log1p, pow, hypot; sin, cos, tan, asin, acos, atan, atan2(y, x), sinh, cosh, tanh; floor, ceil, rint (ties to even), abs, max, min (NaN when either is, -0.0 below 0.0), signum, toRadians and toDegrees. All take and give real, follow IEEE 754 and never trap: sqrt(-1.0) is NaN, log(0.0) negative infinity. Not methods on real. Settled on the user’s delegation 2026-11-19: abs, max, min and signum also have int and long overloads (the only functions here with an integer meaning; math.abs(int.MinValue) traps as a negation does, and math.max(1, n) on an int n calls the int one), written in Avin; the generic max/min/clamp of ordering stay for other types and the several-argument form. A call no overload accepts already names every overload (no overload of math.max accepts these arguments; the overloads are …); the two contradictory “expected” errors came from real being the only candidate. Branch math-int-overloads. The reference’s round, which answers a long, is left out until real-to-integer rounding is decided with the conversions. Bindings: one runtime function per function, over the methods of Sysl’s Float on real, since a binding names a function and these are methods.
  • A generic overload is compared by the same rule as any other: f(x: int) is more specific than f[T](x: T), which accepts an int while f(int) does not accept a T.
  • Whether a parameter is by-name does not distinguish overloads. An argument some candidate takes by name is delayed; an overload that takes it strictly evaluates it once, at the call.
  • An overloaded function used as a value needs an expected function type, which chooses the overload. main cannot be overloaded.
  • Methods overload by the same rules, among the methods of a name the receiver’s static type has, inherited ones included. A method is identified by its name and parameter types: an override, a trait implementation and a method table position each match by both, so a subclass overrides one overload and inherits the others. override matching no inherited parameter types is an error.
  • A clause is a line of the function’s name and arguments followed by =, a guard or indented guards; a line of the same name followed by -> or nothing is another declaration, so two abstract overloads may follow each other.
  • A class’s parameter list is its one constructor. Class parameters are private immutable fields (val makes one public and read-only, var public and mutable), and the statements in the class body are the constructor’s code, run top to bottom when an instance is created.
  • Inside a class, a local, a parameter or a local function hides a member of the same name, and a member hides a top-level declaration; self.name always reaches the member. In the class body, a class parameter’s name is its field, so it reads what an assignment to a var stored.
  • A private member is private to its class, not to one instance: the class’s constructor and methods, with the lambdas and local functions in them, may use it on any instance of the class.
  • A class body cannot return. A field declared in the body without a type has its initializer’s.
  • Initialization is checked at compile time. Through the last field’s initializer, a class or object body uses self only to read a field already set and to assign a field: a method call in any spelling (bare name, self.m(), super.m()), passing, storing or returning self, a method value of self, and a lambda or local function using a field or self are errors. An open or abstract class’s body runs before its subclasses’ fields are set, so the limits hold for the whole of it, and it never calls a method a subclass may override.
  • An object is made once, before main; its name is a value of its own type and cannot be called. It shares its name only with its companion class, whose constructor the name is in call position, while the bare name and Name.member are the companion.
  • Module-level vals, vars and objects initialize before main, each after the values its initializer reads directly or through the functions it calls, the rest in declaration order; a cycle is a compile error naming the chain.
  • Every function declaration parameter has an explicit type.
  • A default argument is evaluated at each call that omits it, in the declaring function’s scope, and may use the parameters before it. Named arguments follow the positional ones, in any order; the arguments written at a call are evaluated in the order written, then the omitted ones’ defaults in parameter order. Names and defaults belong to a declaration: a function value is called by position. A variant takes its fields by name too. The default of a by-name parameter is delayed like any argument to it.
  • Settled 2026-11-03: methods and class constructors take defaults as functions do. A method’s default sees self, the receiver’s members and the parameters before it; a constructor’s sees the parameters before it and no self. Defaults belong to the method that introduces the parameter: an override, and a method implementing a trait’s, takes them and may not declare its own, so a call’s defaults are the same whichever class’s method runs. A trait method’s defaults apply through the trait’s type. A method of one required parameter and defaults may be called infix.
  • A function may be defined by clauses: its signature with no body, then lines f(patterns) = body, tried in order. A clause is guarded inline, f(n) | n > 0 = body, or by an indented block of | condition = body lines in which | _ always holds; when every guard fails, the next clause is tried. Clauses must cover every argument, and a clause counts toward that only through an unguarded body.
  • Comparison patterns bind a name or _ beside one literal bound or between two (n < 0, 0 <= n < 10), and n + k matches an integer of at least the positive literal k, binding the value minus k. Both go wherever a pattern does, on integers (comparisons also on bytes and chars), and they count toward exhaustiveness, as literals and ranges do.
  • Variadic parameters are written values: T*; by-name parameters are written value: -> T, with no memoization.
  • Blocks yield their last expression. if, while and loop values follow Sysl.
  • All of Sysl’s operators are supported, including comparison chains.
  • Built-in types are lowercase (int, bool, string, unit, char, real, iN, byte); other types are PascalCase; functions and methods are lowerCamelCase. These are conventions, not syntax rules.
  • int is i32 and long is i64; they are the only integer aliases. Signed integers of any fixed width are available. There are no unsigned integer types. real is binary64, and there is no single-precision type. char is a Unicode scalar.
  • byte is an octet (0–255) for binary data, with bitwise operations and no arithmetic.
  • Integer overflow traps. +%, -%, *% wrap and +|, -|, *| saturate, explicitly.
  • A sequence is indexed by calling it: xs(i), and xs(i) = v to assign. Sequences implement function types, and any library type can implement a function type through apply.
  • [1, 2] is an immutable Vector, {1, 2} a Set and {"a": 1} a Map, unless the expected type asks for another collection (val b: Buffer[int] = [1, 2]), which the literal then builds. {a: 1} means {"a": 1}. {} is the empty Set and Map.empty the empty Map.
  • x :: xs prepends to an immutable List, and head :: tail is a list pattern, for recursive list code. :: is right-associative.
  • Settled 2026-11-03: List[+T] is the core library’s data type with variants Cons(first, rest) and Nil. :: and list patterns always mean the core library’s List, whatever List, Cons or Nil name where they are written. Every List method loops rather than recursing, so no length deepens the stack, and lists compare and hash by contents and order lexicographically when their elements are ordered.
  • Sequences are matched with the brackets that build them: [] matches any empty sequence and [a, b] any sequence of exactly two elements.
  • Buffer is the only growable mutable sequence, and Deque the mutable sequence for both ends. There is no mutable list type: every collection has a builder, through one library trait, and List‘s builder appends in constant time and yields an immutable List.
  • .. and ..< expressions construct iterable Range values.
  • An array is made with every element set, by Array.fill(n, value), Array.tabulate(n, f), Array.empty() or Array(a, b, c) (see “A collection is made by naming its type and listing its elements” below); Avin has no null, so no array holds an unset element. xs(i) calls xs.apply(i), xs(i) = v calls xs.update(i, v), and the compound, := and ++ forms evaluate xs and i once. A call with untyped arguments before = is an assignment, so a local function’s declaration types its parameters or has none.
  • A range’s step is set with by; a step of zero traps, and iteration never steps past the limit or the type’s largest or smallest value.
  • A for with yield is comprehension sugar over map, flatMap and filtering; a for without yield loops over the source’s iterator.
  • The collection hierarchy is rooted at Iterable, and Iterator is itself Iterable.
  • print and println are ordinary library functions (settled 2026-11-04). Both take any values, shown as interpolation shows an Any (below), and separate several with , , which is not a tuple; println ends with a newline and print does not. print() writes nothing and println() writes a bare newline; eprint and eprintln are the same for standard error. println(debug(x)) selects Debug.
  • debug(x) yields x‘s Debug form as a string. Writer writes strings (with writeChar, writeInt, writeField and writeSpaces beside write); FormatSpec is width, precision and left; toString() is a default body of Display.
  • Settled 2026-11-04 (user): a value of Any or of any trait is shown by the type it has at run time. Any and every trait meet Display and Debug whatever they declare, as every type meets Eq: such a value meets those bounds, has display, debug and toString() and is interpolated, and renders through its own type’s implementation, found through its type record, so Seq[int] prints as the vector it holds. It does not convert to Display or Debug as a value, so a value of either trait holds only objects that implement it, and is still shown through its method table. A type with no implementation of its own renders as its name (Cat, Box[int]; a function value <function>), never an address. Static types keep their rule: a class or data type needs its own Display to meet the bound or be interpolated, a type parameter its bound’s. A trait takes no impl of Display or Debug: its values are shown by their own types, which keeps one rule.
  • Settled 2026-11-04 (user): print, println, eprint and eprintln are each ONE ordinary library function taking values: Any*, with no other overloads, and the compiler treats them as it treats any function: none, one or several values, several separated by , . println(1, pet, xs) with pet: Pet and xs: Seq[int], a function value and a class with no Display all print, each shown as that Any is in an interpolated string (by its type’s own Display, or its name). A sequence is one value; only xs* spreads it, as for any repeated parameter, and then only a sequence of Any or of references. As a value println is a (Vector[Any]) -> unit. The cost is stated plainly: a program that prints through them boxes every number, char, bool and unit argument, makes a vector of the arguments, and gives every type record its rendering entry, since any value may reach Any‘s rendering; a string or an object is passed as it is. A program that wants none of that writes to StandardOutput through a Display bound.
  • A built-in type conforms to a trait through an impl and implements every method of the trait, since a trait’s default bodies are shared by objects and a built-in value is not one.
  • A variant’s fields take defaults, each a function of the fields before it, as a constructor’s parameters do.
  • Avin has Sysl’s full string interpolation and formatting.
  • An interpolated string is a method call on StringContext: p"a $x b" is StringContext(["a ", " b"]).p(x). s, f and raw are library methods, and a program defines its own interpolator by implementing a trait for StringContext.
  • A user-defined interpolator is visible where it is imported (settled by the user, 2026-11-04): in the module that declares it, in a file importing that module whole, and in a file importing one of its declarations by name. s, f and raw need no import. A module that merely imports another does not pass its interpolators on, and using one that is not in scope is an error naming the module to import.
  • Interpolated literals follow Scala’s lexing (settled 2026-11-04). A backslash and a " or \ after it are skipped as a pair, so raw"a\"b" holds a\"b, raw"a\" is unterminated and raw"a\\" ends, holding two backslashes; $" is a double quote and $$ a dollar sign in every interpolator. The lexer reads no escape: a part reaches StringContext as written, and only s and f process escapes, so p"\d" is fine and s"\d" is an error. A backslash is otherwise an ordinary character (raw"C:\dir", \$name still interpolates).
  • Nested helper functions see their enclosing scope. Closures are full closures, and return inside a lambda is local to the lambda.
  • match is a value-producing expression with full destructuring.
  • A tuple needs no parentheses where it fills the rest of a line: = a, b, return a, b, a block’s line. Bindings take tuples apart (val q, r = divmod(n, d)), and a, b = b, a is a multiple assignment: a statement that makes the whole right side before storing anything, with compound forms that read every place first. Its places are var locals, var fields and module-level vars, each field’s object evaluated before anything else.
  • Inside brackets whose commas separate items (call arguments, tuple and collection literals), a return or break value stops at the comma, so f(a = return 1, b = 2) has two arguments; a parenthesised return 1, 2 is two tuple items, and return (1, 2) returns a tuple. An indented block inside the brackets starts a line again, up to a last line that closes the brackets, whose comma ends the block; a one-line lambda body never takes a comma list.
  • Actors are built into the language: actor declares one.
  • State machines are built into the language: machine declares one, and state declares each of its states.
  • Slate’s dal is not part of Avin.
  • Any holds a value of any type. A value converts to it at a single site (an argument, a binding, an assignment, a field, a result, a tuple part written out, a branch expected to yield one), never inside a container. A string, a tuple and a data value need no box, being objects whose header names their type; numbers, char, bool and unit are boxed.
  • A type pattern x: T matches a value whose run-time type is T, a subclass of it or a class conforming to it, with type arguments compared exactly. One that can never match is an error; one covers only where the matched value’s type already conforms to T. In a clause a type pattern naming the parameter’s own type is an error.
  • Every type has == and a hash. Built-in types, strings, tuples and data compare and hash by value; class instances, objects and closures by identity, which always agree, until the class implements or derives Eq. derives Eq, Hash gives both from the same fields; implementing one of == and the hash without the other is an error. Keeping a hand-written pair consistent is the programmer’s responsibility.
  • == between two values whose static types share no common type is a compile error. On Any and on trait-typed values == is decided at run time through the type’s entries: values of different run-time types are unequal. === stays defined only on reference types; where it meets an Any, a trait or a type parameter, see the identity entry settled on 2026-11-05.
  • Settled 2026-11-03: the operator traits are the core library’s Eq (equals(other: Self) -> bool), Hash (hash() -> long), Ord: Eq (compare(other: Self) -> int, with less, lessOrEqual, greater and greaterOrEqual defaulting from it), and Add, Sub, Mul, Div, Rem (add, subtract, multiply, divide, remainder, each (other: Self) -> Self) and Neg (negate() -> Self). Every type conforms to Eq and Hash implicitly; == on a type parameter still needs a bound that is or requires Eq. The built-in types implement the traits their operators have, in the core library, and an operator on a built-in type is the machine’s operation, in generic instances too.
  • Settled 2026-11-03: an impl of a trait may bound the type’s parameters further (impl[T: Ord] Ord for Box[T]), making the type conform only for type arguments meeting them; on data types and classes, for any trait.
  • Settled 2026-11-03: a conformance through such an impl to a trait that is also a type holds wherever one is decided: at conversions (as a covariant type argument too), in type patterns, and for calls of the trait’s methods, which an instance missing the bounds does not have.
  • Settled 2026-11-03: a generic type’s derived Ord, Display and Debug are impls bounding each parameter by the trait, so they hold where the type arguments implement it.
  • Settled 2026-11-03: arrays compare and hash by contents (=== stays identity); arrays and lists display as [1, 2, 3], their Debug as ["a", "b"], each only when the elements do.
  • Settled 2026-11-03: derives takes Eq, Hash, Ord, Display and Debug. A class derives from its constructor parameters, plain, val and var alike, and not from fields its body declares; a data type from each variant’s fields. A class derives Eq and Hash together, and Ord only with an Eq by the same fields, derived or its own; a data type has both already, so deriving them there changes nothing. Display writes Name(a, b), each field in its own Display form, and a variant without fields as its name; Debug writes the same shape with each field’s Debug, so strings inside are quoted. A width pads the whole. Deriving a trait the type also implements, or one a field’s type does not implement, is an error naming the field. A generic data type’s derived Ord holds for the type arguments that are ordered; deriving Display or Debug on a generic type, and Ord on a generic class, needs the parameters bounded by the trait where the type declares them.
  • Settled 2026-11-03: every data type has Display and Debug without derives, where its fields have them, conditional on its type arguments as a derived one is; derives Display, Debug on a data type means the same. An impl of the type’s own replaces the automatic one, with no conflict. A field without the trait leaves the type without it, which is an error only where a use needs it, naming the field. A program that never shows a value compiles none of this code. What derives and the automatic impls name are the core library’s traits, whatever the module declares or imports under the same names.
  • x.equals(y) and x.hash() may be called on a value of any type parameter, bounded or not.
  • Settled 2026-11-03: a type argument a call’s arguments decide is the join of the types they give it where a value is read out, as two branches’ types are joined; the first argument does not decide it alone, so cat :: dogs is a List[Animal] with nothing expected. An expected type decides it first; an invariant or contravariant use decides it for good. Two classes with no common superclass join to the one trait they share that every other trait they share is a parent of; sharing several unrelated traits is no join, an error naming them, rather than a choice among them. The same holds for branches.
  • Settled 2026-11-03: the names an is pattern binds are in scope where its test is known to have matched: the then branch of an if, the body of a while, the right operand of &&, and for is not the else branches and the right operand of ||, with ! swapping the two. After an if whose one branch never finishes, the rest of the block sees the other branch’s names. a is P(v) || b is P(v) binds no v for the whole. A condition binds a name once, and its names may shadow the enclosing block’s.
  • Settled by the user 2026-11-09: data updates are written with { … } with field paths (Changing fields): p with { pos.x = 3, name = "a" } is a new value of p‘s type, each named field replaced and every other one p‘s; a path rebuilds only the values along it, a shared prefix once. Paths go through data fields only; a method is never named; a path named twice, or a field beside a path inside it, is an error; an index is a syntax error suggesting the whole field; values are read against the leaf field’s type; the base is evaluated first, then the values left to right; an unknown field is reported with the nearest one. with is a keyword only after an operand and before {, binding as a postfix tail.
  • Settled by the user 2026-11-09 (“union types are great”): limited union types (union types). (1) A union A | B is written only in annotations: parameters, results, vals, fields, type arguments and aliases (type Num = int | long). (2) It is never inferred: the branches of an if or a match join as before. (3) It compiles to an anonymous tagged sum. (4) match takes it apart by type pattern, exhaustively: a member left uncovered is an error, and _ is allowed. (5) ? combines distinct error types into a union: a function returning Result[T, IoError | ParseError] may ? a Result[_, IoError] and a Result[_, ParseError]. Intersection types stay deferred. The further rules are under Proposed.

Project and tooling

  • A project lists packages; a package has an avin.hocon manifest; a module is a directory.
  • A program’s root is a directory, and each directory under it is a module named by its path from the root (a/b is a.b). The root directory’s own files are the root module, which has no name and holds main; they take no header. Every other file begins with module a.b, naming the module its directory makes it part of. A program of one file is compiled alone, and its header, if any, names its module.
  • A module’s files share one namespace: what one declares, every other sees by its bare name, its private declarations included. Another module’s declarations are reached only by importing them, per file: import a.b.X, import a.b.{X, y as z}. There is no wildcard import. An unknown import, an import of a private declaration and an import of a name the file’s module declares or another import already binds are errors; an unused import is not.
  • A file sees its own module’s declarations, then its imports, then the standard library’s public declarations in module avin, which need no import; the nearer hides the farther. Program modules may not be avin or under it.
  • Modules may import one another in a cycle; module-level values initialize in the order their uses need across the whole program.
  • A class and its companion object are in one module, in any of its files.
  • One avin command does everything: build, run, test, deps and config.
  • Testing is built in: @test, @tests, setup and teardown, and the built-in runner. Every feature ships with tests.
  • avin build file.avin writes ./file by default; -o overrides it. A failed build leaves existing output untouched.
  • The collector is Sysl’s sh.sysl.gc, shared with Slate. Its API may change if Slate changes with it.
  • The compiler’s untyped AST, typed HIR, lowered IR and LLVM output are kept as distinct stages.
  • A class and its companion object use each other’s private members, in both directions.
  • An initializer’s dependencies count every lambda it makes as if it were called, and every function it calls in full, whatever branch is taken, so a cycle that no run could follow is still rejected.
  • Settled on the user’s delegation 2026-11-15 (built on branch concrete-impls; replaces the earlier rule that an impl covers every instance of its type): An impl of a trait may be for an instance of a generic data type or class, impl FromPg for Vector[byte], or for a partly applied one, impl[K] Show for Map[K, int] or impl[T] Show for Box[Option[T]], since the rule for the concrete case covers those unchanged: the type conforms where it is such an instance, its parts matched exactly (no variance: a Vector[Nothing] is not a Vector[byte] here) and seen through its superclasses, the impl’s parameters taking the parts and then held to their bounds. Its members, static ones included, are the type’s at those instances, found by every path that finds an impl: a call on the value or the type, a call through a bound, a bound held where a type argument is written, a trait value and its method table, a type pattern on an Any, and a template walking a field of that type; a member of the type’s own of the same parameter types is hidden there. The impl belongs in the module of the type or of the trait, as any impl of a trait does (the core library’s Vector takes one in the trait’s module). No overlap: two impls of one trait may not both hold of any instance, so an instance impl beside the type’s own impl of the trait is allowed only where the instance misses that impl’s bounds (byte is no FromPg), and two instance impls only where no instance matches both; there is no specialization, no “more specific wins”. A missed bound keeps the two apart only if it is missed for good: where a module other than the impl’s own and the core library could still write the impl meeting it, one that names both the bound and the type without importing a module that imports it, the two overlap and the diagnostic names that module. A parameter of a partly applied instance may be any type, so it meets every bound. Eq, Hash, Sendable and Boundary are a type’s at every instance alike and take no instance impl. An instance impl of Display or Debug for a data type is an impl of the trait of its own, so the type has no automatic one at its other instances, as with any impl of the trait. Why: a PostgreSQL client needs bytea as Vector[byte] beside a generic impl for arrays, and every domain with a byte string, a matrix of reals or a map of strings meets the same need; refusing overlap keeps a conformance one answer everywhere, decided where the impls are written. Alternatives weighed: specialization, the most specific impl winning (complex, with unsound corners where a generic body relies on the general impl); a library byte-string type for bytea (does not help the next domain); leaving it (forces bytea through byte: FromPg, element by element). Review with the user: whether the core library should stay fixed in the overlap rule (it could in principle add a conformance later, but it changes with the compiler), and whether a module of the instance’s arguments should also be allowed to declare such an impl.
  • The singleton declaration keeps the keyword object.
  • A program’s binding shims are one Sysl package that depends on the runtime’s, built into one archive the program links in place of the runtime’s, so all of a program’s Sysl code shares one copy of Sysl’s library. The archive is cached by a hash of the shims, the Sysl version and the runtime’s source.
  • A binding is a top-level function. Across the boundary a bool is a byte and a char its code point; string and Array[byte] are copied each way.
  • A data type mirrors a Sysl enum or struct with @sysl("module.Name") on its declaration. An enum’s variants are matched by name and their fields by position; a struct is mirrored by one variant named as the type, whose fields are matched by name. A mirror has no type parameters and never holds itself. An integer field takes any Sysl integer, converted with a check in each direction, so a Sysl usize is mirrored by a long.
  • Settled by the user 2026-11-03: Sysl collections cross the binding boundary as copies. A Sysl slice or Buf of a boundary type in a result becomes a fresh Avin Vector[T] (or a fresh Array[T], where the binding declares one); an Avin Array[T] or Vector[T] parameter of a boundary type is copied into a Sysl slice. Collections nest, inside one another, Option, Result and mirrors’ fields. Array[byte] stays a bulk copy to and from []u8. No other Avin collection crosses.
  • Settled by the user 2026-11-04: A Sysl function may fill an Avin array (Sysl bindings). An Array of byte, an integer type, real, bool or char that is a binding’s own parameter (a handle method’s too) is copied into a []T the Sysl function may write, and copied back into the array element by element when it returns; the shim keeps the array as a root of the thread’s stack from before the call until the copy back, which runs after the result is made. The representation is a copy, not a view of the array’s own elements: the collector never moves an object, but a Sysl slice of memory it does not own has no owner, so a Sysl function that kept it would read freed memory once the call returned; a copy keeps Avin memory out of Sysl. Every other array crossing into Sysl (of other elements, or inside an Option, a Result, a collection or a mirror’s field) goes in as a []const T, so a Sysl type that could write into it is refused at the binding instead of silently losing the writes. A Vector stays a []T copy: it never changes, so nothing is lost.
  • Option[+T] and Result[+T, +E] are data types of the core library, written in Avin, with their methods in an impl. See errors.
  • Settled by the user 2026-11-04 (“follow the reference library”): Option, Either and Result take lower bounds where the reference library’s methods have them, so a value taken in may be wider than the one held and the result widens to it: getOrElse[B >: T](default: -> B) -> B, orElse[B >: T](other: -> Option[B]), contains[T1 >: T](x: T1) and zip[T1 >: T, U](other: Option[U]) -> Option[(T1, U)] on Option; getOrElse[R1 >: R], orElse[L1 >: L, R1 >: R], contains[R1 >: R], flatMap[L1 >: L, R2] and filterOrElse[L1 >: L] on Either; getOrElse[U >: T], flatMap[U, F >: E] and orElse[U >: T, F] on Result. On an Option[Cat], getOrElse(dog) is an Animal. This replaces the earlier reading that the impl’s parameters, not being variance positions, needed no bound: they still are not, but only a lower bound widens the result. == compares a value of a type parameter with one of a parameter it is the lower bound of. joinLeft and joinRight keep their shapes, Either[Either[C, R], R] and Either[L, Either[L, C]], since a method takes one lower bound per parameter and the reference’s evidence form has no counterpart.
  • Settled by the user 2026-11-04 (“follow the reference library”): an unknown type argument still open at the end of its body, that the call’s parameters and result name only where a value is read out, is Nothing: None alone is an Option[Nothing], Left(1) an Either[int, Nothing], Ok(1) a Result[int, Nothing], [] and Vector.empty() a Vector[Nothing]. A later use in the body still settles it first. A covariant Nothing argument is any type, a value type’s too, since no value has it: an Option[Nothing] is an Option[int], in a declared type, an argument and a type pattern. An unknown named anywhere else (an invariant or contravariant argument, a lambda’s parameter) or nowhere stays an error asking for the type: Buffer(), Map.empty(), {}. A Buffer[Nothing] could hold nothing, and a module’s val b = Buffer() would only fail later, at the first store, so the error stays where the type is missing.
  • Settled by the user 2026-11-04: the core library has Either[+L, +R], with Left(value) and Right(value), because the reference library has it. It follows that library’s Either in names and meaning and is right-biased: isLeft, isRight, fold, swap, map, flatMap, getOrElse, orElse, contains, exists, forall, filterOrElse, toOption, toList, toVector, foreach, iterator; merge on Either[A, A], joinLeft and joinRight on the nested shapes; Either.cond(test, right, left). Option gains toRight(left) and toLeft(right). Defaults are by name and take lower bounds as Option‘s do (above). There is no left projection (swap serves), no ? on an Either, and no conversion between Either and Result, which stays the type for failure. See errors.
  • ? returns from the function or lambda it is written in, so that one’s result type must be declared or, for a lambda, known where it is written, at least in shape (an Option, or a Result with its error type known; see the lambda-question-shape entry). It cannot leave a delayed argument or a class body.
  • Builders are the trait Builder[-A, +C] (addOne, addAll, result, and, as the reference library’s, clear, which every builder defines and which readies a spent one for a new collection, sizeHint, a hint that changes no result, and knownSize, -1 where a builder does not know it cheaply); a collection’s companion object makes one with newBuilder[T]() (the reference library’s names, user 2026-11-04), and a sequence literal is built through the expected collection’s, so a program’s own class with such a companion is written as a literal too. A List literal is built from the back with ::, since List is a data type.
  • A collection literal compared with ==, != or an ordering takes the other operand’s type.
  • A trap inside the core library, a fail or a failed check such as an overflow alike, reports the place where the program last entered the library: the program’s own call, however many library calls deep the trap is and whether the program reached the library directly, through a method table or through a function value. No annotation asks for it and no function of the program pays for it. See errors.

Settled by the user on 2026-11-03:

  • A mirror’s fields are written in Avin’s lowerCamelCase; the compiler matches each to the Sysl field of the same words in snake_case.
  • fail(message) is public in the prelude: it traps with the message at the caller’s place and has type Nothing.
  • The methods an impl adds to a final class whose fields are all immutable are not variance positions, as a data type’s are not: such an instance holds nothing a method could store a value into. A class with a var field keeps every method a position, and so does an open or abstract class (settled 2026-11-05, below).
  • A one-variant data type may have a companion object, as a class may: the name in call position is the constructor and Name.member the companion (Map.empty, Map.newBuilder, List.newBuilder).
  • An impl may add methods for some type arguments only: impl[T: Display] List[T] gives mkString to lists of displayable elements, and calling it on any other list is an error.
  • The integers are one family: a closed core trait Integer, whose members the compiler decides (every iN), lets the core library implement a trait once for every width (impl[T: Integer] Display for T). Such an impl over a bare type parameter is allowed only for closed core traits, in the core library.
  • Settled by the user 2026-11-03: any run of the operator characters + - * / % < > = ! & | ^ ~ : ? that is not one of the language’s operators names a method, declared like any method and called infix (xs ++ ys) or dotted (xs.++(ys)). The language’s operators, including the yielding compound forms, are not method names: a type has them through their traits, and a method named + is an error saying to implement Add. A symbol call groups left, except that a name ending in : groups right with its receiver on the right (x +: xs is xs.+:(x), x evaluated first). The level it binds at, and the bitwise operators a type may define, are settled on 2026-11-04. There are no prefix or postfix symbol methods; ++ and -- update when no operand follows on the line. x op= y calls the method op= where x‘s type has one, and otherwise is the language’s compound assignment or, for a symbol method op, x = x op y. The library uses symbols: Vector‘s ++, :+ and +:, List‘s and Map‘s ++, and a buffer’s += and ++= beside addOne and addAll.
  • A module may be named in code through an import of the module itself: import a.b, then b.X reaches a.b‘s public X, alongside imports of single declarations.
  • An infix method call binds more loosely than arithmetic, bitwise, shift, cons and range operators and more tightly than comparisons, is, && and ||, and groups to the left, so xs contains x && ok is (xs contains x) && ok.
  • A literal pattern does not match an Any (5 -> … on an Any is an error); n: int if n == 5 says it.
  • A tuple’s type at run time is the type it was made with: (animal, 1) with animal: Animal is an (Animal, int) whatever its class, and a type pattern (Dog, int) does not match it.
  • After its own last field, an open or abstract class’s body may call a private method that is safe: it uses self only to read and assign fields and to call other safe methods.
  • A string’s byte offsets and lengths are int, and a string holds at most the largest int bytes.
  • A trait’s override may give an abstract method of a trait it requires a body, not only replace a default.
  • An iterator is hasNext() and next(), and next() on an exhausted iterator traps.
  • A for without yield traverses its source through iterator() (a range written in place is counted and an array indexed); break, continue and return leave the body directly. A type with foreach and no iterator is not a for source.
  • Array.fill(n, value) evaluates value once and shares it between the elements; per-element values come from Array.tabulate.
  • The hash-based maps and sets iterate in an order the program cannot rely on: the immutable ones in an order fixed by the keys’ hashes alone, so equal maps iterate alike, and the mutable ones in table order.
  • Maps and sets display in the shape of their literals: {a: 1, b: 2}, {1, 2, 3}, and {"a": 1} with each part’s Debug. Mutable maps and sets compare and hash by contents, as arrays do.
  • Every data type may have a companion, not only one-variant ones: an object named after a data type of its module is its companion. A variant of the type’s own name stays the constructor in call position; a type with no such variant (List) has nothing of its name to call. An object cannot share its name with a variant of another type, nor with a fieldless variant of its own type’s name.
  • A collection literal builds whatever collection is expected through the type’s own conformance to the core trait Buildable (the entry of 2026-11-19 on branch builder-trait): a sequence literal a sequence, a set literal {a, b} a set and a map literal {k: v} a map, giving the builder each entry as a (key, value) pair; with no expected collection they are a Vector, a Set and a Map.
  • The arithmetic traits carry their identities: Add has zero and Mul has one, so sum and product of an empty collection are those values rather than an Option. They are written once, by impls on Iterable (impl[T: Add] Iterable[T], impl[T: Mul] Iterable[T]).
  • Seq[+T] is a core trait over Iterable[T] with two abstract methods, length() and apply(index); its other methods (lift, isEmpty, head, headOption, last, lastOption, the folds, foreach, exists, forall, find, indexWhere, count, toVector, toList, an iterator and reverseIterator) are default bodies written once over those two. head, headOption, last and lastOption are Iterable‘s own, written over iterator() for every collection (user, 2026-11-04, as the reference library has them), and a sequence and a sorted collection override them to reach the end at once. lift(i) is the element as an Option. List is a Seq and overrides every one that would index into it, so none takes more than linear time on a list. contains and indexOf, which take an element, and mkString, max and min, which need something of the elements, are added to Seq by impls (impl[T] Seq[T], impl[T: Display] Seq[T], impl[T: Ord] Seq[T]), written once for every sequence; contains and indexOf are exists and indexWhere, so on a list they walk it once.
  • A sequence pattern on a sequence other than a list asks length() once and then reads, with apply, each element whose pattern is not _, in order, stopping at the first that fails.
  • Deque[T] is a ring over an array, doubling when full as a buffer does, its spare places zero bytes. removeHead() and removeLast() return the element and trap on an empty deque, as Buffer.remove traps outside the buffer; isEmpty() is the test before them. Settled 2026-11-04 by the user: a buffer and a deque take the reference library’s names for adding, addOne, append, prepend, addAll, appendAll, prependAll, insert and insertAll, and a deque’s ends are prepend, append, removeHead and removeLast.
  • A trait may declare static members, which belong to the implementing type rather than to a value: static zero() -> Self in Add, static one() -> Self in Mul. Every impl gives them, and they are called on a type, int.zero(), or on a bounded type parameter, T.zero(). sum() and product() on the collections are written with them. The details of static members: static is a keyword, written after private and before or after override; a static member is a trait’s, an implementation of one, or a built-in type’s own (below), and a class or data type keeps what belongs to the type in its companion object; in a trait it has no default body, and no trait overrides one; an implementation is static exactly where the trait’s member is, an abstract class giving it too; its body has no self; a trait’s default body cannot call one on Self; a trait with one is a bound and not a type; and a local, parameter, member or module value of a type’s name hides the type as a receiver.
  • Settled by the user 2026-11-04: a built-in type declares static members of its own, as static members of an impl of the type without a trait (impl string with static fromUtf8(bytes: Array[byte]) -> Result[string, Utf8Error]), for string, char, bool, real, byte and each integer type, since a built-in type has no companion object. The core library declares the built-in types’ own; a program adds them in an extension, as it adds methods, seen where the module is imported and private to it where marked so. They are called on the type’s name, never on a value, and their bodies have no self. A name is a static member or a method of the type’s values, never both; static members of one name overload by parameter types; wrap and the numeric limits (MaxValue, MinValue, real‘s NaN and the rest) are the language’s and cannot be redeclared. A generic impl, an impl adding to a trait and an impl of a class or data type declare no static member of their own. Any static member named on a known type without a call (string.fromUtf8Lossy, int.zero, Point.zero) is a function value of its parameters; an overloaded one takes the expected function type’s overload, and without one is an error. The first use is string.fromUtf8 and string.fromUtf8Lossy (strings from bytes), bound to Sysl’s UTF-8 decoders, with Utf8Error(offset: long, truncated: bool) mirroring Sysl’s error.
  • i1 has no 1: i1.one() is a compile error, and one() reached at i1 through a generic traps with “i1 has no 1” at the place the program called, so a generic that passes its bounds compiles for every type meeting them.
  • An impl may add methods to a trait (impl[T] Seq[T], impl[T: Display] Seq[T]). Its methods reach the value only through the trait’s own methods, which are variance-checked, so, like the methods an impl adds to a data type, they are not variance positions: contains(element: T), indexOf, mkString, max and min are written once on Seq, and generic code over Seq[T] has them. A call is compiled for the receiver’s static type, so the trait’s methods the added one calls are that type’s, called directly, and go through the method table only where the receiver is seen as the trait. Lookup takes the receiver’s type’s own methods first: an added method with the name and parameter types of one the type has is passed over, so a type keeps a faster version of its own where its static type is known. Two impls of different traits adding a method of one name and parameter types to a type conforming to both make a call of it on that type an error; an impl may not add a method the trait declares.
  • The form of a for with yield (for comprehensions): generators pattern in source separated by commas, each followed by any number of if guards, then yield and the value on the rest of the line or in an indented block; or the generators one to a line in a block after for, a line starting with if guarding the generator above, with yield on the line after the block. yield is a keyword. A for without yield once kept one generator and no guards; the entry on loops of several generators below replaces that.
  • Settled on the user’s delegation 2026-11-19: a for without yield takes every clause a comprehension takes (several generators, if guards after each, value definitions between them) and runs as the loops they nest into (branch for-forms). The parser writes it out: each generator a for inside the one before, each guard an if around the rest, each definition a val before the rest; so break and continue act on the innermost generator’s loop and return leaves the function, exactly as the hand-nested form does, and each generator is counted, indexed or iterated as a loop of its own (no allocation over ranges and arrays). Why: porting numeric programs hit the one-generator rule five times in four programs, each time with an obvious meaning; the nested form is the one reading that adds no new semantics. Avin has no loop labels, so a break out of every generator is a return from a local function or a flag, as for hand-nested loops. Alternatives: keep the rule (pushes the nesting onto every grid and pair loop); break leaving the whole for (a meaning the nested form cannot show, and a continue would then want the same, making the two forms differ); a loop over a lazy product (allocates, and loses per-generator counting). The one-to-a-line block form after for stays a comprehension’s: do on the line after the block would read as a do … while statement. Review with the user: it reverses a settled rule, and break acting on the innermost generator only is the choice to look at.
  • Settled on the user’s delegation 2026-11-19: yield may start a line indented under a one-line for‘s clauses (branch for-forms), with its value on the rest of the line or in a block under it; nothing else may follow it inside that indentation. Why: a function body whose comprehension’s header fills the line wants its yield below it, as a continuation line holds an operator below its expression. do is not accepted there, since an indented line starting with do is already a do … while statement in a loop’s body, and an indented body needs no do. Alternatives: the block form only (for + clauses one to a line + yield at for‘s depth, which reads poorly for one generator); a general rule continuing any keyword-led line (wider than the need, and ambiguous with bodies).
  • A guard is withFilter, a lazy view each collection provides; on a source that is no Iterable it is Filter‘s filter (see the entry on comprehensions by conformance). flatMap on the library’s collections takes any Iterable from its function, or an Option (see the entry on flatMap with options, branch map-flatmap); a Range maps to a Vector; a Map‘s entries reach a comprehension as pairs, through map and flatMap overloads taking a function of one pair, and yield a Map where they yield pairs, a collection otherwise.
  • A generator’s pattern must match every element, as in a for loop, rather than filtering out the elements it does not match. return, break, continue and ? cannot leave a comprehension’s guards or yielded value.

Settled by the user on 2026-11-04:

  • From[E] is one generic trait, implemented once per source error type by the type the errors convert to: impl From[IoError] for ConfigError beside impl From[ParseError] for ConfigError. A type may implement one generic trait at several type arguments where the trait’s members are all static and it requires no other trait, as From‘s one member, static from(value: E) -> Self, is; any other trait is implemented once. ? on a Result[U, E] in a function yielding Result[T, F] passes the error on unchanged where E is an F, and otherwise through F.from: at From[E], or else at the one conformance From[X] with E an X that is more specific than every other such. Neither is an error naming From[E]; several equally specific ones are an error naming them. On a type parameter the conformances are its bounds’, F: From[IoError] & From[ParseError]. See errors and declarations.

  • One formatting style, applied by avin fmt [--check] [<path>...] and the language server’s textDocument/formatting. Each block level is indented two spaces; a literate file keeps its four-column code-block margin and indents two a level inside it, and only its program is formatted. Spaces go around binary operators (ranges included, 0 ..< n), = and ->, after , and :, and nowhere inside brackets; a prefix operator stays against its operand. At most one blank line in a row, none at either end of the file, and one between two top-level declarations unless both are one line; a declaration’s comments and annotations stay with it, and a function’s clauses are one declaration with its signature, no blank line among them (Proposed, under Proposed). Comments are kept exactly, a trailing one a space after the code. A line longer than 120 characters has a list broken one item per line, a call’s or a literal’s items two columns in and a parameter list’s four, the closing bracket on its own line; a list the source wrote one item per line stays so, except that a broken sequence or set literal of short, simple items is filled as many to a line as fit (Proposed, under Proposed); a binding’s value with no list to break is broken before its loosest operators as continuation lines, though only after the last then, elif or else of a one-line if (a line after an if‘s test is its block, so a test and an earlier branch stay whole). No trailing commas are added. The formatter keeps every token and refuses a file that does not parse; its result parses to the same syntax tree.

  • compareAndSet on a value without identity — a data value, tuple, string, Option or Any — compares with ==; on scalars and references it compares the word. A class instance (even of a class that derives Eq) and a function value keep identity. See threads.

  • Vector[+T] is a persistent, radix-balanced tree of arrays of 32, with a prefix and a suffix beside a balanced middle at every level, and stays the default sequence ([1, 2], []T, main(args)). Indexing and updated take one array per level, at most six; :+ and +: take amortized constant time; slicing, take, drop and their kin take time in the depth and share every array they do not cut; ++ takes time in the shorter operand. A vector’s arrays are exactly sized and never written once they are in a tree. The one-array immutable sequence remains as ArraySeq[+T], for elements built once and then read, with no level between an index and its element; every changed ArraySeq is a copy. Every collection has toArraySeq(). See collections.

  • An impl that only adds methods may be written in any module (a relaxed impl); in another module than its type’s or trait’s it is an extension: impl string, impl[T: Ord] Seq[T], impl[T] Option[Option[T]], impl Box for another module’s class. Its methods are seen in its own module and in every file importing that module, whole or any declaration of it, with no further step; a file importing neither does not see them, and the core library’s are seen everywhere. A type’s own methods are found first: an extension method a type’s own or inherited method of the same name and parameter types always hides is an error at its declaration, and one added to a trait is passed over for a type that has such a method. Two seen extensions of different modules adding one name and parameter types to a receiver make the call an error naming both modules. An extension’s private methods are private to its module. Its methods reach no private member of another module’s type, are in no method table and are not overridden; self is the receiver and the type’s public fields and methods are in scope by bare name. Infix calls, method values and calls through a bound see extensions as dotted calls do, a bound’s where the generic function is written. Conformances, impl Trait for Type, stay in the module of the type or of the trait.

  • Sequences, sets and maps are functions, by subtyping. Seq[+T] is a subtype of (int) -> T, through its apply(index); Set[A], immutable and mutable, of (A) -> bool; Map[K, V], immutable and mutable, of (K) -> V, whose apply traps on a missing key as m(k) does. A collection is passed, stored and called where its function type is expected with no conversion, and variance holds through it: a Vector[Dog] is an (int) -> Animal. For a set s, s(x) is legal: true when x is an element of s and false otherwise, the set’s apply(x) -> bool, which is contains.

  • A class or trait names a function type among its parents after : (trait Seq[+T]: Iterable[T], (int) -> T), and a data type or class through an impl with no bounds of its own (impl[K, V] (K) -> V for Map[K, V]), in the type’s own module. The type then has an apply taking exactly that type’s parameters and yielding its result or a subtype; apply implements no trait method, so it is not marked override for it. A type is at most one function type, counting those of its superclass and its traits, and its parameters keep their variance there. A built-in type is no function.

  • A function type with one parameter is written without parentheses: int -> string, Option[T] -> bool. -> in a type groups to the right, so int -> int -> int is int -> (int -> int); (A) -> B is the same type as A -> B, (A, B) -> C takes two parameters, a function taking one tuple is ((A, B)) -> C, and a function taking a function is (int -> int) -> int. A function type needs no parentheses in a parameter, field, result, type argument, tuple part or val annotation, nor as a supertype; a type pattern in a match arm still writes it in parentheses, since the arm’s own -> follows it. Error messages print every function type with a parameter list, (int) -> int.

  • main is main() or main(args: Vector[string]), the arguments after the program’s name, the same as avin.process.args(). The parameter is exactly Vector[string] (a name for that type is the same type; Seq[string] and Array[string] are errors), it has no default, and any other parameter list is an error naming the two forms. The result rules are unchanged. A program built for its tests does not run main, so tests see no arguments.

  • A match with nothing before it is a function literal of one value, whose arms are ordinary match arms: xs.collect(match Some(n) -> n), one arm on the match line, or an indented block of them, inside parentheses or after an infix method’s name. Its parameter type comes from the expected type, as a lambda’s does, and with none it is an error. Where A -> B is expected its arms must cover every A; where PartialFunction[A, B] is expected they need not. PartialFunction[-A, +B] is a core-library trait with isDefinedAt, a call that traps at the program’s call site outside its domain, lift, orElse and applyOrElse; a literal tests its patterns and guards once per call, lift or applyOrElse. Every collection with map has collect, every Iterable has collectFirst, and Option has collect. A PartialFunction[A, B] is a subtype of A -> B, through its apply, so it passes wherever one is expected and traps there outside its domain.

  • []T in a type position means exactly Vector[T]: xs: []int, [][]int, Option[[]string], main(args: []string). Its element is a name or a parenthesized type, so []int -> int is a function from a vector and [](int -> int) a vector of functions. A type pattern takes it without parentheses, v: []int -> body. There is no fixed-length [N]T (an error); error messages print Vector[int].

  • The thread model (threads): avin.threads.spawn(body) starts a closure on a new thread with an 8 MiB stack and join() gives back its result; a structured scope joins every thread started in it; a trap in any thread stops the program, and the program ends when main returns. The heap, module-level values and captured vars are shared. The library offers Mutex[T] owning its value, Condition, sequentially consistent Atomic[T], Channel[T] and Once, and every wait marks its thread safe for the collector. A data race is not undefined behaviour: heap fields and module-level variables are accessed with LLVM’s unordered ordering, so a racing read sees some value written to that word, and a constructor ends with a release fence, so no thread sees an object without its header and constructor-set fields. Actors are scheduled onto a pool of these threads.

  • Details of starting and joining: spawn gives back a Thread[T] whose join() any thread may call, any number of times and at once; one waits for the thread and the others for that wait. A thread’s handle is collected like any object once nothing reaches it; a thread never joined keeps its stack until the program ends. s.spawn is called by the thread running the scope’s body while the scope is open, and anything else traps, so the scope sees every thread it has to join; a thread the scope started starts more through a scope of its own. When several threads trap at once, or one traps while another calls exit, only the first stops the program: its output is flushed once and its reason is the one reported.

  • Repeated parameters: values: T* is the last parameter, at most one, named, with no default and not by-name; inside the function it is a Vector[T]. A call gives it every positional argument from its position on, each checked against T (so generic T is inferred from them), or splices one Iterable[T] with xs* as its only argument, written last: a Vector[T] is passed as it is, any other sequence copied. f(1, xs*) into the one parameter, xs* anywhere else, and naming the repeated parameter are errors. A function with one, used as a value, has the type (…, Vector[T]) -> R. A method overriding or implementing another repeats the same parameter or neither does; main takes none; data fields cannot be repeated. A method whose only required parameter precedes a repeated one is called infix with one argument.

  • An impl without for adds methods to any type built from its parameters (declarations): impl[T] Option[Option[T]], impl[A, B] Pair[A, List[B]], impl[T] Seq[Seq[T]], impl[K, V] Iterable[(K, V)]. Every parameter must appear in the type. A call matches the receiver’s static type against it, seeing a reference through its traits and superclasses only at covariant parts, and holds the learned parameters to the impl’s bounds; a receiver that does not match is an error saying what it would need to be. Two impls that both match a receiver and add a method of one name and parameter types make the call an error, as does such a method clashing with the type’s own. An impl of a trait for such a type is an impl for instances of it, whose overlap with another impl of the trait is an error (see the impl for instances of a generic type, 2026-11-15). The core library adds flatten to Option[Option[T]], Result[Result[T, E], E] and Seq[Seq[T]] (a Vector[T]), toMap() to Iterable[(K, V)] (keys bounded as a map’s) and unzip() to Seq[(A, B)].

  • A heap field or module variable wider than 64 bits is accessed as untorn 64-bit words: a racing read of it may combine words of different writes (threads).

  • Details of synchronization: Mutex[T].with hands its body the value itself, and an immutable value is read with get, replaced with set and changed with update(f) under the lock. A mutex is not reentrant, and a thread taking one it already holds traps rather than waiting for ever; otherwise only a deadlock of the whole program is detected (diagnostics). A Condition is made by its mutex’s condition(), so it is waited for with that mutex only, and wait() from a thread not holding it traps. Atomic[T] holds any type: a value of one word lock-free, an integer wider than 64 bits under one runtime lock; compareAndSet compares identity for a reference and the bits for a real; add and sub give back the new value and trap on overflow before storing, and update(f) retries f until its compare-and-set succeeds. Channel[T](capacity = unbounded) is unbounded with no capacity, a rendezvous at zero (Proposed below, which replaced unbounded at zero), and a negative capacity traps; a send to a closed channel traps, closing twice does nothing, and a channel is Iterable, receiving until it is closed and drained. Once.run makes every other caller wait for the running body; a body running its own Once again traps.

  • Trailing blocks: an indented block on the lines after a call is the call’s last argument, given to the callee’s last parameter. A by-name parameter takes the block as its delayed expression (retry(3) + block); a function parameter takes a lambda whose parameters end the call’s line, one name or a parenthesized list after the call’s parentheses (withFile(path) f ->, zipWith(a, b) (x, y) ->). A callee with no other arguments is written without parentheses (scope s ->, s.spawn + block). It applies wherever an expression ends a line (val r = retry(3) + block, a method call, a match arm’s body), and never in the test of if, elif, while or do … while, a for source or guard, or a class’s parents, where the block is the form’s body. A local function’s header keeps its meaning: name() or name(x: T) before a block declares one. A block whose only line is a name and an operand stays the infix-continuation error. A block for a last parameter that is neither by-name nor a function, already given, or absent is an error.

  • Futures in avin.threads: Future(body), the companion’s apply[T](body: -> T), runs a by-name body on a shared pool and gives back a Future[T] at once; await() waits safe for the collector, await(timeoutMillis: long) gives an Option, and times are milliseconds as a long, as in a condition’s waitFor(timeoutMillis) -> bool. map, flatMap, zip, onComplete, Future.all (a Vector in the order given), Future.first (trapping on no futures) and Future.successful never wait, and every function given to one runs on a pool thread. A future carries no failure: a computation that can fail is a Future[Result[T, E]], which also has mapOk and flatMapOk, and a trap in a body stops the program. Promise[T]() has a future field; complete(x) a second time traps, and tryComplete(x) -> bool completes only where nothing has. The pool starts workers as work comes, up to one per processor (sysl.platform.cpu_count), never joins them, and starts one more in the place of each worker waiting in await while work is queued, so nested waits never deadlock it; await inside a body is allowed. The pool is a module’s lazy val, so a program that makes no future never makes it.

  • lazy val, at module level and in class and object bodies (each instance its own), and in blocks (each declaration’s run its own, see the entry for branch lazy-local), is computed on its first read, exactly once, and kept; never read, never computed. lazy is a modifier only before val, an ordinary name elsewhere; lazy var and lazy on parameters, class parameters and data fields are errors. A module-level one takes no place in the eager initialization order, its readers depending on what its initializer reads; an initializer whose own code needs its own value, directly, through the functions it calls or through other lazy values, is a compile error naming the chain (module-level, field and local ones alike; see the initialization entries), and one that reaches it through a function it hands on traps at that read, naming the value. A field’s initializer may use every field and method; the class body reads the field only where it could call a method. Concurrent first reads run the initializer once, the others waiting safe for the collector; the value is published with a release store paired with the readers’ acquire load, a stored value read with one atomic load and a branch.

  • A companion’s apply overloads the constructor its name has in call position. Where an object declares apply, Name(…) chooses among the class’s constructor (or the data type’s variant of its name) and every apply by the ordinary static overloading rules: most specific by parameter types, with by-name parameters, defaults, repeated parameters, generic inference and trailing blocks as for any call (Future(fetch(url)), Future + block). Type arguments written at the call are the chosen candidate’s: the class’s or data type’s for the constructor, the method’s for an apply. An apply with the constructor’s parameter types, up to type parameter names, is an error at its declaration. A name with no constructor in call position (a data type with no variant of its name, an abstract class, a plain object) calls its apply alone, and the library’s List, Set and Map companions take their elements that way: List(1, 2, 3), Set(…), Map((k, v), …). Where a function type is expected, the name is the constructor or apply that type chooses, as for an overloaded function value; elsewhere the bare name stays the object. This amends the earlier rule that the name in call position is only the constructor and that an object cannot be called.

  • A method named by a symbol binds at the level of the language’s operator its first character belongs to, on Avin’s own table, tightest first: a name starting with any character that starts no operator below (~, ?) binds above multiplication; *, /, %, << and >> names with the multiplicative operators and shifts; + and - names with the additive operators; &, ^ and | names with those bitwise operators, & tightest; : names with ::; then ranges and methods called by a word (a max b); <, >, = and ! names with the comparisons; and a name ending in = that is not a comparison (+=, ++=, |=) is an assignment. A name ending in : still groups right with its receiver on the right, and left- and right-grouping operators at one level, symbol, word or the language’s own, do not mix without parentheses (1 :: xs :+ 2 is an error; 1 +: xs :+ 2 is (1 +: xs) :+ 2). So xs ++ ys :+ z is (xs ++ ys) :+ z, and the combinators a ~ b ^^ f | c ~ d read ((a ~ b) ^^ f) | (c ~ d). &, ^, | and ~ between two operands are free method names for every type but the integers and bytes, whose bitwise operators stay the machine’s and cannot be redefined, by an extension either; a | b on such a type calls its method |, and x |= y calls |= where the type has one and is otherwise x = x | y. Prefix ~ stays the integers’ and bytes’ complement. + - * / % and the comparisons still come only through their traits, and &&, ||, !, ===, !==, ::, =, :=, ->, ?, .. and ..< stay reserved. This replaces the earlier rule that every symbol call binds at the level of a max b. See methods named by symbols.

  • The shifts << and >> are free method names on the same terms as &, ^ and | (user, 2026-11-04), so a parser combinator library can spell sequencing-then-map p >> f. On every type but the integers and bytes, a << b and a >> b call the methods of those names, at the shifts’ own level, that of multiplication (a ++ b >> f is a ++ (b >> f), a >> f | b is (a >> f) | b); x <<= y calls <<= where the type has one and is otherwise x = x << y. The integers’ and bytes’ shifts stay the machine’s and cannot be redefined, by an extension either, and the yielding forms <<:= and >>:= stay reserved. Avin has no >>> operator, so >>> was already a free name. This amends the rule above. See methods named by symbols.

  • The arithmetic operators + - * / % and the orderings < <= > >= are free method names on data types, classes and traits, with any operand and result types (user, 2026-11-04), beside the operator traits, which stay for generic code: Instant + Duration -> Instant, Instant - Instant -> Duration, Vec * real. Such methods overload by the operand’s type like any other. a + b calls a‘s method + where a‘s type (a data type, a class, or a type parameter through its bounds) has one taking one argument, at the built-in operator’s own precedence; where it has none, the operator is the core trait’s (Add‘s add), as before. The method is just a method: on a type with both, the operator calls the method and code bounded by Add calls add. Prefix -a calls a method - taking no argument (-() -> Vec), and otherwise is Neg‘s negate. a < b alone calls the method <, whatever it yields; a comparison by a method chains when every link yields bool (amended 2026-11-19; see “a comparison chain’s links may call operator methods” below, among the decisions settled on the user’s delegation). x += y calls += where the type has one and is otherwise x = x + y, the method + included. The built-in types keep their operators: a method of one of these names on int, real, byte, char, string, bool or a tuple, by an extension or a trait implementation, is an error. == and != stay Eq‘s, and the wrapping, saturating and yielding forms stay reserved. avin.time spells its reading arithmetic with them. This amends the two rules above. See methods named by symbols.

  • not is a soft keyword: a keyword only directly after is (user, 2026-11-04), so the parsing library can name its negative lookahead not(p). After is it is always the keyword, so x is not(y) negates the pattern (y); everywhere else it is an ordinary name, and a function, method, parameter or local may be called not. See is.

  • A method named by a symbol with ~ anywhere in its name binds at the tightest symbol level, whatever its first character: ~, ~>, <~, ~!, <~> and ^~ bind together there and group left, so num | symbol("(") ~> expr <~ symbol(")") is num | ((symbol("(") ~> expr) <~ symbol(")")), "[" ~> items <~ "]" ^^ f is (("[" ~> items) <~ "]") ^^ f, and a <~ b ~ c is (a <~ b) ~ c. Every other name keeps the first-character rule; a ~ name ending in = (~=) is still a compound assignment, and prefix ~ is unchanged. This amends the rule above, under which <~ bound with the comparisons.

  • A line that starts with a binary operator, indented deeper than the line where its expression began, continues that expression, with the operator’s own precedence: the line break means nothing. Every binary operator of the language, every method named by a symbol, ~, and ++ or -- with an operand after it start one, and so does a member’s . (see the Proposed entry on . lines); a word, !, ?, a bracket and the assignments do not. It applies wherever an expression with a complete operand ends a line (a binding’s value, an assignment, a return value, an infix call’s argument, a match arm’s or a lambda’s body, an expression statement) and ends at the first line back at the depth the expression began on; a line inside it that does not start with an operator is an error. Blank lines and comments between continuation lines are skipped. After an operand -x and +x there are binary; after the test of if, elif or while, a for source, a class’s parents, and after anything that is not a complete operand (=, ->, else, do, a signature), an indented line is a block’s line, so if c over -1 is a block yielding -1. An indented line starting with an operator after a call is a continuation, not the call’s trailing block. See continuation lines.

  • A .lavin file is literate source: a Markdown document whose lines indented four columns are the program, and the name alone decides it (an .avin file never reads this way). It is accepted wherever an .avin file is: a program of one file, a file of any module of a directory program or of the library, avin test, and the language server. The program’s own indentation starts after the four columns; prose between two blocks ends nothing and reads as blank lines; a fenced block (``` or ~~~) is an illustration and is not compiled; an indented block under a list item is prose. Prose is blanked, not removed, so every position reported is the document’s own line and column. A tab in a line’s indentation and a fence that is never closed are refused where they are. avin tangle prints the program with the prose stripped, line for line; avin weave renders the document as one HTML page, the prose as GitHub-flavoured Markdown and the program coloured by the compiler’s own lexer. See literate source.

  • Derivation through shapes (derivation): derives takes any trait whose module declares a derive X for T template, written once like an impl. Every data type and class (its constructor parameters) has a shape, made once before main: variants, fields, names, positions, defaults and annotations. Inside a template, T.walk(value, visitor) and T.walkPair(a, b, visitor) call the visitor’s field[F: Bound] hook once per field at that field’s type, and T.build(builder) makes a value from fields supplied in any order, using defaults and the builder’s missing for absent ones. The template is checked once; the visitor’s hook is found for each deriving type, and that each field meets its bound is reported at the derives entry naming the field. Annotations are values of types implementing Annotation, written @JsonKey("name") on a type, variant or field. The user resolved the proposal’s open questions:

    • Shaped is a bound only a template’s T has; a program cannot write it elsewhere.
    • The built-in Display, Debug, Ord and class Eq and Hash derivations are to be re-expressed as core-library templates. A data type’s own == and hash stay the language’s.
    • A misused annotation is not rejected while compiling; it fails when a value is decoded.
    • build is refused for open and abstract classes, an error at the derives entry; walk is allowed.
    • Every type parameter of a generic deriving type is bounded by the derived trait.
  • Packages beyond the manifest, settled by the user (2026-11-04) as proposed:

    • Features (features), Sysl’s model with the module as the unit gated: a feature block has doc, default, modules, enables and requires, and name = [x] is its short form; optional dependencies, "dep:x", "dep/feature", users’ features, default_features = false and -x, unification by union and the --features/--no-default-features/--all-features flags are Sysl’s. Where Sysl gates lines with #if feature_x, Avin has no conditional compilation: a feature lists whole modules (with those under them), read only while it is on, and an import of a gated module or of an optional dependency’s module is allowed only from a module whose own gate implies it, checked against the manifest whatever is selected, so features are additive by construction. avin test, avin check, the language server and avin tidy turn every feature on. Not carried over: Sysl’s choices, a feature’s if and targets, and options, which are about machines and C configuration Avin’s manifest does not describe.
    • Members of a repository (members), Sysl’s: { git, member = "dir", version | rev }, the member a package named <coordinate>//<dir> for selection and avin.sum, every member at one version one clone whose hash each member’s line carries, a fetched member’s workspace = true and in-repository path siblings read as their own coordinates at the member’s version, and avin add <coordinate>//<dir>@<version>. Its modules keep their own names, as every dependency’s do, so Avin needs no package.repository key.
    • Vendoring (vendoring), Sysl’s: avin vendor copies the resolution with every feature on into vendor/ at the project (workspace) root in the cache’s layout, each copy hashed against its avin.sum line first, .git and path dependencies left out; a vendor/ present is the cache, and the root’s vendor/ is never a module. Two choices of Avin’s own: a package missing from vendor/ is refused rather than fetched into it, so a vendored build never touches the network; and avin vendor removes packages the resolution no longer reads, as avin tidy does for lines.
    • The standard library’s modules (standard library): the avin tree shipped with the compiler (share/avin/library, or AVIN_ROOT/library), versioned with it, never a dependency and never in avin.sum; avin is the prelude, seen without an import, and every module under it is imported by name like any module. A compilation reads the prelude and then only the library modules something imports, transitively, so the library can grow without every program parsing all of it. Domain libraries are packages (as settled for dev.avinlang). The standard library has no features.
  • Integer limits and narrowing (user, 2026-11-04). MinValue and MaxValue on every integer type (int.MaxValue, long.MinValue, i8.MaxValue, any iN), on byte and on char, and on real MaxValue, MinValue, MinPositiveValue, PositiveInfinity, NegativeInfinity and NaN, all compile-time constants. Narrowing integer conversions (i8(x), int(l), T(n), and a byte or char to a narrower integer) trap when the value does not fit; real-to-integer still saturates. The wrapping form, i8.wrap(x) (spelling proposed below), keeps the low bits. A type parameter bounded by Integer has the limits too, T.MaxValue and T.MinValue, each instance’s own (generics).

  • Settled by the user 2026-11-04: Nested data types (generics): a data type naming itself at a larger instance in its fields (Deeper(inner: Tree[Nest[T]]) in Tree[T]) is rejected at the type as polymorphic recursion, even where no code compares, hashes or shows it, since every data type’s structural equality, hash and Display would need a copy for every depth. A class naming itself so in a field is not rejected for that alone; only code that grows with it is.

  • Settled by the user 2026-11-04: Which growth counts (generics): growth is measured as nesting depth, and a cycle is rejected when a round of it nests its type arguments deeper in total. A call through a bound on a value of a type parameter takes that type’s arguments apart (a Box[U] reaching Box‘s method at U is one level less); an implementation reached through a method table whose static type names every type parameter of the receiver’s class (an Iterator[(A, int)] for an IndexedIterator[A]) takes them apart from the receiver’s, while one reached through a trait that leaves some unnamed (a trait with no type parameters) continues the cycle from wherever the class’s larger instance was made.

  • Settled by the user 2026-11-04: Literal shapes (collections): each of the library’s collections is built only by the literal of its own shape: every Seq by [a, b], Set, TreeSet and the mutable Set by {a, b}, and Map, TreeMap and the mutable Map by {k: v}, so val s: Set[int] = [1, 2] is an error naming the literal to write; {} is the empty set or the empty map, whichever is expected. A program’s own collection with a builder is built by any literal whose elements its builder takes, a map literal only by a builder of pairs. A map literal’s keys agree on one type and its values on another, each as if branches do. The mutable Set and Map gain companions with empty and newBuilder.

  • Settled by the user 2026-11-04: Packages (packages), modelled on Sysl’s package system:

    • The manifest: package { name, version, description }, dependencies { … } and workspace = [ … ], and no other key; an unknown key is an error, not a warning. A name is a lowercase letter then lowercase letters, digits, _ and -; a version is major.minor.patch with no leading zeros. A manifest is optional: a directory or file with none above it is a program as before.
    • Dependencies: { git = "host/owner/name", version = "x.y.z" } read at the tag vx.y.z and cloned from https://; { path = "../dir" }, relative to the manifest naming it, and in a fetched package naming another package of its repository at its version (refused when it leaves the repository); { workspace = true }. A coordinate with https:// or .git is refused. Features and members of a repository are settled above.
    • Members, as built: a fetched package’s in-repository path and workspace = true dependencies are read as the repository’s own packages at its version whether the package is a member or the repository’s root package, since the root of a workspace with a package block is its first member. A member’s directory may hold no ., .. or *. The clone is filed once per repository and version; a repository whose root has no manifest is still filed when a member of it is what was asked for.
    • Vendoring, as built: avin tidy and avin add read the machine’s cache, fetching into it, whether or not the project has a vendor/, so a dependency is added to a vendored project and then copied in by avin vendor. avin vendor checks every cache copy before writing anything, so a refusal leaves vendor/ as it was (and a project with none still has none); a vendored copy is left alone only when its recorded hash and its files both match its line, so an edited copy is replaced; directories left empty by a removal are removed; and it ends vendored N packages into vendor/, the packages being avin.sum‘s lines (a member and its repository’s root package at one version are two packages and one copy). The cache’s .hash beside a vendored entry is trusted by a build, as the cache’s is: a build does not re-hash vendor/.
    • rev pins: { git = "…", rev = "<hex>" }, seven to forty lowercase hexadecimal digits, refused with a version or without git. The repository is cloned whole and the commit resolved to its full id, fetched by that id when no branch or tag reaches it (only a full id can); the cache entry is @r<full id> and the avin.sum line <coordinate> r<full id> sha256:…, so an abbreviation and the full id are one package. A cached commit an abbreviation begins is found without the network. A package pinned at two commits, or at a commit and a release, anywhere in the graph is refused naming both: a commit is not chosen among, since none is higher. avin add <coordinate>@<rev> writes the full id.
    • What a dependency brings in: its modules, under their own names; not its root directory’s files (its main) nor its tests directory, so a program can be depended on and avin test runs only the package’s own tests. One module in two packages is refused. A directory holding its own manifest is another package and never a module of the tree above it.
    • Version selection: the highest version any manifest in the graph asks for, over every member of a workspace.
    • The cache is the machine’s, <cache>/avin/pkg/<coordinate>/@v<version>/, the clone’s .git removed and the tree’s hash written beside it. Builds fetch; the language server does not.
    • avin.sum: <coordinate> v<version> sha256:<hex> per fetched package and version read, one file per project (the workspace root’s); the hash is Sysl’s tree hash (SHA-256 of a sorted listing of each file’s SHA-256 and path, .git and the root’s .avin/ left out). A mismatch is refused; a build only adds lines; avin tidy [--check] rewrites it to what the whole resolution reads.
    • Workspaces: Sysl’s: members listed by directory with * within a name, a root with a package block a member, a root without one taking no dependencies and refused as a program.
    • Finding the package: every command walks up from the path it is given to the nearest manifest with a package block, a workspace root without one being passed over. Sysl looks only beside the path; walking up is what lets a file, a test directory or an editor’s open file name its package.
    • avin new <dir> [--lib] names the package by the directory, writes a module of that name (- written _), main.avin unless --lib, a test in tests/ and a .gitignore of .avin/; the names avin and tests are refused. avin build names the executable after the package.
    • avin add <coordinate>[@<version>] [<package>] records a git dependency: the version is the one given, or the highest release tag the host lists (v and three numbers; no release is an error naming the way to give one). The package is fetched first and listed under the name its own manifest gives it; a dependency already listed, under that coordinate or that name, has its entry replaced in place, to a lower version too. The edit is made in the manifest’s text, so comments and layout stay: the entry goes last in the dependencies block, a block being made at the end of the file when there is none. The result is resolved and avin.sum gains its lines (a version that is no longer chosen keeps its line until avin tidy); where fetching or resolving fails, the manifest is put back as it was. It adds only git dependencies: a path dependency is written by hand.
  • Settled by the user 2026-11-04: Repeated parameters beside overloads and constructors (declarations): an overload with a repeated parameter is a candidate only where no overload without one accepts the call, so pick(x: long) takes pick(1) beside pick(xs: int*); among those with one, the arguments are compared by the element type. A class’s constructor may end with a repeated parameter, whose field is a Vector[T] (class Path(val parts: string*)), and a subclass passes it on with : Path(parts*). The core library gains max(first, rest*) and min(first, rest*) on T: Ord, answering the greatest or least of one value or more, the first of equal ones.

  • Settled by the user 2026-11-04: Option, Result and string methods (errors, types): Option gains exists, forall, contains (on T: Eq, which every type meets), toList, toVector and zip; Result gains exists, forall, toList and orElse(f), where f takes the error and answers a Result that may have another error type. forall is true of None and of an Err. string gains chars, count, split, lines, isBlank, reverse, padStart, padEnd, equalsIgnoreCase, take, drop, takeRight and dropRight, which count characters where the older methods count bytes. split keeps every empty piece and traps on an empty separator (no piece boundary is defined there). lines ends a line at \n or \r\n; a terminator at the end starts no further line, the empty string has no lines, and a lone \r stays in its line. take, drop, takeRight, dropRight and the padding widths clamp rather than trap.

  • Settled by the user 2026-11-04: The methods every Iterable has (collections): folds, reduce (trapping when empty) and reduceOption, searches, count, minBy/maxBy and min/max (trapping when empty) with minByOption/maxByOption and minOption/maxOption (answering Option), the reference library’s names, mkString, partition, groupBy, groupMap, groupMapReduce, the conversions and zipWithIndex are written once on Iterable and replace the copies Seq and Set had. A collection they make is a Vector, whatever the receiver: partition answers (Vector[T], Vector[T]), groupBy a Map[K, Vector[T]], zipWithIndex a Vector[(T, int)], so a set’s or a map’s partition keeps every element, equal results included, and a list’s comes back indexed. A type’s own method of the same signature still answers where the type is known (List.toList is the list itself). Iterator has lazy map, filter, take, drop, takeWhile, dropWhile, zip and zipWithIndex answering iterators; its zipWithIndex is the trait’s own method and so is found before Iterable‘s. To compile these, a method table holds a method at a position only for the types a call through that position can reach, by the receiver’s static type, so a trait method that makes an instance at a larger type argument (zipWithIndex on an Iterator[(T, int)]) is not compiled for every type it makes.

  • Settled by the user 2026-11-04: Set and map methods (collections): an immutable Set has ++ and -- taking any Iterable[A] beside union, intersect, diff and subsetOf, which keep their names and their Set parameter; + and - stay reserved for Add and Sub, so one element goes in with incl and out with excl, the reference library’s names. An immutable Map‘s ++ takes any Iterable[(K, V)] and -- any Iterable[K]. Map.keys() and values() answer a Vector in iteration order, so the two line up by index, rather than one-shot iterators; keysIterator() and valuesIterator() are the lazy forms, and keySet() answers a Set. A mutable map’s keys() and values() are likewise vector snapshots and its keySet() an immutable Set snapshot. transform is the new-map form taking the key and the value (mapValues takes the value alone) on both maps, and a mutable map has no in-place transform. Everything that builds a collection from a mutable set or map (map, flatMap, union, intersect, diff, mapValues, transform, filterKeys) answers a new mutable one; filterInPlace(p) and updateWith(k, f) change in place, updateWith answering the new binding as an Option. +=, -=, ++= and --= are methods on the mutable collections (a map’s += takes a (key, value) pair), so they work on a val; removing an absent element or key is not an error.

  • Settled by the user 2026-11-04: Sorting (collections): every Seq has sorted() (elements Ord), sortBy[K: Ord](key) and sortWith(compare: (T, T) -> int), answering a Vector; List has its own three answering a List. Array, Buffer and Deque sort in place with sortInPlace(), sortInPlaceBy(key) and sortInPlaceWith(compare), the reference library’s names. Every sort is a stable merge sort, O(n log n) comparisons in the worst case with one scratch copy of the elements; sortBy and sortInPlaceBy compute key once per element. avin.fs.listDir answers its names sorted by code point rather than in the file system’s order.

  • Settled by the user 2026-11-04: The methods every Seq has (collections): map, flatMap, collect, filter, filterNot, withFilter, take, drop, takeWhile, dropWhile, takeRight, dropRight, slice, splitAt, span, tail, init, reverse, ++, :+, +:, updated, padTo, indices, zip, zipAll, scanLeft, distinct, distinctBy, grouped, sliding, lastIndexOf, lastIndexWhere, startsWith, endsWith, sameElements, intersect and diff are written once on Seq, answering a Vector (indices a Range, grouped and sliding an Iterator[Vector[T]]). List, Vector and ArraySeq keep or gain their own versions answering their own kind. The mutable Array, Buffer and Deque answer the element-wise map, flatMap, collect, filter and filterNot with a new collection of their own kind and the structural methods with a Vector, so a structural method never shares or aliases a mutable receiver; Array.slice stays an Array. A count is clamped to 0 .. length(); slice traps unless its indices are in order within the sequence, as it does on strings and arrays. intersect and diff are multiset operations: each occurrence in the argument matches the first unmatched equal element, and the receiver’s order is kept. Range is a Seq[int] with constant-time length, apply and contains, and so an (int) -> int. Overload resolution accepts an argument of a subtype of a parameter’s type, as a single function’s call does, and compares candidates by the same conformance, so a type’s own ++(other: List[T]) and Seq‘s ++(other: Iterable[T]) are overloads of which the first is more specific.

  • Settled by the user 2026-11-04: Two sequences are equal when they have the same elements in order, whichever kinds they are: a Vector, List, ArraySeq, Array, Buffer, Deque and Range of equal elements compare equal with == and hash alike, with one comparison and one hash written once on Seq for them all. == between two sequence types needs the same element type on both sides (a Vector[int] and a List[string] are a compile-time error, as any two types with no common type are); a value typed as Seq[T] compares with any sequence. A class that implements Eq itself keeps its own equality between two of its instances. Settled (user, 2026-11-04): through Any and trait-typed values sequences of equal elements in order are equal whatever their class, with hashes that agree (val a: Any = [1, 2]; a == List(1, 2) is true); the elements are compared as Any values are, so [1] == ["a"] held as Any is false. An Array is a Seq here and compares by contents, as it already did. The mutable Array, Buffer and Deque compare as they are when the comparison runs, so a hash held across a change is stale, as it was before.

  • Settled by the user 2026-11-04: Ranges of other integer types are NumericRange[T: Integer]. Range stays the int range, and a bare Range in a signature means it. a..b and a..<b written as values make a NumericRange[T] where the bounds are integers of any type other than int (long, i8, i16, …); an integer literal bound takes its type from the other bound, and bounds of two types are an error. by takes a step of the same type, T. It is a Seq[T] with the Range rules: a zero step traps, a range is empty when its start lies past its limit in the step’s direction, and iteration stops without stepping past the limit, so it never passes either end of T. get, apply, head, contains and isEmpty are answered from the bounds and never wrap, at any width; length() traps beyond int, and last() and the other questions that count the values trap for a range whose ends are more than the largest long apart (the smallest long to the largest), which only a range of longs can be. for over a range written in place already counted any integer type, and still does.

  • Settled by the user 2026-11-04: Value definitions in a for with yield (for comprehensions): pattern = value after a generator, each with its own if guards, written with no val, and never first. It is evaluated once per element that reaches it and binds in what follows. Where no guard follows, it is a val in the function passed to its generator’s source; where a guard follows, it and the definitions before it after the same generator pair each element with its value through the source’s map, so it is evaluated for every element before that guard tests any, and over a set or map the pair has to be hashable. A definition may not rebind a name its generator or an earlier definition after it binds; a later generator may. Settled on the user’s delegation 2026-11-11 as no longer open: built and pinned at -O0 and -O2 by tests/run/for_yield_definitions.avin and tests/run/spec_collections_comprehensions.avin.

  • Settled by the user 2026-11-04: Comprehensions over the mutable collections (for comprehensions): a mutable Set and Map have withFilter, a lazy view as the immutable ones have, and a mutable Map a map over its entries as pairs, so the first source’s kind decides the result as elsewhere: a new mutable set or map, as an Array, a Buffer or a Deque gives a new one of its own kind, the source unchanged.

  • Settled by the user 2026-11-04: avin.process (system library): args() -> Vector[string] holds the arguments after the program’s name, and programName() gives the name separately; env(name) is an Option[string]; exit(code: int) -> Nothing flushes standard output first, as a trap does. Arguments are checked as UTF-8 at startup. A test run by avin test sees no arguments. main may take the same vector: main(args: Vector[string]) (settled above).

  • Settled by the user 2026-11-04: avin.fs and avin.io (system library): IoError, shared by every module that does input or output, lives in avin.io as a plain data type with the variants NotFound, PermissionDenied, AlreadyExists, IsADirectory, NotADirectory, DirectoryNotEmpty, InvalidUtf8(offset: long) and Other(text: string), and a message() sentence. avin.fs reads and writes whole files (readText, readBytes, writeText, appendText, writeBytes, appendBytes), asks exists, isDir and isFile, and makes and removes (createDir, createDirAll, createTempDir, remove, removeDir, removeDirAll), each failure an IoError in a Result. Writing replaces a file and appending creates one; createDirAll accepts a directory already there and removeDirAll a path already gone. listDir(dir) -> Result[Vector[string], IoError] answers the entries’ names, without the directory and without . and .., sorted by code point, so two listings of an unchanged directory agree.

  • Settled by the user 2026-11-04: Standard input and error, in avin.io beside IoError (system library): standard input as text through readLine() -> Option[string], lines() -> Iterator[string] and readAll() -> string, sharing one runtime-held buffer. A line ends at \n with a \r before it trimmed; the last line needs no terminator. Ill-formed UTF-8 becomes U+FFFD and a failed read ends the input, so reading standard input answers no IoError, where fs.readText answers InvalidUtf8. eprintln(x) mirrors println on standard error and is in the prelude with StandardError, an unbuffered Writer; every write to standard error flushes standard output first. A test run by avin test reads empty input.

  • Settled by the user 2026-11-04: Running and testing (stage 10): avin run <program> [-O0 | -O2] [-- args] builds into .avin/build/ in the program’s directory, reuses the executable while nothing it was built from has changed, and exits with the program’s status, or 128 and the signal’s number for a trap. Its arguments reach the process; reading them is avin.process‘s, in the system library. A test is a top-level @test function of the program, in any module, taking nothing and yielding unit, named by the function or by @test("a sentence"); a program built for its tests need not have main. run is the default command and the current directory the default program: avin is avin run ., avin <path> ... is avin run <path> ... when the first argument is not a command name, and the commands taking a program default it to .. A command name is always the command; a path that spells one is reached as ./test. avin test‘s first argument is the program when it names an existing path and the filter otherwise. avin test [<program>] [filter] builds one executable and runs each test in a process of its own, so a trap stops only that test, reporting ok or FAIL per test grouped by file, the reason and the test’s output under a failure, and N passed, M failed; it exits 1 when any failed. The core library’s assert(condition), assert(condition, message) and assertEq(actual, expected) (with Eq and Debug bounds, showing both values’ Debug forms) trap at the assertion’s place.

  • Settled by the user 2026-11-04: Test attributes, hooks and @tests files (declarations), following Sysl’s model:

    • A test yields unit or a Result[unit, E] with E: Display; an Err fails it, reading test answered Err: <error> at the test’s name.
    • @test‘s arguments: a description first, then should_trap (alone, or with text the run’s output must contain), timeout: N (whole seconds, 0 to 2147483, 0 for none, in place of the run’s 60) and ignore: "reason" (required and not empty), each at most once. should_trap is satisfied by a trap, not by a non-zero exit. An ignored test starts no process and runs no hook, and the summary adds , K ignored when K is not 0.
    • Hooks @setup, @teardown, @setup_all, @teardown_all, at most one of each per module, top-level, taking and yielding nothing. @setup runs in the test’s process; @teardown there after a test that returned and in a process of its own after one that trapped or timed out (not after a failed @setup); the _all pair each in a process of their own, around the module’s selected tests that are not ignored. A failed @setup fails its test unrun; a failed @setup_all is a failure of its own and fails each of the module’s tests unrun, and skips @teardown_all; a failed @teardown or @teardown_all is a failure of its own.
    • @tests files are checked by every command and built only by avin test: their module-level values are not computed in a program that runs. Only a @test function, a hook (a lambda in either counting as it) or another @tests file may name what one declares; an impl in one is for a type or of a trait it declares; main is not declared in one.
  • Settled by the user 2026-11-04: Format specifiers (strings and formatting):

    • Integers are signed in every base: %x, %X, %o and %b write a negative value as - and its magnitude’s digits (${-42}%x is -2a), so the text does not depend on the value’s width, and + and the space flag apply to them as to %d. There is no %u; it is refused with a pointer to %d.
    • A flag that changes nothing under its conversion is an error, as is a precision under %c. %s refuses the numbers (integers, byte, real), which have conversions of their own; it takes every other Display value.
    • %s counts characters: its width and precision are characters, not bytes, as every Display width is.
    • Only a % right after a hole is special: there is no %% escape; % anywhere else, doubled or not, is text.
    • A count written as a hole is an integer of any width, not a byte; a negative width pads on the right, a negative precision is none, and a count beyond int is the largest int (FormatSpec.withWidth, withPrecision).
    • StringContext.f, called directly, reads its specifiers as it runs: a malformed one, %? (its arguments are Display values) and a count that is not an int or a long trap; a value under a conversion its type does not take renders in its own form.
  • Settled by the user 2026-11-04: The core library’s own tests (tests): they live in library/tests, as a package’s live in its tests directory, and are an ordinary program of @test functions in its root module, which avin test library/tests runs and the compiler’s gate runs at -O0 and -O2. They test the library through its public names, as a program sees it. The directory is no part of the core library every program is compiled with, and a @test in the core library’s own modules, like one in a dependency, is never a program’s test.

  • Settled by the user 2026-11-04: A collection added to itself (collections): b.addAll(b) and b ++= b on a Buffer or a Deque append the elements it held when the call began, once, and s --= s on a mutable Set empties it.

  • Superseded 2026-11-05 by the dates and times entry that follows; kept as it was. Settled by the user 2026-11-04: avin.time: Duration, Instant (monotonic) and WallTime (wall clock, a Duration since the 1970 epoch) are data types counting whole microseconds in a long, overflow trapping; the two clocks are distinct types so their readings never mix. A duration implements Add, Sub, Neg, and scales by a long with its methods * and /; a reading combines with a duration through its methods + and -, and two readings of one clock through - (or since), which yields their Duration. The text forms are a duration’s largest-unit form (1.5ms) and an ISO 8601 UTC timestamp. Sleeping and calendar fields beyond the timestamp text are not part of it yet.

  • Settled by the user 2026-11-05: dates and times (avin.time) follow slate’s date/time design with Avin’s spellings (types PascalCase, functions lowerCamelCase). Eight types: Instant (a point on the timeline, microseconds since 1970 UTC, displayed as ISO 8601 with Z; it replaces WallTime), Duration, Date (a calendar date with no zone; no Local prefix anywhere), Time (a time of day), DateTime (a date and a time, no zone), Zone, Zoned (a date-time in a zone, the only zoned type) and Period (months and years). There is no monotonic Instant: monotonic() answers a Duration, a monotonic reading naming no point in time, and an elapsed time is monotonic() - start. Makers: now(), monotonic(), date(y, m, d), time(h, m, s), dateTime(…), zone("America/Toronto"), localZone(), and utc, a value rather than a call; epochSeconds, epochMillis and epochMicros to and from counts; the durations micros millis seconds minutes hours days weeks, also as methods (2.hours); the periods months and years. The implementation binds with @sysl over Sysl 0.10.0’s sysl.time (Date, Time, DateTime, YearMonthDay, Offset, Weekday, Resolution, Zone over sysl.time.tzif with offset_at and resolve, Zoned, Period), with the system clock and the local zone from sysl.posix.time, and no new C. The choices the design makes beyond these are under Proposed.

  • Settled by the user 2026-11-04: Bindings to Sysl packages (packages, bindings): a manifest names the Sysl packages its bindings reach in a block of its own, sysl-dependencies, beside dependencies, each entry written as an Avin dependency is (git with version or rev, or path; never workspace). The block is separate because Sysl, not Avin, resolves, fetches and verifies those packages: they are not Avin packages, so they take no part in Avin’s version selection, avin.sum, avin add or avin tidy. The shim package’s manifest lists every Sysl dependency of every package in the program, so a library’s bindings build in any program that uses it; one name at two releases of one coordinate takes the higher, and one name with any other two origins is refused naming both. A fetched package may not name a Sysl directory. The shim archive and the cached executable are keyed by these entries and by the sources of each Sysl package named by directory. Sysl’s other dependency keys (mount, features, options) are not offered yet.

  • Settled by the user 2026-11-04: The rest of the system library (system library), each module following the reference standard library’s names and shapes where Avin’s rules allow:

    • The environment and the platform are functions of avin.process, beside env, not a module of their own: environment() as a Map, currentDir, homeDir, executable, processors, pid and os(). There is no property store and nothing sets a variable; a child’s variables are set on its command. Bindings: sysl.fs.current_dir and home_dir, sysl.env.current_exe, sysl.process.pid (a u32, which fits a long), sysl.os through a mirror of sysl.Os, and the runtime’s processor count. environment() needs sysl.env.vars, which answers a Buf of pairs: it waits for tuples as a boundary type, a stage-7 addition.
    • Commands in avin.process: a Command value, combined with | (a pipeline), andThen, orElse and followedBy, redirected with toFile, appendTo, fromFile and withInput, and run by run() (the exit status), output() (the text, any status but success an Err), lines() (an iterator as output arrives) and start() (a Child). Importing the module adds run() and output() to string. Operators Avin cannot define: postfix ! and !! (no method is called postfix, and ! is the language’s), and the spellings with # (# was no operator character when this was built; it is one since branch lazy-cons-operator, and the words stay), so #| is |, and #&&, #||, ###, #>, #>> and #< are words; run() is the status, where the reference’s run() starts the process, which here is start(). Bindings: sysl.process.spawn and pipe, with a mirror of Stdio holding a sysl.fs.File handle, Spawned a handle waited for blocking, Status mirrored as ExitStatus itself, Var, sysl.fs.create, append and open for the redirections, and sysl.io.FdReader for lines(), which answers bytes as they arrive.
    • Source in avin.io: fromFile (read whole, every failure up front), fromString, stdin(), and lines(), chars() and readAll(), each consuming. The reference’s getLines and mkString are lines and readAll, the names avin.io already uses. No new binding: it is written over fs.readText and standard input’s buffer, with one runtime entry taking a character from that buffer for chars(). Not blocked.
    • avin.random: a Random class (Random(seed) reproducible, Random() seeded by the platform) with nextInt, nextLong, bounded forms, between, nextReal, nextBoolean, nextGaussian, nextBytes, alphanumeric, shuffle and setSeed; the companion’s methods use one shared, locked generator. PCG32, written in Avin with the wrapping operators, so a seed gives the same sequence everywhere. Binding: one runtime function for the platform’s seed over sysl.posix.rand.seed_from_os, since a u64 above long.MaxValue traps at a binding’s result; it answers the entropy’s top 63 bits. nextGaussian uses avin.math‘s sqrt and log.
    • avin.net: TcpStream and TcpListener; Url, parsed and percent-encoded, written in Avin; an HTTP/1.1 client (get, post, send with a Request) written in Avin over the TCP stream, a status never an error. IoError gains ConnectionRefused, ConnectionReset and TimedOut. Bindings: sysl.net.resolve, socket and the Socket methods, held as an opaque handle (a Socket, and the Address it connects to, are not boundary types). Url needs neither. https takes a Sysl TLS package, named in the library’s sysl-dependencies and bound as any package is; opaque handles and bindings to Sysl packages beyond the standard library are both in the compiler.
    • Concurrency stays in avin.threads; there is no separate concurrency module. The reference’s futures map onto what is there (successful, all for sequence, first for firstCompletedOf, await for waiting with a time limit); added are Future.traverse, mapErr and orElse on a future of a Result (its recover and fallbackTo), an Executor for pools of one’s own (its execution context, chosen explicitly), threads.blocking(body) and threads.sleep(d). There is no failed or filter, since a future carries no failure. Bindings: none beyond a runtime timed wait for sleep. Not blocked.
    • JSON is a package of its own, not part of the system library: the package dev.avinlang.json (settled by the user 2026-11-13; see that entry).
  • Settled by the user 2026-11-04: Lower bounds and the expected type (generics): the expected type decides a lower-bounded type argument only where it admits the bound; otherwise the argument is inferred from the bound and the arguments, and the result is passed as any value is. So println(m.getOrElse(k, "none"), n) on a Map[string, string], where each argument expects a Display, takes W as string rather than reporting Display as no supertype of string. A delayed (by-name) argument widens an open lower-bounded type argument as any other argument does: cats.getOrElse(k, dog) is an Animal. Both keep programs working that called the methods before they took [W >: V].

  • Settled by the user 2026-11-04: Trait fields (declarations): a trait’s field declares its type, since each conforming class’s layout and the trait’s val are known before any body is checked; it is public, as every member of a trait is, and is never lazy. A class never overrides a trait’s field, val or var: declaring a field of its name is an error rather than an override. A trait never redeclares, with a value, a val of a trait it requires.

  • Settled by the user 2026-11-04: The wrapping conversion is spelled i8.wrap(x), as the wrapping operators are spelled +%: the integer type’s name, .wrap, one operand, any integer target (a bounded type parameter included, T.wrap(n)). The core library needs it to test whether a value fits a narrower width (the formatter converts a generic integer to long and back).

  • Settled by the user 2026-11-04: avin.regex: the pattern language and its matching follow the established backtracking dialect exactly: leftmost-first alternation, greedy, reluctant and possessive repetition, atomic groups, bounded lookbehind (a repetition without an upper bound in one is an error), and the same rules for what a repeated group captures; \d, \s, \w, \b and the POSIX classes are ASCII unless U makes them Unicode’s, and i folds only ASCII without u. Matching walks characters (scalar values); every offset in the API is a byte offset, and a PatternError‘s index counts the pattern’s characters. There is no null: group(i), group(name), before(i), after(i) answer Option[string], subgroups() a List[Option[string]], and start(i)/end(i) -1 for a group that took no part. Members without arguments are methods ("a+".r(), m.start()). Regex(p) traps on an invalid pattern with the error’s message and Regex.compile(p) answers a Result[Regex, PatternError]; a group number or name the match does not have traps. Scripts, blocks, the binary properties beyond the general category (Alphabetic, Uppercase, Lowercase, Ideographic, Word, Alnum, emoji), the flag U, \X and \b{g} answer from tables generated from the Unicode Character Database, of the version the general categories come from; the flag c and \N{…} are refused with an Unsupported error. Replacing and splitting follow the same dialect: replaceAllIn (a replacement, or a (Match) -> string whose result is read as one), replaceFirstIn, replaceSomeIn, split answering an Array[string] with the empty pieces at the end dropped, Pattern.split(s, limit = 0), Regex.quote and Regex.quoteReplacement; $n takes digits while they name a group, ${name} is the pattern’s own name only, and a reference that cannot be resolved traps with the dialect’s message.

  • Settled by the user 2026-11-04: Extractor patterns (control flow): Name(p…) names a variant wherever one of that name is in scope, and only otherwise a value (an object, a companion, a local) whose type has unapply or unapplySeq; where it has both, unapply is used (the methods are now found through the extractor traits, settled 2026-11-19 below). unapply answers a bool, matched with no patterns (Even()), or an Option, one pattern matching its value whole and several a tuple’s parts. unapplySeq answers an Option of a sequence, matched as a sequence pattern; the prefix-and-sequence form is not taken. The matched value is passed to the method as it is, with no type test first, so the method’s parameter accepts the matched value’s type. An extractor pattern never counts toward exhaustiveness, and since a binding’s or a for‘s pattern must cover every value, extractors appear in match, is, clauses and match functions only.

  • Settled by the user 2026-11-04: Rest patterns (collections): rest* or _*, last in a sequence pattern or an unapplySeq extractor’s patterns, binds what the patterns before it leave: on a list the tail, so [] and [head, tail*] cover every list; on another sequence what drop(n) answers, a Vector, and there too sequence patterns count lengths, so [] and [head, tail*] cover every sequence. [rest*] alone is the whole sequence, of its own type.

  • Settled by the user 2026-11-04: A regex as an extractor (regular expressions): Regex.unapplySeq(s) answers the groups’ texts as a List[string] where s matches as matches asks, the whole of it or, unanchored, any part. A group that took no part gives the empty string, since a string has no null. Groups, a top-level object of avin.regex, takes apart any Match‘s groups, None for a pattern with none. There is no unapplySeq taking a Match on Regex itself, which would need a match to know the regex that found it.

  • Settled by the user 2026-11-04: Sysl handles (Sysl bindings): a class declared with @sysl naming a Sysl type has no parameters, fields or constructor and is made only by a binding that returns it, directly or as the value of an Option or Result. A method without a body is bound to the Sysl method of its name’s words in snake_case, or to the one its own @sysl("name") names. Every handle has close(), which gives its counted reference back and does nothing a second time; a bound method on a closed handle traps at the call with “Name is closed”; a handle never closed is given back by a finalizer when the collector frees it. A handle compares by identity, and has no Display. Settled by the user 2026-11-04, replacing “a collection of handles does not cross” and “a handle crosses back into Sysl only as the receiver of its own methods”: a binding’s result may also be an Array or Vector of handles, also inside an Option or Result, made from a Sysl slice or Buf, each element a handle of its own with its own reference and finalizer. A handle by itself goes into Sysl as the receiver of its own methods or as a parameter of any binding or bound method; a closed one passed traps at the call as a bound method on one does. A handle inside an Option or a collection still does not go into Sysl. Settled by the user 2026-11-04: how a handle is passed to a Sysl parameter. The shim cannot see the Sysl parameter’s type, so it lets Sysl choose: a trait, always held by a counted reference, is passed as the handle’s reference, which the parameter shares; any other type is passed as the parameter’s type asks of a generic helper, by value (a copy), as a pointer to the handle’s own value, or at a &T as the handle’s own counted reference, which the parameter shares. A *T parameter of a type with a destructor is refused by Sysl at the binding. Revised on the user’s delegation 2026-11-05 (branch sysl-091): from Sysl 0.9.1 the helper settles at the &T, so a type with a destructor needs no arm of its own and the shim tells only a trait apart; under 0.9.0 a &T parameter of a type without a destructor received a reference to a copy. Since Sysl now checks the helper’s body against the parameter’s type, each handle parameter of a binding and each handle field of a mirror has helpers of its own, written among that binding’s or mirror’s lines of the shim, so a handle Sysl does not take there is reported as the binding or the mirror not matching, in the handle’s and the place’s Sysl types, and no diagnostic names the shim’s functions (the reject corpus checks that none does). Alternatives weighed: one helper per handle type, reported at the handle class (which names neither the binding nor the parameter at fault); explicit type arguments at each call (the shim cannot see the Sysl parameter’s type). Settled by the user 2026-11-04: a handle is never used by two threads at once, since its counted reference’s count is not atomic. Each handle records an owner, and every use (a bound method, the handle passed as a parameter, close()) compares it with the running code’s and traps with “Name belongs to another thread” where they differ. The owner is an execution context the runtime can hand over, not an operating system thread: a thread’s body, a pool task whichever worker runs it, and later an actor, re-pointed to whichever thread runs it, so an actor’s handles never trap between its messages; the check is one compare with a word of the running thread’s context, which the runtime sets. Ownership moves: what a thread’s or a future’s body reaches that the caller owns becomes the body’s at its start, and the caller’s later use traps; when the body returns, what it was given and what it returns are in transit, as are a future’s value and what a callback registered on one reaches, and the first code to use a handle in transit takes it. The finalizer never checks: it runs only on an unreachable handle, on the collecting thread while the others are stopped. Settled by the user 2026-11-04, replacing “no mirror holds a handle”: a Sysl mirror’s field may be a handle, by itself (not in an Option, a collection or a tuple), so that Sysl’s sysl.process.Stdio reaches Avin with its ToFile(file: File) and FromFile(file: File). Into Sysl the field is passed exactly as a handle parameter is, its reference shared for a type with a destructor and otherwise a copy or a pointer as the Sysl field asks, with the same traps at the call: “Name is closed” and “Name belongs to another thread”. Out of Sysl, which needed nothing more, each such field becomes a handle of its own, as a handle result does.

  • Settled by the user 2026-11-04: Tuples cross the Sysl boundary (Sysl bindings). A tuple of boundary types is a Sysl tuple of the same arity, in each direction, each part converted as it would be alone: an integer part out of Sysl takes any Sysl integer with the range check, and tuples nest in one another, in Option, Result, Array and Vector, and in a mirror’s fields. A handle may be a part of a tuple that is a binding’s result or the value of its Option or Result, so accept answers Result[(Socket, Address), IoError]; a tuple holding a handle does not go into Sysl or sit in a collection. avin.process has environment() over sysl.env.vars.

  • Settled by the user 2026-11-04: Text blocks under an interpolator that reads no escapes (text blocks). The parts raw"""…""" and a program’s own interpolators are given have the block’s indentation and trailing blanks dropped but no escape read, and since joining a line with \ is an escape, no line joined: the \ and the line break after it reach the interpolator as written. s and f join lines in the lexer. A backslash directly before a quote or a backslash is taken with it under every prefix, so \""" does not end a raw""" block and \\""" does, as raw"…" does not end at \" and does at \\".

  • Settled by the user 2026-11-04: A block’s first """ closes it (text blocks), so """" is the end of the block and a stray quote; a block ending in a quote writes it \".

  • Settled by the user 2026-11-04: avin.random‘s details (system library), where the chapter left them open, so that a seed’s numbers are fixed:

    • Every generator uses PCG32’s stream 54 (increment 109), the reference implementation’s demonstration stream, so Random(42).nextInt() gives its published first output, 0xa15c02b7 (as an int, -1587805513). Seeding is the reference’s: one step from zero, the seed added, one step more.
    • nextLong is two draws, the first the high half; nextBoolean is a draw’s top bit; nextReal is a 64-bit draw’s top 53 bits over 2^53; nextInt(n) rejects 32-bit draws below 2^32 % n, and nextLong(n) and between on long reject 64-bit draws below 2^64 % n; between on int is nextInt of the span where it fits an int, and nextLong of it otherwise.
    • between on real draws min + nextReal() * (max - min) again while it rounds up to max, and traps on a NaN bound and where max - min is infinite, besides min >= max.
    • nextGaussian is the polar method, keeping the second value of each pair for the next call; setSeed drops it. nextBytes takes four bytes from each draw, lowest first; a negative count traps. alphanumeric draws nextInt(62) per character, digits, then upper, then lower case.
  • Settled by the user 2026-11-04: avin.regex: \b{g} decides a boundary by the grapheme cluster rules over the whole text before it, so it is never inside a cluster: not between the two regional indicators of a flag, nor inside an emoji joined by a zero width joiner or an Indic conjunct. \X matches the cluster starting where it stands, one way only, and has no bounded length, so a lookbehind may not hold it. A script is named by any of its names in PropertyValueAliases.txt, ignoring case, and only the scripts Scripts.txt lists, with Unknown, exist; a block by its name in Blocks.txt, that name without spaces, or any of its names in PropertyValueAliases.txt, short ones included, ignoring case.

  • Settled by the user 2026-11-04: blocking bindings: a binding whose Sysl call may wait is written @sysl("module.name", blocking), and a handle’s method bound by its own name @sysl(blocking); blocking is a bare word, written once, and nothing else follows the name. The shim converts every argument and takes a handle method’s own share of the Sysl value, then marks the thread safe for the collector, makes the call, marks it running again (waiting out a collection in progress) and only then converts the result; bytes a handle’s method answers are copied into Sysl memory before the thread leaves the safe region. A blocking call therefore never reads or writes the Avin heap, and an argument that is a pointer into it, such as a buffer Sysl fills, would need its object held by a frame for the whole call.

  • Settled by the user 2026-11-04: Url follows RFC 3986 as the established library’s URI does, beyond the first design: user information; IPv6 hosts in brackets, with a zone; base.resolve(ref) by section 5.2, dot-segment removal included; withScheme, withUserInfo, withHost, withPort, withPath, withQuery and withFragment; and a trapping Url(text) beside Url.parse(text), as Regex(p) beside Regex.compile(p).

Actors and state machines (actors and state machines), settled by the user 2026-11-04 as written. They answer the open questions on how actors and machines work and whether their words are reserved.

  • Settled by the user 2026-11-04: Messages are checked by Sendable, a trait the compiler decides for each type from its structure and that is written as a bound; ActorRef[-M: Sendable] makes the check once, where a message type is named, never at a send. An actor’s parameters and every type ask and adapter carry are sendable too.

  • Settled by the user 2026-11-04: What is sendable: the scalars, unit and string; tuples and data of sendable fields; the immutable collections of sendable elements; a final class or an object with no var field and only sendable fields; a trait declared : Sendable, each implementor checked; ActorRef, Behaviour, and Future, Promise, Channel and Atomic of a sendable type; Mutex of any type (the one deliberate door to shared mutable state); Once; Sysl handles; Isolated[T]. Not: arrays, buffers, deques, mutable maps and sets, classes with a var or an open or abstract class, machines, function values (their captures are not in their type) and Any.

  • Settled by the user 2026-11-04: Ownership transfer. A Sysl handle in a message is put in transit by the send and taken by its first user, the receiver; the sender’s later use traps, through the handle’s owner check. A mutable object graph moves as an Isolated[T], made by isolate(body): the compiler checks the body reads only sendable values from around it and that nothing it calls, transitively, reaches module-level mutable state; take() gets it out once (a second take traps) and with(f) works on it in place under the same check.

  • Settled by the user 2026-11-04: Declaring an actor: actor Name[T](params) receives M; the body runs once at the actor’s start and holds its fields; receive holds match arms over M, checked for exhaustiveness; methods are private helpers; self is the actor’s ActorRef[M], and the object holding its state is never a value.

  • Settled by the user 2026-11-04: Behaviours and spawn: Counter(0) is an immutable Behaviour[M], and spawn(behaviour, onFailure = Escalate, executor = Executor.shared()) starts it and answers an ActorRef[M], in avin.actors. Code an actor runs starts a child; code elsewhere a top-level actor.

  • Settled by the user 2026-11-04: tell and the mailbox: tell(message) never waits and never fails (no !, which is reserved); the mailbox is unbounded; one sender’s messages to one actor arrive in order; a message to an ended actor is dropped. (Revised 2026-11-19, branch bounded-mailbox: unbounded unless the actor is spawned with a Bounded mailbox, a full one’s tell dropping by its overflow policy, and AskError gaining Full; the entry under Actor patterns.)

  • Settled by the user 2026-11-04: ask is ask(make: ActorRef[R] -> M, timeout: Duration) -> Future[Result[R, AskError]], the timeout required, AskError being TimedOut or Ended; reply addresses are ordinary ActorRef[R]s; adapter(f) makes a reference translating another protocol into the actor’s own; pipeToSelf(future, f) delivers a future’s value as a message.

  • Settled by the user 2026-11-04: Supervision: a trap in an actor fails only that actor, its frames unwound and the trap reported with the actor’s name, except while it holds a Mutex, runs a Once, initializes a lazy val or is inside a Sysl call, where the program stops. Supervision is Escalate (the default: the parent fails, and a top-level actor stops the program, so an unsupervised program behaves as one with threads), Stop, or Restart(limit, within), re-running the body from the same behaviour with the mailbox kept. There is no resuming with the old state.

  • Settled by the user 2026-11-04: Lifecycle: stop() ends the actor after the current message, dropping its mailbox; stop(child) only for its own children; children end first; a stopping block runs at every end and restart; watch(ref, message) and watch(ref, f: Ending -> M) deliver the end into the watcher’s own mailbox, Ending being Stopped or Failed(reason); ref.ended() is a Future[Ending] for code outside actors; an actor is not collected while it runs; the program ends when main returns.

  • Settled by the user 2026-11-04: Timers: after(delay, message) and every(interval, message) answer a cancellable Timer, queued like any message and cancelled when the actor ends or restarts.

  • Settled by the user 2026-11-04: Scheduling: actors are tasks on an Executor (the shared pool by default); an actor runs on one thread at a time, each message’s handling happening before the next’s; a worker handles at most 16 messages of one actor before re-queuing it; the worker repoints its context’s owner word to the actor so the actor’s handles never trap; a waiting actor is replaced in the pool as a waiting future is; tell happens before the handling of its message.

  • Settled by the user 2026-11-04: Machines: machine Name receives E with state S(params) blocks; an arm’s value is the next state, or stay; the first state, without parameters, is the start; enter and leave run on every transition (a state yielded again included) and not on stay; receive holds arms shared by every state, tried after the state’s own; the compiler checks every state handles every event; handle(event) answers the new state and state() the current one, of the generated Name.State data type; a machine is not sendable, and handling an event from inside its own handler traps.

  • Settled by the user 2026-11-04: An actor’s behaviour is a machine: an actor’s body takes the same state blocks, its messages being the events, with the same checks; a restart starts it again in its first state.

  • Settled by the user 2026-11-04: Keywords are contextual: actor and machine only where a declaration starts, receives only in their headers, and state, receive, enter, leave, stopping and stay only inside their bodies at the start of a line (stay as an arm’s value), so state stays an ordinary name elsewhere.

  • Settled on the user’s delegation 2026-11-05: Handing a handle over explicitly (Sysl bindings). The spec has no spelling for it. Proposed: handOff(value: Any) in avin.threads, putting every handle value reaches that the running code owns in transit, for the next code to use it; and Channel.send doing the same with what it sends, which it does not do now because handing a value over walks it, and a channel of plain values should not pay for that (the compiler would skip the walk for a type that cannot reach a handle). Review with the user: Channel.send walking each message to move handle ownership costs every channel; the compiler skipping the walk for types that cannot reach a handle is the mitigation.

  • Settled on the user’s delegation 2026-11-05: Executors (2026-11-04): Executor.fixed(n) keeps at most n tasks working at once and starts its workers as work comes, as the shared pool does, a worker waiting in await or blocking leaving its place to another; n below one traps. After shutdown(), ex.future(body) traps, while the map, flatMap and onComplete of futures already made on the executor still run there, on a worker started for them where none is left, so no future made before is stranded. Executor.shared().shutdown() traps, since every Future(body) runs there. ex.isShutdown() answers whether it was shut down. Future.successful, Future.all, Future.first, Future.traverse and a promise’s future belong to the shared executor.

  • Settled on the user’s delegation 2026-11-05: sleep (2026-11-04): a worker that sleeps keeps its place in its pool; a body that should leave it while it sleeps writes blocking(sleep(d)). Sleeping is a runtime function bound blocking over Sysl’s sleep, which waits out the whole duration.

  • Settled on the user’s delegation 2026-11-05: orElse on a future of a Result (2026-11-04): orElse[U >: T, F](other: -> Future[Result[U, F]]), widening the value as Result.orElse does. Future stays invariant, since its cell is a mutable field, so a fallback written in place as Future.successful(Ok(0)) needs its type stated where nothing else decides its error type. Future stays invariant: exempting object-private fields from the variance check (as the user had accepted) proved unsound here, because each set of type arguments has its own code and a method run through a wider view could store a value of the wider type in a field the narrower view reads (probe on branch private-variance, not landed). Sound alternatives, not taken now: dispatching a class with object-private members by the type arguments in its header, or reading type arguments from the object at run time. Review with the user: this reverses an accepted recommendation.

  • Settled on the user’s delegation 2026-11-05: Weighted choice in avin.random, approved in kind by the user 2026-11-04, the names and details proposed:

    • choose[T](items: Seq[T]) -> T is uniform (one nextInt(items.length())) and traps on an empty sequence. chooseWeighted(weights: Seq[real]) -> int answers an index and chooseWeighted[T](pairs: Seq[(T, real)]) -> T an item, the two overloaded by parameter type. Both are on Random and on the companion’s shared generator.
    • A draw is nextReal() times the total of the weights, redrawn while it rounds up to the total, and the answer is the first index whose running total is above it, so a zero weight is never chosen and a seed replays. The traps: no weights, a weight that is negative or NaN, an infinite weight, a total that overflows, a total of zero.
    • Weighted[T](pairs) holds the running totals and the items, built once; sample(rng: Random) -> T draws by binary search, O(log n), and size() is the number of items. It draws exactly as chooseWeighted would from the same generator state. The alias method (O(1) a draw, a different mapping of draws to items) was not taken: the cumulative table keeps one draw per sample and a mapping a reader can follow.
  • Settled on the user’s delegation 2026-11-05: Url‘s details (system library), where the design left them open:

    • Url is a data type whose host is an Option[string], None where there is no authority (mailto:a@b) and Some("") where it is empty (file:///etc); an IPv6 host keeps its brackets; userInfo, query and fragment are Options like port.
    • Components are kept as written, escapes and all; Url.decode is the way to their text.
    • parse holds the scheme and host in lower case and a default port as None, so == compares the normalized URL and display needs no work of its own. Defaults are 80 for http and ws, 443 for https and wss, and portOrDefault() answers an Option[int], None for a scheme with no default.
    • Escapes that do not decode to UTF-8 make text no URL (InvalidUtf8), at parse and in each with method, so queryParams keeps the plain Vector the design gives it; Url.decode answers a Result.
    • queryParams reads + as a space and skips empty pieces; decode keeps +.
    • UrlError is MissingScheme, BadScheme, BadCharacter, BadPercent, BadHost, BadPort and InvalidUtf8, each but the first with the byte offset at.
    • A zone is accepted only as RFC 6874 writes it, after %25; hosts of a later form ([v7.x]) are accepted; characters beyond ASCII other than controls and spaces are accepted in any component and kept.
    • resolve(ref: string) answers a Result, the reference being text; resolve(ref: Url) takes one already read. The with methods take components as written and trap on one the URL cannot hold; each optional component’s method takes a value or an Option.
  • Settled on the user’s delegation 2026-11-05: Source is a trait, its three readers abstract, so a program can write a source of its own (text made as it is read, a socket later) and hand it to any function that takes one; the kinds avin.io makes are private classes reached only through Source.fromFile, fromString and stdin. The alternative is a final class whose kinds are fixed by the library.

  • Settled on the user’s delegation 2026-11-05: An override adds no bound to a type parameter of its own (declarations). Each bound an override, or a method implementing a trait’s, writes on its own type parameters is implied by the overridden method’s bounds on that parameter: one of them, a trait or class one of them conforms to, or Eq or Hash, which every type meets; it may keep, weaken or drop bounds. Why: a call through the base type passes any type argument the base’s bounds admit, so an added bound let a program that type-checked run the override at a type without the bound’s methods, which trapped or crashed. The alternatives were requiring the bounds to be exactly the same, which forbids a weakening that is harmless; and checking the bound at each call through the base, which a call cannot do, since it does not know which override it reaches.

  • Settled on the user’s delegation 2026-11-05: the methods an impl adds to an open or abstract class are variance positions, whatever its fields; the exemption stays for final classes whose fields are all immutable, data types and traits. Why: such a method is in the class’s method table, so a call through a wider view runs the copy for the object’s own type arguments, and (b: Box[Animal]).with(cat) on a Box[Dog] answered a Box[Dog] holding a cat, whose dog’s fields read past the object; the core library’s Vector had the hole. So Vector takes an element through a lower bound, as maps do: :+[W >: T](element: W) -> Vector[W], +:, ++, updated, and toArray[W >: T](), and Seq‘s added :+, +:, ++ and updated widen alike, so a vector’s own hides them. A vector’s iterator() and reverseIterator() are Iterator[T]s, and its guard view is the one every sequence has. The alternative, not taken: making an exempt impl method non-virtual, compiled for the receiver’s static type as a trait’s added methods are, which keeps :+(element: T) but would make an added method on an open class behave unlike a method written in its body.

  • Settled on the user’s delegation 2026-11-05 (built on branch avin-net): avin.net‘s TCP and HTTP details (system library), where the chapter left them open:

    • write, writeText, setTimeout and shutdownOutput answer Result[unit, IoError], since each can fail; readAll() is added beside read and readLine, and TcpListener has close().
    • A read, write or accept after close() answers Other("the connection is closed") (or “the listener is closed”) rather than trapping, as a closed handle’s method does.
    • A host that resolves to no address is Other(s"no address found for $host"), not NotFound, whose message speaks of files. A port outside 0 to 65535, and read(max) with max below one, trap at the call, as a Url‘s withPort does with a port it cannot hold.
    • ConnectionReset also covers a write to a connection the other end has closed (EPIPE).
    • setTimeout sets the read and the write limit together, in whole milliseconds rounded up; zero or less takes the limit away.
    • bind takes the host’s first address and lets a port a recently stopped listener used be taken again; the backlog is the platform’s usual 128.
    • The socket is a handle on sysl.net‘s own Socket, which closes its descriptor when its last copy goes (from Sysl 0.9.1; a runtime type wrapping it with a destructor did this before, and was removed on branch sysl-091); so closing the handle, or the collector freeing a forgotten one, closes the socket. The runtime turns sysl.net‘s errors into the four a connection tells apart (avin.rt.net_failure), the error crossing as a handle so that its variants do not join the module’s.
    • The HTTP client: a Response also has its reason; text() reads ill-formed UTF-8 as U+FFFD; Request is a class with method, url, headers, body and timeout, the last three defaulted; a method or header name that is not a token, and a header value with a line break, trap; Host, Content-Length and Connection: close are written unless the request gives them; an interim 1xx is skipped; redirects are 301, 302, 303, 307 and 308, the sixth answered as it is.
  • Settled on the user’s delegation 2026-11-05 (built on branch sendable): Sendable‘s promises, where the design left them open:

    • A declaration promises Sendable as it conforms to any trait: after : in a class’s or a trait’s header, or in an impl for a data type. The promise is checked against the structure, outside the standard library, and an open or abstract class that promises it is sendable, each subclass being checked. (Replaced by the Proposed @trusted_sendable entry, branch fix-core-promises: the library’s promises are checked too, but for the classes it marks.) The standard library’s promises are taken as made, since they are for types whose structure cannot show it: Future, Promise, Channel and Atomic of a sendable type (impls bounded by Sendable), Mutex of any type and Once (in their headers), and Vector of sendable elements. ArraySeq, List, Range, the hash and tree maps and sets, Option, Result and Either are sendable by their structure.
    • A generic trait that promises Sendable is sendable at sendable type arguments; a type implementing it has the parameters it passes to the trait, other than contravariantly, taken as sendable where it is checked, and is sendable at sendable arguments for them. The immutable Map and Set traits promise it, so HashMap[K, V] is sendable where K and V are, and a type implementing either is held to it.
    • Sendable is only a bound and a promise; it is not the type of a value.
    • A lazy val field is sendable where its type is, since it is initialized by exactly one thread. (That rests on the runtime initializing a lazy val once under contention, which the tests lazy_threads, lazy_threads_many and sendable_lazy pin: threads and futures reading one first together, counting a single run of each initializer.)
  • Settled on the user’s delegation 2026-11-05 (built on branch mirror-handle-fields): a mirror holding a handle goes into Sysl wherever any mirror does (Sysl bindings) — a parameter by itself, or inside an Option, a Result, a collection, a tuple or another mirror — since the shim’s conversion of the mirror checks and passes each handle field wherever it is called, though a bare handle in an Option or a collection still does not go into Sysl. The alternative is a mirror holding a handle only by itself, as a handle is.

  • Settled on the user’s delegation 2026-11-05 (built on branch tailrec): tail calls, the choices the request left open:

    • Every self-call in tail position is a loop, with or without @tailrec, at -O0 as at -O2, so a program’s stack use does not depend on its optimization level; the annotation only adds the proof. Alternative: loop only where @tailrec asks, leaving the rest to LLVM at -O2 — rejected, since the same program would overflow at -O0 and not at -O2.
    • The right operand of && and || is in tail position, as in the reference language: n == 0 || (ok(n) && f(n - 1)) is a loop. Alternative: only if/match branches — simpler to explain, but it refuses a common shape of predicate.
    • A call on another receiver of the method’s own type is a loop, the receiver becoming self for the next pass, as the reference language does for a method that cannot be overridden; a call on a receiver of the class at other type arguments is another instance and @tailrec refuses it. Alternative: only calls on self — it would refuse list-walking methods such as next.length(acc + 1).
    • A private method of an open or abstract class may be @tailrec, since nothing overrides it; a public one may not. There is no final modifier for a single method, so making a public method of an open class a loop means making it private or the class final.
    • @tailrec is accepted on top-level functions, methods and local functions, and is the one annotation a local function takes; a lambda cannot be annotated. It refuses a function with no recursive call, as the reference language does, rather than accepting it silently.
    • A function calling itself is made a loop; mutual recursion is left to general tail calls, which need every caller and callee to agree on a calling convention and to unlink the shadow-stack frame before the call, and have their own entry (below).
    • The language has no try, defer or finally, so there is no pending cleanup to take a call out of tail position; when such a construct is added, a call inside it is not in tail position.
  • Settled on the user’s delegation 2026-11-05: Iterable‘s transformations (collections), following the reference collection library (branch coll-followups). map, flatMap, filter, withFilter, collect and zip are added to every Iterable by impl[T] Iterable[T], each returning an Iterable (a Vector underneath) of the results in iteration order, so a program’s own class conforming to Iterable has them; the library’s collections keep their own of the same name and parameter types, of their own kind. To let Seq‘s, Set‘s and the other traits’ versions stand, an impl adding to a trait is passed over where an impl adding the same name and parameter types to a trait that requires it applies (declarations); impls on unrelated traits still clash. Why: the item asked for the members the chapter already claimed, and the impl is how every other Iterable operation is written. Alternatives: methods with bodies declared in the trait, dispatched through the object’s table, so generic code would get the concrete collection back at run time; that would make every collection’s map an override, rule out the bounded versions (TreeSet.map[B: Ord] cannot override an unbounded map[B]), and dispatch every call. The chapter’s earlier claim that generic code gets the concrete collection back is withdrawn. The review this entry carried, a Map receiver offering only its pair-making map, is superseded by the Proposed entry on a map’s map to other results (branch map-flatmap).

  • Settled on the user’s delegation 2026-11-12 (built on branch map-flatmap): a map’s map and flatMap to anything other than pairs answer a collection (collections), on the user’s direction that Avin adopt the conveniences of a rich collections library that add no complexity. m.map((k, v) -> Summary(k, v)), m.map(e -> e.0), a match function or a method value making non-pairs, and a comprehension over a map yielding non-pairs, guarded or not, answer Iterable[B] (a Vector underneath) in the map’s iteration order; a pair still makes a map of the receiver’s kind (HashMap through Map, TreeMap, the mutable ones). Every map has a map[B](f: (K, V) -> B) -> Iterable[B] overload beside its pair-making one, and the filtered views a comprehension’s guard makes have map[B] and flatMap[B] of one pair; a function of the entry as one pair reaches Iterable‘s own. To choose by the lambda’s body, overload resolution gains one rule (declarations): where the candidates left all give a lambda (or a match function) the same parameter types, known without the candidates’ own type arguments, and differ only in the result, the lambda is checked once with those parameters and an open result, and then fits as any typed argument does; of two that fit, the pair-making one is the more specific. WHY: one check of the body, with no speculative re-checking or rollback, settles the common shape exactly, and the rule is invisible where the overloads already agree. ALTERNATIVES: checking the lambda’s body against each candidate in turn and discarding the failures (general, but every check would have to be undone, captures and nested lambdas included); answering a Vector rather than an Iterable (handier to index, but Iterable‘s own map, which a one-pair function reaches, answers Iterable, and the two shapes of function should agree); a diagnostic suggesting .toVector first (the audit’s stopgap). Not done: a sorted collection’s map to an element or key that is not Ord is still refused naming the bound, rather than falling back to an unsorted result, since the sorted overload hides Iterable‘s of the same parameter types and the candidates are not held to their bounds while choosing. Review with the user: whether that fallback is wanted too, and Iterable versus Vector as the result.

  • Settled on the user’s delegation 2026-11-12 (built on branch map-flatmap): flatMap takes an option-making function on every collection, by an overload flatMap[U](f: (T) -> Option[U]) beside each collection’s own flatMap of a collection-making function, answering the same kind: Iterable (a Vector), every Seq, Vector, List, ArraySeq, Array, Buffer, Deque, Queue, LazyList (lazily), Iterator (lazily), Set, TreeSet, the mutable sets and bit set, and every filtered view a comprehension’s guard makes. A map’s takes ((K, V)) -> Option[(L, W)] into a map of its kind, and any other option into a collection (through Iterable‘s, or the filtered view’s own). Iterable[Option[T]] has flatten into a Vector, Iterator[Option[T]] into a lazy iterator. Option gains flatMap[U](f: (T) -> Iterable[U]) -> Vector[U], so a comprehension drawing from an option and then a collection yields a vector; one drawing from a collection and then options yields the collection’s kind. The lambda’s body chooses between the two flatMaps by the rule of the entry above. WHY: the overload is a library addition that every call path sees, generic code through Iterable included, and leaves options’ representation alone. ALTERNATIVES: making Option an Iterable of at most one element (impl[T] Iterable[T] for Option[T]), which was built and works, ++, concat and Iterable parameters taking options included, but the library’s Iterator[Iterable[T]] impl then views a type parameter through a trait Option conforms to, so the representation plan keeps every option of every program as an object rather than a bare pointer (an allocation per Some, and None read through Any changes); a conversion at the call (a mechanism Avin does not have). Not done: xs ++ maybe, concat and an option given for an Iterable parameter, which need the conformance; toList covers them. Review with the user: whether options as iterables are worth reworking the representation plan for, and the Vector from an option’s flatMap of a collection.

  • Settled on the user’s delegation 2026-11-05: rest* binds what drop(n) answers (collections), branch coll-followups. One rule for every n, n = 0 included: [rest*] binds drop(0), the list itself on a list and a Vector on a range, an array, a buffer or a deque, where it used to bind the scrutinee itself at its own type. Why: one rule the reader can predict, and a binding that never aliases a mutable array or buffer through a pattern that elsewhere copies. Alternative: [rest*] as the scrutinee, as before, which made the binding’s type depend on whether any element came before rest*.

  • Settled on the user’s delegation 2026-11-05: An empty collection literal joins to its siblings’ type (collections), branch coll-followups. Among the elements of a literal, the keys or values of a map literal, the branches of an if and the arms of a match, an empty literal ([], {}, or a literal holding one anywhere) is checked after the others and against the type they agree on, where nothing useful is expected (nothing, or Any), and where that type is a collection its literal shape can build. So [{1: [2]}, {}] and if c then {1: [2]} else {} are maps. Why: {} alone defaults to a set, and an invariant Set never joins a Map, so the sibling has to settle it before it defaults; the reference language gets the same result from inference. Alternatives: a join rule turning Set[_] into the other side’s map after the fact (the literal’s builder is already chosen by then), or asking for an annotation, as before.

  • Settled on the user’s delegation 2026-11-05: A range displays as written (collections), branch coll-followups: 1..5, 0..<10, 0..<10 by 2, the bounds as given, the step only where it is not 1; Debug the same, and a NumericRange the same. Why: it reads back as the expression that made it and costs nothing to render. Alternative: the elements, [1, 2, 3, 4, 5], as a vector shows, which hides that a range is a progression and is unbounded in size.

  • Settled on the user’s delegation 2026-11-05: Precision under %s and %? is the formatter’s (strings and formatting), branch coll-followups: the value is rendered with no width and no precision through writeDisplayed or writeDebugged, and its first N code points fill the field, for every type; renderers see a precision only under the other conversions. Why: the chapter promised it for every value and only strings honoured it; cut once, no renderer can get it wrong. Alternative: every renderer reading the precision, which each collection and data type would have to implement.

  • Settled on the user’s delegation 2026-11-05 (built on branch regex-hardening): avin.regex‘s limits on matching, backtracking with leftmost-first results kept:

    • The matcher keeps its own backtrack stack, an array of frames, so a repeated group over a long input takes no deeper a call stack however many repetitions it makes; only a part matched on its own (a repetition’s item matched one way, an atomic group, a lookaround’s body) takes a call, so the call depth follows the pattern’s nesting, never the input. Alternative: a linear-time engine — rejected by the request, as back references, lookarounds and leftmost-first captures need backtracking.
    • Each attempt at a start has a step budget, and spending it traps, the message naming the pattern and the input’s length and saying to make a repetition possessive or atomic. A step is an operation run or a backtrack frame popped; the budget is 1000 for each character of the input (plus one) times each operation of the program, never fewer than 10,000,000, about a tenth of a second of steps and far beyond what a pattern that backtracks only as far as its input asks takes. The budget is per attempt, not per search, so a search is never stopped for the number of starts it tries. Alternatives: answering a Result from every search — rejected, as it would make every findFirstIn and matches a fallible call for what is a defect of the pattern, which the trap’s message says how to fix; no limit (the earlier behaviour) — rejected, as one bad pattern hangs its program.
    • withStepLimit(n) sets an attempt’s budget (n above 0, or it traps), for a program that wants a tighter bound on untrusted text or a looser one for a pattern known to be slow; the trap’s message then gives the limit. Alternative: a global setting — rejected, as the budget belongs to the pattern.
    • Review with the user: whether a search should also have a non-trapping form for untrusted patterns (a Result-answering tryFindFirstIn, say), and whether the default budget’s constants are the right ones. A greedy, unbounded repetition of a group in a pattern without a back reference already remembers where a further repetition failed, so the textbook (a+)+$, (a|a)*b and (a|aa)+$ finish in polynomial time and do not trap; their reluctant, bounded and back-referencing forms are the ones that do.
  • Settled on the user’s delegation 2026-11-05: Guaranteed tail calls (branch tailcalls). Every call in tail position of a function of the program, by name, through a method table or of a function value, replaces the caller’s stack frame, at -O0 as at -O2, so mutual recursion, state machines of functions and continuation passing run in constant stack. A self-call is still a jump within the function, which is cheaper. @tailrec stays about self-recursion.

    • Every compiled function has LLVM’s tailcc convention, and a tail call is musttail call tailcc followed at once by its ret. The C convention is kept only where code outside the program calls in: main, a C-convention wrapper for each function whose address a Sysl binding’s shim is given, and the closure runner the runtime calls to start a thread.
    • Calls through method tables and of function values are tail calls too, since every address a table, a type record or a closure holds is a function of the program with its convention. A call the whole-program pass guards by the receiver’s descriptor returns from each of its branches.
    • The caller gives its shadow-stack frame back just before the call, as a return does. The arguments are then roots of no frame until the callee links its own, its first act, and nothing between the two allocates, polls or stores, so no collection can see the gap.
    • A call stays an ordinary one where an argument may point into the caller’s own stack (a local function given the address of a local it captures), where the core library calls the program’s code (it restores the caller site after), where the result is converted, and in a class’s constructor, which publishes its object after its body. A lambda or local function value that captures a local of its enclosing function is entered through an entry that keeps the local on its own stack, so that entry’s call adds one frame per call; capturing only parameters and values adds none.
    • Only a function whose arguments all travel in registers has tailcc: the context and at most five integers, bools or references, at most eight reals, and no integer wider than long as a parameter or the result. The rest keep the C convention and make and receive ordinary calls. Under tailcc the callee pops the arguments passed on the stack, and LLVM’s unoptimized code generation reloads spilled values from the wrong place after such a call (seen as crashes and wrong results at -O0); with every argument in a register there is nothing to pop. The limits are those of the smallest target (x86-64: six integer registers, eight vector ones), so a program’s stack use is the same everywhere. Review with the user: a function with six or more such parameters gets no tail call; lifting the limit means passing the extra arguments in a block the caller’s caller owns, or a fixed LLVM.
    • Alternatives weighed: merging each group of mutually recursive functions into one function that switches on which one is running (no convention change, but only for calls by name, and code size grows with the group); a trampoline in the library (no compiler work, but every tail call pays an allocation and an indirect return, and the program must be written for it).
    • Review with the user. Error backtraces lose the frames a tail call replaced; the user may prefer this only at -O2.
  • Settled on the user’s delegation 2026-11-05 (built on branch process-commands): How the parts of a command share its settings (commands). Proposed: a directory and variables set on a pipeline or a sequence are every part’s, a part’s own directory replacing it and its own variables added after (a name set twice has the last value). A time limit on a command made of parts bounds the whole, from when it starts: each program is given what is left, a part not yet started when it runs out is TimedOut without being started, and of two nested limits the earlier ends it. Output redirected on a pipeline is its last stage’s and input its first’s; on a sequence the file is opened once and shared, so the parts write one after the other and the second reads on where the first stopped. A part’s own redirection replaces the enclosing one, whose file is still opened (and so emptied by toFile), as a shell’s is. Why: each reads as a shell’s ( … ) with the setting outside it, which is what a reader expects. Alternatives: a limit given to each program afresh (a sequence of slow parts would never end), and a file opened per part (each part of a sequence would empty what the one before wrote).

  • Settled on the user’s delegation 2026-11-05 (built on branch process-commands): Input given as text, and output captured, go through files (commands). Proposed: withInput(text) writes the text to a temporary file, opened and unlinked before the program starts, and output() has the output written to a temporary file read once the command has ended. Why: a pipe the program feeds or drains while it waits is a deadlock once either side outgrows the pipe’s buffer, and a file never fills. The alternative is pipes served by a thread. output() decodes the bytes as lines() does, each ill-formed run replaced with U+FFFD, rather than failing with Io(InvalidUtf8); the alternative is the failure, which would lose the whole output over one byte. Review with the user: the decoding.

  • Settled on the user’s delegation 2026-11-06 (branch command-clear-env): A command’s environment: clearEnv, withoutEnv, withEnvironment (commands). A command keeps its environment changes as an ordered list (set, remove, clear), applied in the order called; on a joined command the command’s list comes before each part’s own. clearEnv() starts from an empty environment, withoutEnv(name) drops one inherited variable (an unset name is no error), withEnvironment(map) is clearEnv() then each entry. With only sets, the running program’s environment is left to Sysl’s inherit_env; once a list clears or removes, the whole environment is built from environment() and handed over with inherit_env = false. A bare program name after a clear is looked for on the PATH the command was given, or the system’s default path where none, never the running program’s: that is Sysl’s spawn rule, kept so a command never finds a program through a variable it was told not to have. Variables whose name or value is not UTF-8 are not passed once a command removes or clears (environment() passes them over). WHY: a daemon must start jobs from the submitter’s environment, not its own. ALTERNATIVES: a single withEnvironment only (cannot remove one variable cheaply); a settings pair of a base flag and a removed set (loses the order of calls, so clearEnv().withEnv(x) and withEnv(x).clearEnv could not differ); looking the program up on the parent’s PATH (a cleared command would still find programs by a variable it lacks). Review with the user: the PATH lookup rule.

  • Settled on the user’s delegation 2026-11-05 (built on branch process-commands), with one change: kill() and a started sequence (commands). Proposed: Child.kill() sends signal 15 to every program of the command still running and starts no part not yet started; waitFor() then answers Signalled(15) for a program it stopped. A started sequence starts its next part when waitFor() or isAlive() finds the part before it has ended, on the code that started it, which owns the processes; lines() over a command holding a sequence moves it on with a thread of its own, since its reader is waiting on the output. A pipeline holding a sequence is polled, its processes asked without waiting at growing intervals up to 16 ms, while a pipeline of programs alone is waited for without polling. Alternatives: signal 9, which a program cannot clean up after, or kill(signal: int = 15); every started command on a thread of its own, whose processes the starting code could then not stop, since a handle belongs to one thread. Settled: signal 15 as proposed. Changed: a started sequence must move on by itself, since a sequence that stalls until its starter asks is a surprise; a thread of its own will own the processes and drive the sequence, and the Child will ask it to wait or to kill through a channel, which keeps each handle on one thread. Until that is built the sequence moves on only when asked, as described. Review with the user: the signal.

  • Settled on the user’s delegation 2026-11-05 (built on branch core-followups): == and != on Any are decided at run time, as equality says: values of one type compare as that type does, by value or by identity, and values of different types, a reference and a value among them, are unequal. The sentence in Any and Nothing saying an Any had no equality was stale and is corrected. Rationale: every value has == and a hash, so any value can be a map key, a Map[Any, V]‘s among them, and the compiler already compared Anys through each value’s own entries. Alternative weighed: no == on Any, so that every comparison goes through a type pattern first, which breaks “every value can be a key”.

  • Settled on the user’s delegation 2026-11-05 (built on branch core-followups): === is defined only where its answer is: at least one side’s static type is a reference type that cannot hold a value type (a class, an object, an array, a buffer, a function type, or a type parameter bounded by a class). The other side may be the same type, a sub- or superclass, a trait the class conforms to, an Any, or a type parameter with no class bound; an Any or such a parameter is compared as an Any, and a boxed value there is never the object, so the answer is false. Two sides that may each hold a value type (traits, Anys, type parameters with no class bound) are an error, “=== is undefined on Shape and Shape, which may hold values with no identity; compare with ==, or give one side a class type”; so is a value type on either side. See identity. Rationale: a boxed or data value may be one object or two at the compiler’s choice, so trait-to-trait identity answered arbitrarily (f(Box(2), Box(2)) true and f(3, 3) false for f(a: Shape, b: Shape) = a === b), while a class instance is never a boxed value, so mixed class and trait is well defined. Alternatives weighed: rejecting any trait or Any operand, which needlessly breaks the library’s elements === self (a buffer, deque or set given itself as an Iterable); and keeping trait-to-trait identity, which is unsound. A class with a trait it does not conform to is rejected even when the class is open and a subclass might conform. Review with the user: whether an open class and a trait it does not itself conform to should compare, since a subclass may be both.

  • Settled on the user’s delegation 2026-11-05 (built on branch core-followups): a tuple already made converts to a wider tuple only where each part already is what the wider tuple holds: a part that is an object (a string, a data value, a tuple, an instance of a class) is its own Any, and an instance of a subclass is one of its superclass, so (string, int) is a (Any, int); a part that would need a box (a number, a bool, a char) does not convert, so (int, int) is not a (Any, int). A tuple written out where the wider one is expected boxes its part there. See Any and Nothing. Rationale: a conversion that changes no bits is free, while a boxed part changes the tuple’s layout and would mean copying the tuple behind a plain assignment. Alternatives weighed: no conversion of a tuple once made (what the chapter said, and needlessly strict for parts that already are objects); converting every part by copying, which hides an allocation.

  • Settled on the user’s delegation 2026-11-05 (built on branch core-followups): two classes with no common superclass that share several unrelated most specific traits do not join, and the error names the traits: “the branches of this if yield Duck and Goose, which share Swims and Flies but no single most specific type; write the type you want”, and the same ending for match arms, clauses, collection and map literals and a loop’s breaks, as inference says. Rationale: the bare “yield Duck and Goose” did not say why two classes that plainly share traits fail to agree. Alternative weighed: choosing the first trait declared, which makes the type depend on declaration order.

  • Settled on the user’s delegation 2026-11-05 (built on branch core-followups): a tuple type pattern tests the type the tuple was made with, as Any and Nothing says, not the classes of its parts: t: (Animal, int) holding a Dog does not match _: (Dog, int), and a tuple made as a (Dog, int) does wherever it is held. Each part is tested by a tuple pattern with a type pattern inside it, (d: Dog, n), and type patterns no longer say a tuple is “taken down part by part”. Rationale: a tuple’s run-time type is one type, fixed when it is made, so the test agrees with the static type it was made at. Alternative weighed: testing part by part, which would make a tuple’s run-time type depend on what it holds rather than on how it was made.

  • Settled on the user’s delegation 2026-11-05 (built on branch option-ord): Option[T] is an Ord when T is, None before every Some and Somes as their values, following the reference library’s ordering of options. It makes derives Ord work on a data type with an Option field and lets options sort and have max/min. Alternative: no order on options, leaving a field of one underivable — rejected as the cost falls on every record with an optional field. (Tuples already had Ord; Either and Result follow in the next entry.)

  • Settled on the user’s delegation 2026-11-05 (built on branch sysl-handles): a handle may name a Sysl trait, and its trait object is kept in a cell (Sysl bindings). Every handle’s object stays two words, the first naming the Sysl value and the second its owner; where the reference is a trait object, two words itself, the first word points at a cell the shim allocates holding it, freed when the reference is given back. The shim tells the cases apart while Sysl compiles it, by whether a reference to the type is wider than a pointer, and treats a trait as always held by a counted reference. Rationale: a struct handle is unchanged and reached as directly as before, the compiled code’s owner and closed checks read the same two words for every handle, and the compiler need not know which Sysl types are traits, which only Sysl does. Alternatives weighed: a handle object of three words for a trait, which needs the compiler to know the Sysl type’s kind before Sysl checks the shim, and moves the owner word of one kind of handle; every handle boxed, which costs a struct handle an allocation and a load for nothing.

  • Settled on the user’s delegation 2026-11-05 (built on branch sysl-handles): an Array or a Vector of handles that is a parameter goes into Sysl (Sysl bindings), replacing “a handle inside a collection does not go into Sysl”: as a slice of shares of the handles’ Sysl values, each element checked (closed, another owner) as a handle passed by itself is, then made the elements the Sysl parameter takes; a vector as a []T, an array as a []const T, as for every collection, and a Buf parameter not reached. Only the collection itself is the parameter: not nested, not in an Option, not a List, not a callback’s answer, not a mirror’s field. Rationale: a user interface library’s containers take []&View; taking shares first means a call that waits reads no Avin object, and what Sysl keeps it keeps by its own count. A slice or Buf of handles out of Sysl already became a vector of handles, so nothing changed there. Alternatives weighed: rooting the Avin collection for the call instead of taking shares, which leaves a pointer element reading a value the collector may free once the call returns and Sysl keeps it; allowing List and nested collections, which nothing yet needs. Review with the user: whether an Array of handles should reach a writable []&T, since a handle collection’s elements written by Sysl could never reach the array anyway; today it is refused as for every other array, so such a parameter is bound with a Vector.

  • Settled on the user’s delegation 2026-11-05 (built on branch sysl-handles): a handle may name an instance of a generic Sysl type, @sysl("module.Signal[string]"), struct or trait (Sysl bindings), its methods bound at that instance. Each type argument is written as Avin writes it and is a boundary type that is one Sysl type: an integer of 8, 16, 32 or 64 bits, byte (spelled u8 for Sysl), real, char, bool, unit, string, or an Option, a Result or a tuple of these; the compiler checks the arguments’ shape, Sysl that the type takes them. The shim imports the generic type and spells the instance wherever it names the handle’s type, since Sysl gives no alias to a trait’s instance. Rationale: syslui hands out &Signal[T], and one class per instance needs no generic classes in bindings. Alternatives weighed: mirrors and handles as type arguments, which have Sysl spellings of their own but would make an annotation’s text name Avin types; fully generic bindings, one class for every T, which stay specified and unbuilt. A &Signal[T] parameter shares the handle’s own signal (from Sysl 0.9.1), so a Sysl function setting a signal is seen by the handle (tests/programs/run/sysl_generic_handle_sharing, tests/programs/run/ui_signal_widgets).

  • Settled on the user’s delegation 2026-11-05 (built on branch tuple-ord): Either[L, R] and Result[T, E] are Ord when both sides are. Left orders before every Right, following the reference library’s ordering of eithers; Result is ordered as Either with Err in the place of Left, so every Err before every Ok. Rationale: both types put the failure on the same side (Left and Err are the reason, Right and Ok the value), so the one rule “failure before success” holds for both, and Err agrees with Left under toRight/toLeft conversions. Alternatives weighed: Ok before Err, matching the declaration order of Result‘s variants (which is what derives Ord would give a data type, and what a reader of data Result might expect) but disagreeing with Either; and no order on Result, leaving a record with a result field underivable. Review with the user: the Err-first choice is the one a reader of the declaration could find surprising. Tuples needed no change: their Ord, lexicographic by part at every arity, was already written by the compiler for each arity and is now covered by tests.

  • Settled on the user’s delegation 2026-11-19 (branch bool-ord): bool is Ord, false before true, reversing the earlier rule that bool had no order. compare, min/max/clamp, Reverse, sorting, TreeSet/TreeMap keys, tuple keys and derived orders all take a bool, and <, <=, > and >= are allowed on two bools as on every built-in Ord (one unsigned machine comparison). Rationale: porting a to-do list met tasks.sortBy(t -> (t.done, t.id)) refused, the one-line way to put open items first; without an order a bool field also leaves a record underivable for Ord and a tuple key holding a flag unusable, and false < true is the one order everyone already reads (0 before 1). Alternatives weighed: keeping the refusal, so a key is written if t.done then 1 else 0 (noise at every sort, and still no derives Ord with a flag); an Ord for bool without the operators, a split no other Ord type has; a helper such as byDone, too narrow for a general type. unit keeps no order. Review with the user: it reverses a settled rule, and b1 < b2 reads oddly to some.

  • Settled on the user’s delegation 2026-11-05 (built on branch sysl-callbacks): passing Avin functions to Sysl, the choices the request left open:

    • The closure’s lifetime is Sysl’s: the shim’s closure captures a counted Sysl value with a destructor that holds a root of the collector, so the root is given back when Sysl drops its last reference to the closure. Why: Sysl closures already carry captured state and drop it, so nothing has to be released by hand and nothing leaks while Sysl’s own ownership is right. Alternatives: an explicit release the library calls (leaks whenever it forgets, and frees a function Sysl may still call when it releases early); a root for the program’s whole run (leaks every callback ever given).
    • A callback belongs to the code that gave it by default; @threaded on a binding’s parameter lets any thread call it. The default compares owners, as a handle’s use does, and traps on any other caller. Why: a callback’s captures are ordinary Avin objects, shared without synchronization, so a call from another thread is a data race unless the function is checked; most UI and event callbacks run on the thread that registered them. Alternatives: a flag on the whole binding, @sysl("name", threaded) (coarser: one binding may take two callbacks); reading &sync Fn from the Sysl signature (Avin does not parse Sysl types; Sysl’s check already refuses the unmarked case, and the refusal is reworded to name the mark). Review with the user: the spelling @threaded, and whether the default should be the owner (as built) or the OS thread.
    • What a @threaded parameter is given is checked by its captures, since a function value is never Sendable: a top-level function, or a lambda, local function or method value whose every capture is a val or a parameter of a sendable type. A function value held in a variable or a parameter is refused (its type does not say what it captures), and a binding with a @threaded parameter cannot be used as a value, which would hide the call from the check. Alternatives: making function types carry a sendability mark (Sendable function types; a larger language change); no check (unsound).
    • A thread Sysl started itself is attached for a @threaded callback’s call (its own context, a fresh owner, the stack guard installed) and detached after; a callback without the mark called there traps without a place, since the thread never entered from Avin. Why: an audio or I/O thread of a C library is the common case, and attaching is cheap and safe since the thread holds no Avin references between calls. Alternative: always trap (makes such libraries unusable).
    • A callback made while its thread is in a blocking call makes the thread running for the call and safe again after; the place a trap in the library reports (the context’s caller site) is restored when the call ends.
    • Settled on the user’s delegation 2026-11-05 (the director): a binding with a @threaded parameter is blocking whether or not it says so, since a Sysl call that may wait for another thread to call back would otherwise hold up that thread’s first collection for ever. Why: the deadlock cannot be detected, and the cost is two stores and two loads per call. Alternative: documenting that such a binding is declared blocking (built first; a forgotten word hangs the program). A same-thread callback’s binding still blocks only where it says so.
    • A trap inside a callback stops the program at the callback’s own place. Avin traps report a place rather than a backtrace, so “with the Avin backtrace” is the trap’s place; there is no unwinding through Sysl frames, which would need Sysl to be unwind-safe.
    • The program defines one C-convention entry per callback parameter (a bool as a byte), which the shim declares extern and calls with the closure; the shim itself is generic in the Sysl types of the closure’s arguments, so a callback’s integer parameter takes any Sysl integer with the check a result has. Alternative: the shim calling the closure’s code directly through a function pointer (ties the shim to Avin’s internal convention for bool).
    • The runtime offers avin.rt.callbacks_held, the number of functions Sysl holds, for tests and for libraries that want to check they release what they register.
  • Settled on the user’s delegation 2026-11-05 (built on branch sendable-spawn): Sendable where values cross threads today (what is shared). The actors chapter’s build order has no step for it; it applies the rule of isolate‘s body, less the whole-program half, to threads and futures. Review with the user: it adds two annotations users can write.

    • The check is two marks on a parameter, @sendable and @isolated, which any function may write. What is passed for @isolated may use only sendable values from around it: a lambda, a by-name argument, a local function or a method value by what it captures (its nested closures and the local functions it calls included), any other expression by the locals and parameters it reads; what it makes itself is its own. @sendable adds that a closure captures no var, whose box it would share with the code that made it. A marked parameter holding a function may be passed on for one with the same mark or a weaker one; an override may not add a mark or strengthen one. Why: the library’s thread entries are ordinary Avin functions, so a user’s wrapper of spawn needs the same spelling the library uses, and a mark on the parameter checks every call where the closure is written and its captures are known. Alternatives: a list of library functions known to the compiler (no user wrapper could pass a body on); a function type that says it is sendable (() -> T that is Sendable), which would also let a sendable function be stored and sent, but makes function types carry a flag through unification and subtyping (later taken up as @sendable function types, under Proposed); no check, leaving the data race the memory model already makes harmless (the user’s direction is that threads share nothing mutable by default).
    • The bodies of spawn, s.spawn, Future(body) and ex.future(body), the functions of a future’s map, flatMap and onComplete, and orElse‘s by-name argument are @sendable. Their results are bounded by Sendable, as are Future.successful‘s value, a Promise‘s and the results of mapOk and mapErr, so every future’s value is sendable however it was made. Alternative: bounding Future[T] itself, which would make every generic function naming a future repeat the bound.
    • A Mutex is sendable of any value, so its value is @isolating where it is made (a buffer the caller keeps cannot be guarded), with is with[R: Sendable](@isolating body: (T) -> R) -> R (the value cannot be returned or stored outside), and get, set and update exist only for a sendable value. A with body may assign the caller’s vars of sendable types, since it runs at once on the calling thread. Why: without it, Mutex(b) or m.with(v -> v) hands the guarded buffer to code that changes it without the lock, which is the shared mutable state the mutex is the one door to. Alternatives: Mutex of any value unchecked, as written before; checking only with‘s result. The cost: a body cannot give back a fresh mutable value (nextBytes on the shared random generator copies through a vector), and a generic body over an unbounded T cannot take its argument in (the shared generator’s shuffle, choose and chooseWeighted now draw under the lock and pick outside it, with the same draws). Review with the user.
    • The standard library promises Sendable for Thread[T] of a sendable T, Executor, a mutex’s Condition, and TcpStream and TcpListener, which hold a Sysl handle and are handed over with it. A Scope is not sendable, so the trap on starting a scope’s thread from another thread is reached only through module-level state.
    • Tests that shared mutable data across threads were changed to share it safely: a scope’s threads write Atomic slots rather than an array; a flag and a once-initialized value became Atomics; a vector built in a var is copied into a val; a test’s own byte array is made by each thread; a trait sent through futures promises Sendable; the run test of the scope trap became a rejection test; a test’s Once counter became an Atomic; a test helper passing a function to its threads marks it @sendable.
    • Command.lines() on a command holding a sequence starts the command on its driver thread, so the mutable job belongs to that thread alone, and learns through a promise whether it started; before, the job was made on the calling thread and handed to the driver. A started Child and a lines iterator are mutable and not sendable; a thread starts and reads its own commands. Moving one would need Isolated or a promise like TcpStream‘s; a started Child has since been given the promise (proposed), and a lines iterator has not.
  • Settled on the user’s delegation 2026-11-05 (built on branch fix-lone-value): A member call on the name of a data type whose variant of its own name has no fields (Lone.m(…) with data Lone(); branch fix-lone-value). The name is both the type and a value of it. Proposed: where the type has a static member named m, the call is the type’s and chooses among its static members alone; otherwise it is the value’s method, its trait methods and impl-added methods included. A method value Lone.m follows the same order. Why: a static member can only be reached through the type’s name, while the value’s method is always reachable through a value, so giving the static the name loses nothing; and it keeps Name.m(…) with a static member meaning what it means on every other type. Alternatives weighed: the value always wins (makes a fieldless type’s static members unreachable by name); choosing among the static members and the value’s methods together by parameter types (a call on a type name would then mix two kinds of receiver in one overload set, which nothing else in the language does); refusing a static member and a value method of one name on such a type (an extra rule for a rare case). The companion object needs no rule: it cannot share the name of a fieldless variant (declarations).

  • Settled on the user’s delegation 2026-11-05 (built on branch option-ord-fix): the polymorphic recursion check counts a cycle through a method an impl with bounds of its own adds only along the paths whose type argument’s outermost type may meet the bounds, that type’s own arguments taken as any type; a type argument whose outermost type the check does not know (a tuple, a function, a part taken apart from a larger type) counts as one that may. Why: the check must never miss a real cycle, and the outermost type is what the flow already tracks per path; impl[T: Ord] Ord for Option[T] otherwise made every program loading the threads library fail. Alternatives weighed: connecting the impl’s methods from the parameter as a whole (what it did: false cycles through types that never meet the bounds); tracking type arguments deeper than the outermost type (exact for nested shapes such as a Box[Box[Plain[T]]], which is still counted, at the cost of a much larger flow graph). Review with the user if a nested shape turns up in real code.

  • Settled on the user’s delegation 2026-11-05 (built on branch option-ord-fix): an ordering, <, <=, >, >=, settles an unknown in one operand’s type from the other’s, so Some(1) < None compares two Option[int]s, as == already did. Why: the two operands of an ordering are one type, so the other operand is the only evidence and the obvious one. Alternative: requiring None[int], which == does not.

  • Settled on the user’s delegation 2026-11-05 (built on branch qualified-variants): Qualified variant access, Type.Variant (branch qualified-variants, 2026-11-05). Decided: T.V and m.T.V name data type T‘s variant V, beside the bare V, in expressions and patterns; the variant comes before any other member of that name, and a companion object declaring a method or a field named after one of its type’s variants is refused where it is declared. A capitalized T.Name that is no variant, companion member or static member is reported with the type’s variants. Why: the qualified form is meant to be unambiguous, and refusing the companion member keeps it so, at the cost of a rule that only bites on a member spelled like a variant (members are lowerCamelCase, variants PascalCase). Alternatives weighed: the companion’s member winning (Shape.Circle would then not always be the variant, defeating the point); choosing between them by call shape (a value and a call of one name meaning different things); allowing both silently with the variant winning (the companion member unreachable by name). A static trait member spelled like a variant is not refused, since the trait and the type are declared apart: the variant wins in T.V, and the member stays reachable through a type parameter. Type arguments are written once, on the type or on the variant, not both. Review with the user: whether the “capitalized name” test for reporting a missing variant should instead be any name that resolves to nothing on a data type.

  • Settled on the user’s delegation 2026-11-05 (built on branch thread-ownership): Every operation on a connection or a listener checks its socket’s owner first (branch thread-ownership). A TcpStream keeps the bytes it read ahead in Avin fields, so a read served from them alone never reached the socket, and the code that had handed the connection over read on from them without trapping; a closed connection or listener answered an error, and a listener’s port() its field, from any thread. Now read, readLine, readAll, write, writeText, setTimeout, shutdownOutput and close on a connection, and port, accept and close on a listener, first call a runtime method that does nothing on the open socket, or the socket’s close(), which does nothing on a closed one: both check the owner, so the previous owner traps at every use, open or closed, and the new owner reads the bytes read ahead, which move with the connection. The owner check comes before a read’s size check. Why: the promise is that a connection belongs to one thread at a time, and a race on the read-ahead fields is exactly what it rules out. Alternatives weighed: dropping the read-ahead on hand-over (loses bytes the other end sent); a check in the compiler for every field of a class holding a handle (a language rule for what one library type needs); an Avin owner field compared by hand (it would not move when the runtime hands over, which moves only handles).

  • Settled on the user’s delegation 2026-11-05 (built on branch thread-ownership): A started Child promises Sendable, and moves between threads as a connection does (branch thread-ownership). It holds a runtime token, a handle holding nothing but its owner, and waitFor, isAlive and kill use it first, so handing a child to a thread’s or a future’s body makes it the body’s, the code that handed it over traps at any use while the body runs (`Child` belongs to another thread), and it comes back to the next user when the body returns. The body may wait for it, stop it and start a sequence’s later part. Why a token: a child’s own handles come and go (a program that has ended gives its handle back, a part not yet started has none, nor has one whose time ran out before it began), so none of them can carry the promise. Alternatives weighed: Isolated (not built yet, and a child is a resource handed over whole, as a connection is, not an object graph being built); keeping it not sendable, so that a thread starts and waits for its own commands (what it was; a server that starts a command and hands it to a waiter could not). A lines iterator stays not sendable: it is consumed where it is made, and the thread reading a command’s output can start the command itself.

  • Settled on the user’s delegation 2026-11-05 (built on branch thread-ownership): A handle class’s @sysl may name it for its traps: @sysl("avin.rt.Token", named: "Child") (branch thread-ownership; the director decided that the old owner’s trap names the type the user holds). Every trap a handle raises, belonging to another thread and being closed, in compiled code and in the shim, uses that name rather than the class’s; the name must be a type’s (a capital first, letters, digits and _), and nothing else about the handle changes. Why: the trap is read by the code that misused the value, which knows the Child, not the private token class inside it. Alternatives weighed: a token class of the same name in a module of its own (two types named Child, which misleads a reader of the library); the trap text computed by the runtime from a name the token holds (the check is inline, one compare in compiled code, and its text is fixed when the program is compiled); naming the trap after the class whose method made the call (a rule no reader would guess). TcpStream and TcpListener each keep a handle class of their own over the one Sysl type sysl.net.Socket, named: for the type, so their traps name the type the user holds (branch socket-trap-names); two handle classes may share one Sysl type. The other library handles (File, FdReader, Spawned, Address) are held only inside private library values whose own checks come first, so none is named further.

  • Settled on the user’s delegation 2026-11-05 (built on branch module-var-threads): a thread’s body reaches no module-level mutable state (what is shared). What is passed for a @sendable parameter, directly or through every function it reaches, reads and writes no module-level var and reads no module-level value, lazy val or object whose type is not sendable. Reached means: the function a call names; for a call through a method table or a bound, every method of that name in that slot of any type’s table; for an operator on a value that is not a scalar, every implementation of the trait method it calls; every closure and function value made along the way; and the code a pattern runs (an extractor’s method, a sequence’s length). The error names the module-level item and the functions it is reached through, shortest path first. Why: a module-level value is reached by name, not captured, so the capture rule of @sendable never sees it, and a body that bumps a module-level counter races with main. Avin compiles the whole program, so what a call can reach is known, as isolate‘s check of its body already assumes. Alternatives: no check (the memory model makes the race harmless to the collector, but the threads chapter promises that threads share nothing mutable but the synchronized types); rejecting only what the body names itself (misses every call, so it closes nothing); per-thread copies of module-level vars (a different meaning for one declaration depending on which thread reads it); and treating each module-level var as an implicit Atomic (hides a lock in every read and does not make a read-modify-write atomic).

    • The whole argument counts, not only the closure: spawn(makeBody()) is checked through makeBody and every closure it makes, since what runs on the thread is whatever it gives back. The cost is a rejection where a call evaluated at once on the calling thread reads a var to choose the body. Alternative: following only closures and function values, which misses a body returned by a call.
    • A call through a trait method or an operator counts every implementation in the program, since which one a value has is not known where the body is checked. The cost is a rejection where one implementation reads a module-level var and the body never meets a value of that type. Alternative: following the receiver’s static type only where the class is final, which is finer but has to agree with devirtualization.
    • Settled on the user’s delegation 2026-11-19 (branch reach-chains): what a call through a method table, a bound or an operator reaches follows the types its receiver may have. On a data type it is that type’s own method; on a class, that class’s and its subclasses’; on a built-in scalar, nothing of the program’s; on a trait or a type parameter, the method of that name of every type conforming to the trait or to the parameter’s bounds; on Any, every one, as before. A generic function or method is followed instance by instance: called at known type arguments (or a method on a receiver of known type arguments), its operators and bound calls on its type parameters reach only what those types implement, and a lambda runs in the instance that makes it. An equality on a type with an equals of its own reaches that; one without compares fields and elements and still reaches every equals. Why: the rule above counted every method of the name in the program, so a program’s impl Sub for Money reading a module-level var made the standard library’s BigInt subtraction, and with it Map, Future and println, look as if they reached it: a thread’s body was rejected through chains no value could follow. Every narrowing keeps every implementation a value of the type can really have, so nothing the check closed is reopened (thread_module_reach_generic.avin pins the reachable routes). Alternatives: keeping the name-wide rule and deduplicating the chains (still rejects correct programs); a flow analysis of which types each generic class is made with, which would also see that an Iterator[Any] in println never yields a program’s type (much larger, and an instance whose arguments are not known still stands for every instance); narrowing by bounds alone, without instances (leaves Map[int, …] reaching every hash). Review with the user: a code path through a trait-typed value whose type arguments are not known still reaches every conforming type’s method, so a program whose own Hash or Eq reads a module-level var still sees library code rejected in a thread’s body (println reaches HashSet.contains through an Iterator[Any]).
    • What is passed for an @isolated parameter is not held to this, since it runs at once on the calling thread. A Mutex‘s value and with body were @isolated; they are now @isolating, which is held to it (see the mutex-isolating entry below).
    • Printing stays legal with no promise: print, println, eprintln and the StandardOutput and StandardError objects reach the runtime’s streams, which keep no state in Avin, and the objects hold no field. The standard library’s own module-level state is held to the rule like a program’s: the futures’ worker registry, guarded by its lock, promises Sendable, as do the regex library’s Unicode run tables (arrays filled before the table is made and never written after), and so does the Annotation trait, since a type’s shape is one module-level value every thread may read (an annotation type holding a mutable field is now rejected where it implements the trait). A collection’s companion object (Array, Buffer, Deque, the mutable Map and Set) is sendable like any object with no field; only the collections themselves are mutable. Review with the user: whether the Annotation promise is wanted, and whether the trait and operator over-approximation rejects too much in practice.
  • Settled on the user’s delegation 2026-11-05 (built on branch lambda-untupling): A lambda takes a tuple apart by its parameters (tuples; branch lambda-untupling). Where a function of one parameter whose type is an n-tuple (n ≥ 2) is expected, a lambda of exactly n parameters binds the tuple’s elements in order, each typed from its element; a declared parameter type must fit its element (a wider one is accepted, as for any lambda parameter), and an element the expected type leaves unknown takes its declared type. _ binds nothing; an inner tuple is one element. It applies only where the lambda’s parameter count does not fit the expected function directly, and among overloads a candidate that needs it is chosen only where none takes the lambda as written (Map.map((k, v) -> …) stays the two-parameter overload). A count fitting neither shape is an error naming both. Why: xs.zip(ys).forall((x, y) -> x == y) is the natural spelling and was rejected, leaving only match (x, y) -> …, a pattern where two names suffice; the reference language takes tuples apart the same way. Alternatives weighed: keeping the match function as the only way (no new rule, but the common case pays for a pattern); allowing a pattern in any lambda parameter position, ((a, b), c) -> … (more general, but a second pattern syntax beside the match function, which already covers nested and refutable shapes).

  • Settled on the user’s delegation 2026-11-05 (built on branch iterable-size): every Iterable has size(), knownSize() and sizeCompare(n) (collections), following the reference library: size() counts by iterating unless a collection overrides it with its own count, knownSize() is the count where it is known without iterating and -1 otherwise (a List other than Nil, an iterator, a view), and sizeCompare(n) answers -1, 0 or 1, reading at most n elements when the count is unknown. Sequences have size() and length(), equal. They are overridable trait members rather than impl methods, so a call through Iterable[T] reaches the collection’s own count. Consequence: a class implementing Iterable that declares its own size, knownSize or sizeCompare must mark it override. Alternatives weighed: an arbitrary-sign sizeCompare (the reference library’s contract, but -1/0/1 is what every caller tests); length() on every Iterable (left to sequences, whose length is their defining measure); sizeIs (needs special syntax). Review with the user: the override requirement on existing user classes.

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-binding): A callback’s integer answer goes into whatever integer the closure Sysl takes answers, with a check (Sysl bindings). An Avin function answering a long or an int reaches a Sysl closure answering any integer, u32, u64 and usize among them, and an answer the Sysl type cannot hold stops the program where the binding Sysl is running in was called, naming the type by sign and width (value out of range for u32). Why: Avin has no unsigned integers (settled 2026-11-02), and syslui asks for a colour by &Fn() -> u32; the answer is the mirror image of an integer result, which already takes any Sysl integer, so one rule covers both directions of a value Sysl reads, and a narrower signed answer is the same case. A closure answering a generic Sysl function’s type parameter names no integer, and answers the binding’s own type; the compiler learns that from Sysl’s refusal to infer one and builds the shims once more. Alternatives weighed: an int reinterpreted as the u32‘s bits (a colour past 0x7FFFFFFF written negative, and a reader never sure which); refusing the binding (no window could be given a colour); converting only into unsigned types (two rules for one shape). Built on ui-binding.

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-binding): The user interface binding is the package ui, in packages/ui of this repository, rather than a module of the standard library (User interfaces). Why: no package may declare a module under avin, the standard library carries no Sysl dependencies, and a program that does not draw should neither build syslui nor link SDL3; a domain library is a package of its own (packages). Alternatives weighed: avin.ui in the standard library (needs the library to name Sysl packages and every program to link SDL3); a repository of its own (premature while the binding and the language move together). Built on ui-binding. Review with the user: the name avin.ui was the plan’s, and only the standard library may hold it.

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-binding): The binding is thin and keeps syslui’s shapes (User interfaces). Each syslui function is bound under its Avin name with syslui’s defaults restated; a view is one handle class on the trait; one signal class for each instance a control takes (IntSignal, RealSignal, BoolSignal, StringSignal); slider is one overload for int and one for real; Role, Variant, TextStyle, MissKind, Missed and Rect are mirrors. The package’s one function of its own is tap(v, key, at), the draw, snapshot, press and release a test of an interface makes every time. Why: the component and signal layer, which is Avin’s, decides the shapes an application writes; this layer only has to reach syslui. Alternatives weighed: a generic signal class (Avin binds a handle at one instance); wrapping every binding in a private one (no name to change yet). Built on ui-binding.

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-binding): run is blocking, and no ui callback is @threaded (User interfaces). The frame loop waits for events for most of its life, so the thread is safe for the collector meanwhile, and syslui-sdl calls the tree, the ground and every control’s callback on the thread that called run. Alternatives weighed: an unmarked run, which would hold up every other thread’s collections for the life of the window. Built on ui-binding.

  • Settled on the user’s delegation 2026-11-05 (built on branch unicode-identifiers): Names in any script (branch unicode-identifiers, 2026-11-05; names). A name starts with a character of Unicode’s XID_Start or _ and continues with XID_Continue (UAX #31, the Unicode identifier rule), at the Unicode version the compiler’s tables were cut from (17.0.0). Why: domain vocabulary is written in the programmer’s own language, and the XID properties are the ones designed to be stable under normalization and across Unicode versions. Alternatives weighed: ASCII only (what the lexer had; refuses größe for no reason a reader could guess); any non-ASCII character that is not a space (admits emoji, arrows and operators of other scripts, so a→b would be one name); General_Category letters, marks and digits (Sysl’s rule; close to XID but not stable under normalization, and admits pattern characters such as U+2E2F).

  • Settled on the user’s delegation 2026-11-05 (built on branch unicode-identifiers): A name in a normal form other than NFC is an error, with its NFC spelling (branch unicode-identifiers). Why: every name stays byte for byte the text written, so spans, rename, lookup and emitted symbols need no second spelling, and two spellings that look identical can never be two names, which is what normalizing would also guarantee. Alternatives weighed: normalizing to NFC silently (friendlier to an input method that writes decomposed text, but every name then has a spelling the source does not contain); no normalization (Sysl’s choice: café and cafe with U+0301 are two names that look the same); NFKC (folds fi into fi and full-width letters into ASCII, which changes what a name visibly is). A module’s directory name is held to the same rule. Review with the user: whether silent normalization is preferred.

  • Settled on the user’s delegation 2026-11-05 (built on branch unicode-identifiers): Capitalized means an uppercase or titlecase first letter (Lu, Lt); a caseless letter is not capitalized (branch unicode-identifiers). Every place the compiler asks whether a name is capitalized (a missing variant written T.V, a scalar type’s MaxValue-style constants, a missing type in an import of a library module, a handle’s named:, the highlighting of types) uses this test, so Ärger, Δelta and Džemal read as type-like names and 名前 as a value’s. A bare name in a pattern is a variant when one of that name is in scope and a binding otherwise, whatever its case, so a caseless name is a binding unless it names a variant. Why: a caseless script has no way to write a capital, and treating its names as lowercase keeps them usable for the commonest names (values, functions); its types are still declared and used by name. Alternatives weighed: caseless counting as capitalized (every CJK local would read as a constructor-like name); refusing caseless names where a capital is expected (a CJK program could not name a type). Review with the user: this is the choice most likely to matter to a program written wholly in a caseless script.

  • Settled on the user’s delegation 2026-11-05 (built on branch unicode-identifiers): Look-alike names in different scripts are different names, with no warning (branch unicode-identifiers): Latin a and Cyrillic а are two names. Why: confusable detection (UTS #39) needs data the compiler does not carry and warns on legitimate mixed-script code. Alternative: a mixed-script warning per name. Review with the user if spoofed names in shared packages become a concern.

  • Settled on the user’s delegation 2026-11-05 (built on branch unicode-identifiers): A character above ASCII that begins no token is reported with its code point and stepped over whole (branch unicode-identifiers): an emoji is “not a character a name or an operator is spelled with”, and a digit or mark of another script where a name begins “cannot begin a name”, each naming the character and its U+ code point. Why: the bytes of one character used to be read as separate symbols, which the parser then reported one at a time.

  • Settled on the user’s delegation 2026-11-05 (built on branch sendable-functions): @sendable function types, answering the open question whether a function value can be sent, with a type that says what it captures (function types, what is shared).

    • @sendable (A) -> B is a function type whose values capture only sendable values and no var and reach no module-level mutable state; it is Sendable, and a plain function type is not. Only a function type may carry the mark.
    • A lambda, a function reference or a method value written where a @sendable function type is expected is made as one, and is checked there by exactly the checks what is passed for a @sendable parameter gets: its captures, and the whole-program reach of module-level state. The error names the type (a `@sendable (int) -> int` may use only sendable values …). Any other value of a plain function type is not one, and the mismatch says why.
    • @sendable (A) -> B is a subtype of (A) -> B with no conversion: in covariant positions (a vector’s element, a result, an override’s result) too, not through an invariant one (an array’s element). Two branches of the two types agree on the plain one.
    • A parameter marked @sendable that takes a function holds a value of the @sendable function type inside the function, so the mark and the type are one notion seen from the two sides; the parameter’s declared type is unchanged, so an override that drops the mark still overrides. Passing a value already of a @sendable type to spawn or any marked parameter is accepted as it is.
    • Data and classes whose fields are @sendable functions are sendable by the existing structural rules, at every type argument of a generic one (a Parser[T] holding a @sendable (Input) -> Option[T]), so module-level parser grammars, lazy vals among them, pass the module-state check and run on spawned threads.
    • Two overloads that differ only in whether a function parameter is @sendable are one overload (refused as declared twice), as two differing only in a by-name parameter are, since one lambda may be passed for either and overload resolution runs before the sendability check.
    • An override’s parameter types match its method’s exactly, the mark included; its result may be the @sendable subtype.
    • Why: the parsing library’s grammars are module-level values holding functions, and could not be used from a thread at all; the @sendable parameter mark already decides exactly what a function value may capture and reach, so the same check at the point a value is made lets the type carry the guarantee through storage, fields and module-level values, soundly, and the spelling reuses the mark readers already know.
    • Alternatives: inferring capture sendability into every function type with no mark (every lambda’s type would depend on its body, unification and overloads would see two function types per signature, and an API could not promise it); effect-style capture sets in the type (precise, but a large addition to the type system for one property); leaving functions never sendable (sound, but module-level grammars, handler tables and task lists stay unusable from threads).
    • Review with the user: the spelling @sendable (A) -> B (an annotation in type position, the only one), against a keyword or a Sendable-bounded spelling; and whether two overloads differing only in the mark should be refused or resolved to the plain one for a lambda.
  • Settled on the user’s delegation 2026-11-05 (built on branch state-machines): State machines, the choices the chapter leaves open (branch state-machines, 2026-11-05). A machine is read into its Door.State data type and a final class holding the current state, so it needs no runtime. Decided:

    • Order inside a transition. The arm runs first; then the current state’s leave, in which state() still answers the state being left; then the new state is current and its enter runs, in which state() answers it; handle answers the state after enter. Why: an arm computes where to go, leave cleans up the old state’s data, which it can still read, and enter sees the machine as it will be. Alternatives: switching the state before leave (it would then read data no longer current); running leave before the arm (an arm yielding stay would have left).
    • A state is a variant of its module, as every data type’s variant is: Locked(code) and door.state() is Locked(_) name it bare. Why: it follows from Door.State being an ordinary data type matched by bare names, as the chapter writes. Alternatives: scoping state names to their machine, written bare only inside it and Door.State.Locked outside (the chapter’s own door.state() is Locked(_) would no longer read). Amended (Proposed, branch shared-variants, below): two machines of one module may now share a state’s name, and a state an event’s variant, each bare use decided by the type expected there, as for every shared variant name; until then a state’s name had to be one no other variant of the module had.
    • Door.State takes all of the machine’s type parameters, with their bounds, so a state of a generic machine may hold values of them: Cell.State[string]. Why: the smallest rule that lets any state hold any of them. Alternative: only the parameters the states use (the type’s arguments would then depend on which states mention which parameter).
    • stay is the value of an arm where it is the arm’s value: the arm’s whole body, the last line of a block, and each branch of an if or a match that is itself in such a place. Elsewhere stay is an ordinary name. Why: the chapter makes stay a keyword only as an arm’s value. Alternative: anywhere in an arm’s body (it would then be a value that could be stored, with a meaning only at the end).
    • The trap on handling from inside a handler names the machine and is reported at its declaration: avin: trap: `Relay` handles an event from inside one of its own arms, `enter` or `leave` blocks at file:line:col. The first state’s enter, run as the machine is made, is such a block too. Why: the check is in the code the declaration makes. Alternative: reporting the handle call that re-entered, as a library trap reports the program’s call (it needs the machine’s code to count as the library’s for its traps, which its arms are not).
    • The coverage error lists every case left out: each variant of the event type not covered in full, written as its first uncovered value (Lock(_), Both(true, None)), followed by “where the guard is false” when a guarded arm could have taken it; for an event type without variants, one value (-1). Why: it is the chapter’s own message, extended to the shapes it does not show.
    • A machine takes no parents and no derives in its header in this step, and a state and the receive block take else arms as a match does. Alternative: parents after the parameters, as a class’s; nothing in the chapter needs them yet.
    • Handling an event from the machine’s own body, before the first state’s enter has run, is allowed: the machine is in its first state then. Alternative: trapping as from inside a handler.
    • Not sendable, said as such: a machine passed where a sendable value is needed is reported as “a machine, a mutable object that moves between its states”, not by its hidden state field.
  • Settled on the user’s delegation 2026-11-05 (built on branch ui-int-params): A binding’s integer parameter goes into whatever integer the Sysl parameter is, with a check (Sysl bindings). An Avin int, long, i8 or i16 parameter reaches a Sysl parameter of any concrete integer type, u8 to u64, usize and the signed widths, converted in the shim; a value the Sysl type cannot hold stops the program where the binding was called (value out of range for u32). A handle’s method converts the same way, and a blocking call converts with its thread safe for the collector, making it running again before stopping the program. Why: syslui’s colour modifiers take a u32 parameter, Avin has no unsigned integers (settled 2026-11-02), and the rule is the mirror image of the integer result and the callback answer, so all three directions of an integer follow one rule. Consequence: a long now reaches an i32 parameter where its value fits, which was rejected before. Alternatives weighed: converting only into unsigned types (two rules for one shape); an int reinterpreted as the u32‘s bits (a colour past 0x7FFFFFFF written negative).

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-int-params): An integer parameter is passed as the Avin type itself where Sysl cannot infer a type for its conversion: a parameter whose Sysl type is a type parameter of a generic function (same[T](x: T)), and every integer parameter of a binding whose call left any type argument uninferred (syslui’s slider[T](value: &Signal[T], lo: T, hi: T), where the integer bounds decide T). The compiler learns this from Sysl’s refusal and builds the shims once more, as it does for a callback’s answer. Why: a conversion needs a target type, and a generic parameter has none until its arguments say. Alternatives weighed: converting the parameters a generic call can still infer and passing only the stalled ones as they are (needs a build per round of refusals); refusing such bindings (slider would be unbindable). Review with the user: a binding to a Sysl function overloaded only by integer width now reaches the overload Sysl picks for an uninferred integer argument, rather than the one matching the Avin type exactly; no binding does this today.

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-int-params): An integer an Option, a Result, a tuple or a collection parameter holds is not converted, and the binding is rejected with a sentence saying so. Why: the conversion functions for these shapes are shared between bindings and spelled with the Avin type’s Sysl spelling; making each generic in its integers would make every nested parameter an inference problem, for no binding that needs it yet. Alternative: converting them as results are converted (the shape is there, the need is not).

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-int-params): A colour in ui is an int holding 0xRRGGBB, as syslui draws it, with rgb(r, g, b), mix, lighten and darken (User interfaces). Why: syslui has no alpha, so a 0xRRGGBBAA would carry a channel nobody reads; every colour fits an int, which is what a hex literal is by default; and a binding’s parameter cannot take an Avin data type, so a Color type would need a wrapper around every modifier. Alternatives weighed: a long (what app‘s ground answers, but wider than any colour); a Color data type with rgb/rgba (a wrapper per modifier, and an alpha syslui ignores). Review with the user: app‘s ground still answers a long; it could become an int to match.

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-int-params): A value narrower than 32 bits crosses the boundary widened as the C convention says: Avin marks a shim’s i8 and i16 parameters and a callback’s narrow signed answer signext, and a byte or bool zeroext, which Sysl relies on. This fixes a bug: a negative i8 or i16 computed at run time reached Sysl as a large positive value (-5 as 65531). Alternatives weighed: passing every narrow integer as an i32 and narrowing in the shim (changes the type a generic Sysl parameter infers).

  • Settled on the user’s delegation 2026-11-05 (built on branch sendable-params): a @sendable parameter is sendable inside its function, whatever its type (threads). Found by the parsing library, whose combinators take a @sendable f: PartialFunction[char, U] and could neither capture it in a @sendable lambda nor pass it on.

    • Inside the function the parameter is sendable: a @sendable lambda captures it and it is passed on for another @sendable parameter without a check. Why: what is passed for it was checked where it was passed, as a function-typed parameter’s already was.
    • What is passed for one that does not take a function is itself sendable: a match function written in place (the core library’s MatchPartialFunction of two lambdas, checked by what the arms capture and the module-level state they reach), a value of a sendable type, a parameter so marked, or a class’s marked val parameter. Any other value is refused, where before a fresh object (what it makes itself is its own) passed. Why: the value is now shared by whatever the function hands it to, so a fresh object with a var field would be shared between threads.
    • The mark belongs to the parameter, not to its type (the sound minimum): a marked value copied into a local, stored in a data field typed as the trait, combined (f.orElse(g)), or passed for an unmarked parameter bounded by Sendable, is a value of the trait’s type again, which is not sendable. A class’s val parameter marked @sendable is a field whose value is sendable, so it leaves the class sendable by its structure; a var one does not. Alternatives: a @sendable mark on trait types (@sendable PartialFunction[A, B]), which would carry the property through locals and fields, or marked data fields; both are new type-system surface, and can be added later without breaking what this allows. Review with the user: whether @sendable should become a mark on trait types, as it is on function types.
    • A lambda or a match function passed for a type argument bounded by Sendable (^^^[U: Sendable](value: U)) is made as a @sendable function and checked as one where it is made; where the expected type decides that argument as a plain function type, it is taken as its @sendable form, which conforms to the plain one. Why: a plain function type is never sendable, so the call could not succeed otherwise. Alternative: requiring the type written, ^^^[@sendable (int, int) -> int](…), which is noisy for every operator parser. A match function where a PartialFunction is expected is not changed by the bound: it is a PartialFunction, which does not promise Sendable.
  • Settled on the user’s delegation 2026-11-05 (built on branch mixed-lambda-inference): the lambdas and match functions of a call are checked in turn, each the first in the call whose parameter types are known (generics): declared by it, or decided by the arguments checked so far; where none is, the first one left is checked and reports what it cannot infer. Found as a bug: they were checked strictly left to right after the other arguments, so both(match n -> n + 1, (x: int) -> x * 10) for both[A, B](g: (A) -> B, f: (A) -> B) failed with “cannot infer the type of the value this match matches”, as did an untyped lambda written before the typed one, while the same arguments swapped were accepted. Why: the smallest rule under which argument order does not matter for what can be inferred, and every call accepted before is checked in the same order as before (each lambda it checked was already the first ready one). Alternatives: keep left to right (order-sensitive, as the bug shows); check the lambdas with declared parameters first, then the rest left to right (misses chains, where a match function’s type comes from an untyped lambda’s result); or solve all of them together as constraints, checking each body against partly unknown parameters (a larger change, with diagnostics harder to place). Review with the user: the order rule is visible in which calls infer, so a later constraint solver would be a language change.

  • Settled on the user’s delegation 2026-11-05 (built on branch sendable-followups): three follow-ups to @sendable parameters (threads, callbacks). They amend the sendable-params entry above where it says a combination, and a match function where a PartialFunction is expected, are not sendable.

    • A binding’s @threaded parameter takes a value of a @sendable function type and a parameter marked @sendable as they are, and a lambda passed there may capture a marked parameter. A plain function value, an unmarked or @isolated parameter, and an unmarked parameter captured stay refused. Why: each was checked where it was made or passed to be what any thread may run, which is all the @threaded check asks. Alternative: none sound is narrower; requiring a lambda around it (x -> f(x)) is the contortion this removes.
    • f.orElse(g) is sendable where f and g are, by a promise the standard library writes on the method, @sendable_result: a call of a function so marked is sendable where its receiver and every argument are a match function written in place, a value of a sendable type, a marked parameter or class field, or another such call; chains of orElse follow. The promise is refused outside the standard library, since nothing checks it against the body, and a call that names the method statically reaches no override. A combination held in a local is a PartialFunction again, as a marked parameter copied into one is. Only orElse makes the promise: lift answers a function whose captures a program’s own PartialFunction implementation decides, and applyOrElse answers a value, not a partial function. Alternatives weighed: a general rule that any call whose parts are sendable is sendable (unsound: the call may answer a fresh object with a var, or reach module-level state); a conditional Sendable impl for OrElsePartialFunction (the result’s static type is the trait, which no impl of the class reaches); hard-coding PartialFunction.orElse in the checker (the annotation says the same and names its users); a @sendable mark on trait types, under review in the entry above, which would subsume this. Review with the user: whether a program’s own combinators should be able to make the promise, checked against the body (a body that only builds an object of a final class from its parameters).
    • A match function where a PartialFunction is expected, passed for a type argument bounded by Sendable, meets the bound, as a lambda there does: its two lambdas are made as @sendable functions and checked where they are made, the one running its arms holding every pattern, guard and body, so a fault is reported once. PartialFunction itself does not promise Sendable, so the bound is waived at that call only where every value the call gives the callee of the type argument is such a function: each parameter whose type could give one (any position but what a function passed takes, a data type’s or a class’s argument counted whatever its variance) is of exactly that type and given such a function. A written type argument is held to the bound as written, as take[(int) -> int](…) is. Why: the callee obtains values of its type argument only from its arguments, each of which was checked. Alternatives weighed: a sendable form of the PartialFunction type (the trait-type mark under review above); making MatchPartialFunction promise Sendable (it holds two plain function fields, which are not sendable, and a match function’s static type is the trait anyway).
  • Settled on the user’s delegation 2026-11-05 (built on branch ui-components): Interface state is a generic Avin class State[T], with get, set and update(f), and a set is one write: an invalidate() for a state held in Avin, or a write of its signal for one a control has linked (components). Why: the state lives in Avin, so it holds any type; making the set the frame loop’s write means nothing else has to be called after one, and a set is counted exactly as a signal’s is. Alternatives weighed: syslui’s own signals for every state (only four instances exist, so a list or a data value could not be state); a set that skips the write when the value is unchanged (needs Eq on every T, and a function or a class has none).

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-components): A control over a state reads and writes the state’s own signal, made once by State.signal(s), which is from then on where the value lives, rather than a second copy kept in step. Why: one place for the value means a control’s write is the state’s value at once, with no build in between, and no write can echo back into the other side, so there is no loop to break. Alternatives weighed: a bridge copying both ways at each build, comparing against the last value it saw (stale between a tap and the next build, and a conflict to resolve when both change); a callback from syslui on each write (not in the binding). The controls taking a State are overloads of the binding’s own (switch, checkbox, radio, radioGroup, both sliders, textField, textArea, tabs, scroll).

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-components): Components are functions returning View, written component c -> … or keyed(key) c -> …; what a component keeps across builds is asked of its Scope by order (c.state(init), c.remember(make), c.derived(f)), and a component is found again by its place among its parent’s unkeyed components, or by its key. A build is a call of the function root(body) answers; a component the build of its parent leaves out is dropped with everything inside it. Why: a component stays a plain function of its arguments, so props are ordinary parameters and need no class; reified type tests make the positional slots sound (a slot asked for as another type stops the program rather than being misread); the scope is a parameter, so a request outside a component cannot be written by mistake. Alternatives weighed: a class per component with fields as state (props would have to be copied into an instance kept from an earlier build, and every component would need a class and a table of instances by type); a state machine per component (fits a component with modes, not one holding a value); a scope passed from parent to child explicitly (every call of a component would carry it). Review with the user: the shape of the API, and whether keys should be any Hash value rather than a string or an int. Review with the user: the component API’s shape, and whether keys should be any Hash rather than a string or an int.

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-components): The mistakes the order and the keys can make stop the program: a component built with no root building, two components under one parent with one key, a slot asked for as another type than the last build’s, a scope asked after its build, and a root built inside its own build. Why: each would otherwise give one component another’s state silently. Alternatives weighed: starting the slot or the component afresh (hides the mistake), a warning (Avin has no runtime warning channel).

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-components): derived(f) computes again only after something has been written since its last computation, by the counter writes() answers, rather than by the states it read. Why: every state, signal and invalidate() moves the counter, so it is never stale where the frame loop would rebuild, and it needs no record of what f read. Alternatives weighed: tracking the states read during f (finer, but a hidden global and a cost on every get), computing on every call (no use as a value of its own).

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-components): The interface’s state belongs to the thread running it, and the type system keeps it there: a State, a Derived and a Scope are mutable, so not sendable, and a closure for another thread cannot capture one. There is no post or runOnUi yet. Why: the frame loop’s write counter and syslui’s signals are not synchronized, so the only sound cross-thread path is a queue the frame loop drains, and nothing in the binding wakes the loop from another thread. Alternatives weighed: a sendable post(@sendable f) queuing a change (its function could not capture the state it is meant to change, so it would need a sendable handle to a state, a design of its own). Review with the user: a worker reporting to the interface needs that handle and a way to wake the frame loop. Review with the user: the path from another thread, which needs a sendable handle and a way to wake the frame loop.

  • Settled on the user’s delegation 2026-11-05 (built on branch ui-components): An example program is one package, so the to-do example is examples/ui-todo beside examples/ui, since the corpus builds each directory of examples as one program with one main.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-runtime): A behaviour’s library form is Behaviour[M](name: string, start: @sendable (ActorRef[M]) -> (M) -> unit) (declaring an actor). The start runs once on the actor’s first turn, is given the actor’s own reference (self), makes the actor’s state in its locals and gives back the handler of each message; actor declarations will lower to exactly this, the name being the declaration’s. Why: it is the smallest value that holds “the declaration and its arguments” and can be started again for a restart, and making the start a @sendable function puts the existing capture and module-level-state checks on everything an actor’s body reaches, with no new check. Alternatives weighed: a trait with a receive method implemented by a class per actor (the state would be an object the program sees, which the spec rules out); a constructor hidden from programs (then the runtime could not be tested before declarations exist, and a program could not build an actor from a function).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-runtime): Executor.execute(task) runs a task on the executor’s workers with no future, as an owner of its own with nothing handed to it, and runs after shutdown as a future’s functions do (executors). Why: an actor’s turns are queued on its executor again and again, and avin.actors cannot reach the pool’s module-private queue; the path future takes hands over by walking everything the task reaches, which for an actor is its whole state and mailbox at every turn. Alternatives weighed: putting avin.actors inside avin.threads (the spec names the module); walking at each turn (cost grows with the actor’s state); a compiler-known hook visible only to the library (new machinery for one call). Review with the user: it adds a public method whose owner rule (handles the giver owns trap in the task) differs from future‘s.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-runtime): Scheduling details (scheduling). An actor’s number is one sequence for the whole program, from one in the order actors are spawned, not one per declaration. spawn hands the Sysl handles its behaviour reaches to the actor, as a thread’s spawn does with its body. The start runs in the first turn and is not one of the 16 messages; a turn ends early when the mailbox is empty; an actor on an executor that has been shut down goes on handling what it is told, so tell never fails. Why: each is the smallest rule that keeps tell from waiting or failing and keeps a handle usable by whoever runs the actor. Alternatives weighed: numbers per declaration (Counter#1, Logger#1; needs a registry of names); dropping messages to an actor whose executor is shut down (a silent loss the spec does not ask for).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-declarations): An actor declaration is read into a function and a hidden class (declaring an actor). actor Counter(start: int) receives M is the function Counter(start: int) -> Behaviour[M], with the parameters’ defaults, and a private class holding the actor’s reference, the parameters and the body’s fields and methods, whose name (actor Counter) no program can write. The start of the behaviour makes one object of that class, which runs the body, and gives back the call of its receive match; inside the body self reads the reference. Why: it lowers onto the library’s Behaviour with no runtime support, as the chapter says a declaration is, and the class gives the body’s methods the implicit receiver and its fields their life across messages for free, while the object never becomes a value the program sees. Alternatives weighed: the body’s fields as the start lambda’s locals and its methods as local functions (no implicit receiver, and forward references between methods break); a runtime-known actor class (machinery the runtime does not need).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-declarations): What an actor’s parameters may be. Each parameter’s type is held to Sendable where the actor is declared, not where the start captures it, so the error names the actor and the parameter; one the program marks @sendable is exempt, as a marked parameter of a function is sendable inside it whatever its type. A var parameter is a field the actor may change, each start beginning again from the argument; a repeated parameter is allowed; a by-name one is refused. An argument is checked only by its type, so Worker(s"$label$made") computed from an actor’s own var is accepted. Why: the chapter says the parameters follow a class’s rules and must be sendable; this is the reading that adds no rule of its own. Alternatives weighed: marking every parameter @sendable (then an argument computed from a var is refused, since what is passed for a marked parameter is checked by what it reads); refusing val and var parameters (no gain: nothing outside the actor reaches its fields).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-declarations): An actor’s diagnostics name the actor. A message type that is not sendable is reported once where it is written after receives (`Buffer[int]` does not conform to `Sendable`, so the actor `Buffers` cannot receive it), not once for the behaviour and once for the reference; a receive that does not cover the message type says actor `Partial` does not handle `C` and how a message is ignored; module-level state reached from the body, an arm or a method is the actor `Arm` may run on another thread, the path naming the actor’s methods by their own names; a method value carrying the state is the state of the actor. Why: the program wrote an actor, not a behaviour and a lambda. Alternatives weighed: the generic messages of the @sendable start (they name a function type the program never wrote). Review with the user: the hidden class is spelled actor Counter, with a space, so it reads well where a diagnostic names it.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-lifecycle): An actor’s lifecycle is the class ActorContext[M] its state extends (lifecycle). stop, watch, unwatch, after, every, children, parent and onStopping are methods of avin.actors.ActorContext[M], made from the actor’s reference; the hidden class of an actor declaration extends it, so the body, arms and methods call them as their own, and a behaviour written as a library value makes one in its start, ActorContext(me). Each finds its actor through the runtime’s table of running actors by the owner of the code running, and traps where that is not the actor (made by main, or called from a future). A field or method of an actor with the name and parameters of one of these is refused (`stop` is one of every actor's own methods), and the body may call them before its own fields are initialized, since they reach only the context’s. The same table gives spawn the actor whose code is running, its new child’s parent. Why: the chapter writes stop() and after(…) bare inside an actor, typed by the actor’s message type, and inheritance gives exactly that with no new lookup rule, while the library form keeps working with no declaration. Alternatives weighed: changing a behaviour’s start to take the context instead of the reference (every library-form behaviour changes, and me is no longer a reference); free functions finding the running actor (after could not be typed by the actor’s messages); names the checker resolves specially inside actors (a lookup rule of its own, and nothing for the library form). Review with the user: the public name ActorContext and onStopping, and that an actor’s own names now include children and parent (a test’s field children was renamed).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-lifecycle): Stopping, the cases the chapter leaves open. stop(self) is stop(); stopping an actor that has ended does nothing, whoever started it (there is no actor left to protect, and the end may have raced the call); an actor asked to stop before its first turn still runs its body first, so its stopping block always has state to run on; an actor started while its parent is ending is stopped at once and its parent does not wait for it; a stopping block is given to the context after the body’s statements, and several onStopping functions run in the order given; children() omits a child once it has ended, before its end is told to watchers. Why: each is the reading that never traps on a race and never leaves a parent waiting for ever. Alternatives weighed: stop(self) trapping as “not a child”; stopping an ended non-child trapping (needs a record of every child that ever ended); a child started from stopping made a top-level actor instead.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-lifecycle): Watching, the cases the chapter leaves open. Watching an actor again replaces the earlier watch, so its end is told once; an actor watching itself is told nothing; watch(ref, f) takes a @sendable f, run on the pool where the end is known, its result queued; unwatch and the replacing watch drop a message already queued and not yet handled. Why: one message per watched end is what a program counting ends needs, and the dropped message is what makes unwatch mean something under a race. Alternatives weighed: a message per watch call; running f in the watcher’s turn (the mailbox would hold functions rather than messages); watching itself trapping.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-lifecycle): Timers. One thread, started with the first timer, keeps every actor’s timers and sleeps until the earliest is due; timers fire in the order they fall due, those due together in the order they were set; a delay of zero or less is due at once; a repeating timer is set again an interval after it fires (it does not catch up after a stall), and an interval of zero or less traps; cancel() works from any thread, since a Timer is sendable, and drops a message of it queued and not yet handled. Timer has only cancel(). Why: a thread per timer would hold a worker per pending timer, and dropping queued messages makes a cancelled timer’s count exact without timing. Alternatives weighed: a fixed rate that catches up; every(zero) sending as fast as it is handled; an isActive() query (left out until a program needs it).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-lifecycle): An actor’s state is never captured by a @sendable function, whatever its fields: Future(stop()) in an arm, or a body reading a val field, is refused with it uses the state of the actor `Escaper`, which only the actor's own code reaches; copy what it needs into a `val` first. Before, only a state with a var was refused. Why: the context’s methods act for the actor that is running, so a state carried to another thread is never right to use there, and the static refusal says so where the runtime would trap. Alternatives weighed: keeping the structural rule and relying on the trap. Review with the user: it tightens a settled rule.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-lifecycle): The expected type bounds a contravariant type argument of a call’s result only from below (generics). A call whose result is Sink[T] for a contravariant T takes T from its arguments, and from the expected type only where they leave it open, so watch(spawn(Worker()), …) and val r: ActorRef[Nothing] = spawn(Quiet()) check. Before, the expected ActorRef[Nothing] made M Nothing and the argument was refused. Why: Sink[A] is a Sink[B] for every B below A, so the expected argument says nothing about T beyond a lower bound. Alternatives weighed: recording a lower bound on the variable (the checker’s unknowns hold one type, not bounds).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-ask): Ended means “not delivered”, decided at the send. An ask completes with Err(Ended) exactly where the asked actor was ending or had ended when the question was sent, so the message was dropped. A question that was queued and then dropped because the actor ended before handling it times out. Why: the chapter defines Ended as “the message could not be delivered”, and an actor may legitimately forward the reply reference and end, the reply still to come from another actor; watching the asked actor’s end for every ask would also hold a callback per ask on long-lived actors. Alternative: complete with Ended as soon as the asked actor ends before a reply (quicker failure for a question dropped from a mailbox, wrong for forwarded replies).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-ask): An ask’s reply reference is an ordinary ActorRef[R] shown as Reply#n, numbered from one apart from the actors (so asks never disturb the actors’ numbering), unequal to every other reference; its ended() completes (Stopped) once the ask has its answer or has timed out, and an ask of a used reply reference answers Ended. Why: it is a one-shot address, so it ends when it can accept nothing more. Alternatives: no identity of its own (sharing the asker’s, which main and threads do not have), or numbering it among the actors.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-ask): The timeout is set once the question is delivered; a timeout of zero or less times out at once unless the reply was already there. Alternative: trap on a timeout not more than zero as every does on its interval (a zero timeout is a legitimate “only if it is already answered”).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-ask): adapter(f)‘s f runs where the message is sent, so it is @sendable, and the adapter refers to the adapting actor: equal to its self, the same hash and display, the same ended(); a message sent to it once the actor has ended is dropped, and an ask of it answers Ended. Why: the mailbox holds the actor’s own message type, so translating at the send keeps it so, and the chapter says a reference compares by the actor it refers to. Alternative: translate in the actor’s own turn, which would let f read the actor’s state but needs a mailbox of translations.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-ask): pipeToSelf of a future complete already sends at once, so its message precedes any the actor sends itself after the call, and two such pipes arrive in the order they were made; an incomplete one sends from wherever the future completes, so f is @sendable. T carries no Sendable bound, the value never leaving the future’s own handing-over. Alternative: always go through onComplete, leaving the order of an already-complete pipe and a later tell open.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-ask): A lambda’s parameter of a known shape with an open type argument (Promise[T], ActorRef[R]) takes that shape, and the body decides the argument, as p -> ReadLine(p) decides T from ReadLine‘s parameter; a body that leaves it open is reported at the parameter, once. A wholly unknown parameter type is still an error. Why: inference fails otherwise exactly where the explicit form succeeds, and ask(r -> Get(r), …) is the chapter’s idiom. Alternative: require the type argument at every request-style call.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): How a trap is contained. The runtime runs an actor’s start, messages and stopping blocks under a return point (_setjmp), and a trap there restores the shadow stack, caller site and owner it recorded and returns to the turn (_longjmp). A count of regions in doubt on each thread (a lock held, which covers Mutex and Once; a lazy val initializing; an Avin function Sysl called) makes a trap inside one stop the program instead. Why: no unwinding tables are needed and the common path costs one _setjmp per turn. Alternatives: unwinding through every frame (needs landing pads in every function), or running each actor on a thread of its own (defeats many actors on few threads).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): Failed‘s reason is the trap’s reason without its place (Failed(integer overflow)), the place being in the report. Alternative: the whole report line, which ties the value to the file layout.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): Every trap in an actor’s code is reported naming the actor, also where it stops the program (a mutex held, a Once, a lazy val, a Sysl call), so the report says where the bug ran. Alternative: the plain avin: trap: line where the program stops, as a thread’s.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): A stack overflow in an actor stops the program, as in a thread, with avin: trap: stack overflow: the stack may run out inside the runtime or the C library holding a lock, so nothing can be said about shared state. Alternative: contain it with siglongjmp from the signal handler (unsafe where the fault came from inside a lock). Review with the user: the chapter lists no exception for it.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): An actor that escalates handles nothing more and waits for its parent’s failure to stop it (it ends Failed), rather than ending at once; a failure escalated to a parent that is already ending or restarting is dropped, since the parent is stopping its children anyway. Why: a failure escalated to the top then stops the program with no stopping block run anywhere, deterministically, and the parent’s supervision decides the whole branch’s fate. Alternative: the child ends on its own and tells the parent, which races the program’s stop against the branch’s stopping blocks.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): A restart also cancels the actor’s watches (its timers are cancelled as the chapter says), since the fresh state sets its own; its reference, number, parent and watchers stay, and a stop asked for before the restart is honoured after it. A restart is reported as avin: restarting Counter#3, after the trap’s line. Alternative: keep the watches, whose messages the fresh state may not expect.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): Restart‘s window counts restarts made within the last within; a limit less than zero or a window not more than zero traps in spawn, as an every interval not more than zero does. Alternative: treat them as zero (a zero window would silently mean “restart for ever”).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): A trap in a stopping block ends the actor Failed with that reason, or keeps the first reason where a trap had failed it already, asks no supervision (so a block that traps during a restart ends the actor), and runs no later onStopping function. Alternative: end it Stopped where it was stopping (hides the bug from its watchers).

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): A pipeToSelf function and a watch’s function run in the receiving actor’s own turn, when it takes the message, rather than wherever the future or the end completed, so a trap in one fails the actor that asked for it and never an unrelated thread or the actor watched. The message of a pipe of a future complete already is still made at once, in the actor’s code. This revises the earlier pipe decision’s “sends from wherever the future completes”. An adapter’s function still runs at the send (its trap is the sender’s), as settled. Alternative: leave them where the value is known, where a trap stops the program from a pool worker or fails the watched actor in the middle of ending. Review with the user: the adapter and the pipe now differ in where their function runs.

  • Settled on the user’s delegation 2026-11-05 (built on branch actor-failure): spawn‘s parameters are (behaviour, onFailure, executor), as the chapter writes them, so an executor alone is given by name (executor = ex). Alternative: keep the executor second.

C bindings

  • Settled by the user 2026-11-05: public C interoperability is no longer deferred. The user’s words, on how to build the MLT library: “Doing it as a c binding would force c interoperability and would provide a good stressor for it. The sysl MLT binding isn’t being used.” So Avin binds C libraries itself (C bindings), and avin-lang/mlt, MLT 7 bound over them, is the stressor that drives the work (roadmap stage 13). Until it is built, C is reached through Sysl as before.

  • Settled 2026-11-05 on the user’s question “Why should C interop go through Sysl since avin generates LLVM IR?”: a C binding is a direct call (how a C binding is compiled). The emitter declares the C symbol in the LLVM IR and Avin’s own code calls it; clang links the library with the flags pkg-config answers. What the Sysl shim does for a Sysl binding — converting arguments and results, the enter_safe/leave_safe bracket of a blocking call, keeping a handle’s reference, callback trampolines and attaching a C-owned thread — is done by Avin’s lowering and the runtime. Why: the shim exists so that Sysl checks a binding against a Sysl signature, and a C binding has none, so a shim would add a compile step, a cache and a Sysl dependency and check nothing. Alternative weighed: lowering each C binding into the Sysl shim as an extern (the director’s first recommendation), which would have had Sysl’s ABI lowering of aggregates for free but no check against C’s header, since Sysl does not read headers.

  • Settled on the user’s delegation 2026-11-05 (built on branch c-interop-design): C bindings (chapter). Each is the recommendation the chapter is written to:

    • The binding copies the C prototype as a string, @c("char *mlt_properties_get(mlt_properties self, const char *name)"), beside an Avin signature in Avin types, matched by position. Why: C’s unsigned, long, const and typedefs cannot be said in Avin types, the prototype is what a reader compares with the header, and clang can check it exactly. Three marker words (out, inout, userdata) and length(p) say what C’s types do not. Alternatives: a vocabulary of C types in Avin (CInt, CSize, …), a second type system in safe code; C types implied by the Avin types, which cannot spell a uint32_t or a typedef.
    • Every binding is checked against its header, by clang, in a generated C unit: a _Static_assert of __builtin_types_compatible_p per binding, the kind of each typedef, every mirror’s layout; the unit also measures typedef widths, enumerators and constants as object-file data read without running it (cross builds measure the target). A package with bindings and no headers is refused. Why: it is the one check on the trusted surface that can be automatic. Alternatives: trusting the declaration as a Sysl extern does; parsing headers in the compiler (the Sysl project refused that too).
    • C libraries are named in the manifest, c-libraries { mlt { pkg-config, headers, install } } (or link = [...]), and every program links the C libraries of all its packages. Why: it is the shape of sysl-dependencies, and a library’s requirement travels with it. Alternative: a module-header @link, as Sysl writes it, which cannot carry headers or the install message.
    • Struct by value goes through clang-compiled glue, which takes and answers the struct by pointer; scalars, pointers and structs by pointer are called directly. Why: clang’s ABI classification is right on every target at once, and the C unit already exists. Alternatives: implementing AAPCS64 (Darwin first) and then System V x86-64 classification in lowering, a per-target body of code whose bugs corrupt arguments silently; refusing by-value structs, which MLT’s mlt_color and mlt_event_data need. Review with the user if the extra call is ever measured to matter.
    • Handles own one C reference: a pointer answered is owned unless the binding says borrowed, which needs a retain; release/retain are a C function or a C expression in self; as: lists the other C types a handle passes as (C’s first-member inheritance), each by a C conversion that lends; keeps: makes the holder keep an Avin object (MLT’s profile), consumes: closes a handle the call takes. Why: the sysl MLT binding found exactly these shapes, and every one is written once per class or binding. Alternative: one Avin handle class per C type with explicit upcast bindings, many more declarations for the same check.
    • C handles keep the single-owner check; shared exempts a thread-safe C object and makes it sendable. Why: most C objects are not thread-safe. Alternative: no check for C handles.
    • Strings: const char * from a string copied with a NUL, a held NUL trapping; a char * result copied and UTF-8-checked (trapping), Array[byte] for unchecked bytes, borrowed unless free: names the freeing function. Alternatives: truncating at a NUL, replacing invalid UTF-8 with U+FFFD (what standard input does), a Result per string result.
    • Null is Option; a null bound as the type itself traps. A C integer bound as Result[unit, int] is Ok on zero. Alternative: a Result for null pointers, which would need an error the C call never gave.
    • Out parameters join the result, as a tuple after the C result or in a status’s Ok. Why: Avin has no pointers to pass. Alternative: filled one-element arrays, which work today but read badly.
    • Buffers are copied (bytes:) or borrowed as an avin.c.ByteView (view:), a read-only, bounds-checked handle holding its owner, closed when its owner is next used. Why: MLT may replace a frame’s image on the next call, so validity is “until the owner changes”, and the owner check catches every use after that. Alternatives: views valid only inside a block (frame.withImage { … }), which forbids keeping one at all; copy only, which costs a copy per frame. Writable views are proposed below, from the Cairo survey.
    • Callbacks: one C-convention trampoline per function type, the closure found through the userdata, the runtime’s Sysl-callback record and callback_enter reused; keeps: holds a registered callback on its handle, whose forget: unregisters each before release; a keeping class without forget is refused; @threaded as for Sysl, a C thread attached per call. Alternative: a registration object returned to the caller, which the user must keep alive.
    • Varargs are refused. A package needing one may carry C. Why: an argument’s type cannot be checked against ..., and a format string from Avin is a hole. Alternatives: allowing calls whose extra arguments the prototype fixes. Whether an Avin package may carry C sources of its own, compiled into the C unit, is itself proposed: it is the trusted escape hatch for macros with arguments and odd shapes, and it widens the trusted surface beyond @c(.
    • No pointer type and no unsafe block in Avin; the @c declarations (and the glue they generate) are the whole trusted surface. Why: soundness in safe code, and one grep finds everything to review. Alternative: an unsafe region with a raw pointer type, which would let a binding’s pleasant layer be written in Avin but makes every Avin file a possible hole.
    • errno was not read by a binding at first; an errno flag answering Result[T, int] from a -1 result was the likely form, and is what was built, with Errno besides (settled 2026-11-15, branch c-opaque-errno).
    • Review with the user: the prototype-string form of @c, the largest syntax choice here; whether a package may carry C sources, which widens the trusted surface beyond the @c lines; the two parser additions (val with no initializer for @c(const:), list-valued annotation arguments); and a missing @threaded on a callback C calls from its own thread being caught only by a trap at run time.
  • Settled on the user’s delegation 2026-11-05 (built on branch c-bindings-scalars): C bindings of scalars (stage 13 step 1), the choices building it made where the chapter is silent.

    • A typedef’s kind is decided by the Avin type and checked by the C unit with __builtin_classify_type: an integer type for an integer, an integer one byte wide (of either sign, as a C char is) for byte, bool for bool, a floating-point type for real, its width measured to choose float or double. Why: the checker cannot see the header, and the Avin type says what the binding means. Alternatives: a kind written in the prototype; measuring every typedef’s kind and refusing in the driver, which needs an expression valid for any type and C has none.
    • unsigned char crosses as byte or as an integer type, char (and a char typedef) only as byte, signed char only as an integer type. Why: the table lists unsigned char in both rows and char only as a byte. Alternative: char as an integer at its measured sign, which makes a program’s meaning depend on the machine.
    • An argument’s trap names the C type, value out of range for u64 (size_t); a result’s names the Avin type, value out of range for long, as a Sysl binding’s do. Alternative: naming both types in both directions.
    • A result the binding declares unit is declared void in the IR, so a discarded pointer or integer needs no measurement; a struct result is refused even then, since it may be returned through memory. Alternative: declaring the measured type and ignoring the value.
    • The measurements are found by a marker in the object’s bytes, one table of two bytes per type (width, sign), rather than by its symbol, so no object format (Mach-O, ELF, COFF) is parsed. Alternative: reading the symbol table, a reader per format.
    • The mismatch diagnostic takes its two types from a pointer of the prototype’s type set to the header’s function, whose clang diagnostic keeps the typedefs’ names, and the header from the note of a redeclaration as the prototype says it; the _Static_assert stays the check, so a clang that only warns on the pointer still refuses the binding. Alternative: the assertion’s own text, which clang writes with every typedef expanded.
    • The toolchain names the pkg-config it asks (Toolchain.pkg_config), so a build for another machine can ask that machine’s, and the corpus asks one that also finds the C fixture in tests/c, which it builds. Alternatives: the environment’s PKG_CONFIG_PATH, which a test cannot set for the compiler it runs in its own process; a package-relative .pc path in the manifest, which the chapter does not have. Review with the user: whether avin should read PKG_CONFIG as autotools does.
    • A function a header declares static inline is not caught by the header check: C lets the unit’s redeclaration inherit the internal linkage, so the binding fails at the link, where the linker names the missing symbol. Alternative: reading the C unit’s symbol table for a local definition, a reader per object format.
  • Settled on the user’s delegation 2026-11-05 (built on branch cairo-survey): C bindings, from the Cairo survey (chapter). The user asked for avin-lang/cairo, Cairo 1.18 bound over the C bindings beside avin-lang/mlt, ported from the reference binding’s surface. Mapping it onto the chapter found these lacks; each is the smallest addition that covers it:

    • An integer bound as bool is false for zero, true otherwise; a bool passes 0/1. Why: cairo_bool_t is an int, and so is every pre-C99 library’s truth value. Alternatives: binding it as int and comparing in Avin at every call site; a truth marker word in the prototype, which says what the Avin type already does.
    • A status that is a C enum binds as Result[unit, E] with E its mirror: Ok for the zero enumerator, Err(variant) otherwise; the mirror keeps its zero variant, which a callback answers. Why: Cairo’s cairo_status_t is the error type itself, and mapping an int back to it by hand repeats the enum. Alternatives: Result[unit, int] and a mapping function; requiring the mirror to omit its zero variant, which a callback answering Success could not then name.
    • Latched errors need nothing new: the status query is an ordinary binding, and the library asks it after constructors, before output (writePng, finish, the PNG stream) and on request, answering Result[_, CairoError] there and unit from the drawing calls. Why: Cairo latches errors on the object and makes every later call a no-op, so the next query sees every failure. Alternatives: a per-class status: expression the compiler checks after every call, trapping or answering Result from all ~150 drawing calls, which costs a call each and makes every line of drawing code carry a ?; trapping on any latched error, which turns a bad PNG file into a crash. Review with the user: whether drawing calls should trap on a latched error in a debug build.
    • attach: ties what a handle keeps to the C object’s lifetime, through the library’s destroy notification (cairo_surface_set_user_data, mlt_properties_set_data): the kept objects move to a pinned runtime record that C’s destroy releases; key: names the static key type the C unit defines per class. Why: Cairo contexts and surface patterns reference their surface, so the Avin Surface can be collected while C still draws into the ByteBlock (or font file) it was made over — a use after free that keeps: on the handle does not prevent. The same gap reaches MLT wherever a C object that keeps a pointer (a producer keeping its profile) is held by another C object (a playlist) after its Avin handle is collected. Alternatives: keeping the kept objects for the rest of the program, a leak per surface; refusing keeps: on handles C can reference, which refuses create_for_data; making the library hold every surface in an Avin table. Review with the user: whether the MLT keeps: bindings should move to attach: too.
    • Field accessors take expressions and bounded indices: field: a C lvalue in self and the accessor’s parameters, bound: the C expression an index is checked below; an index with no bound is refused. Why: cairo_path_t is a C-owned array of a union, which no mirror may hold, and reading it element by element through glue keeps the union out of Avin. Alternatives: an opaque value per element, which needs by-value glue for every read; a package-carried C file flattening the path into doubles, the trusted escape hatch proposed above, wider than one line.
    • Option of a mirror for a nullable const T *. Why: cairo_recording_surface_create takes null for unbounded extents. Alternative: two bindings, one passing a sentinel struct.
    • Upper-case enumerators match an upper-case prefix (CAIRO_FORMAT_ → Argb32). Why: most C libraries write enumerators in upper case. Alternative: @c("name") on every variant.
    • String and real constants: @c(const:) reads a string literal’s bytes as a measurement, checked as UTF-8. Why: Cairo’s tag names (CAIRO_TAG_DEST) are string macros. Alternative: copying the literals into Avin, which drifts if the header changes them.
    • Arrays of mirrors go to const T * converted into C memory for the call; arrays C allocates are copied out with array:, length: and free: (generalizing bytes:). Why: Cairo’s glyph arrays, in (cairo_show_glyphs) and out (cairo_scaled_font_text_to_glyphs). Alternatives: a handle on cairo_glyph_allocate‘s array with indexed writers, a C-shaped API in Avin code; writing a converted array back for non-const pointers, which no Cairo call needs.
    • view on the result, and writable views: a bare view names the C result as the memory; writable answers an avin.c.MutByteView (a ByteView with update, fill, write), closed by the owner’s next use like any view. Why: Cairo’s pixel access is cairo_image_surface_get_data‘s result, and the reference program writes pixels and calls mark_dirty, which, being a use, closes the view so a write after it traps. Alternatives: copy out, edit, copy back with create_for_data (a full copy per edit); a block-scoped withPixels { … }, which the chapter already weighed against for reading; one ByteView type with a run-time writable flag, which moves a type error to run time. A stable marker for owner methods that do not close views (Cairo’s get_width after get_data) was weighed and left out: the library reads those first.
    • avin.c.ByteBlock, memory Avin gives C: fixed-length, zeroed, outside the collected heap, never copied at a call, read and written like a MutByteView, freed when collected, kept by C through keeps: (and attach:). Why: cairo_image_surface_create_for_data keeps the pointer and writes into it for the surface’s life, which neither a copied array nor a heap array (moved out of the heap for blocking calls) can be. Alternatives: pinning an Array[byte] in the collector, which pins the collector’s design to non-moving arrays; leaving create_for_data unbound (the reference program uses it).
    • Memory lent to a callback is a view closed when it returns, const a ByteView, otherwise a MutByteView, its length from a length(p) beside it; a function-pointer typedef is written out in the prototype. Why: Cairo’s PNG write and read streams pass (closure, data, length). Alternatives: a copied Array[byte] per chunk (fine for writing, impossible for reading, where the callback must fill C’s buffer).
    • Steps 8 and 9 of stage 13 swap: buffers before callbacks, so callbacks can take views. Why: the PNG stream needs both, and neither MLT step needs the other. Alternative: callbacks first with copied arrays, the read stream deferred.
    • The survey’s three questions, settled with it. attach: for MLT: only where C keeps something Avin owns that C’s own reference count does not cover (memory Avin gives C, a callback’s closure); MLT’s playlists, tractors and services take their own reference to what they are given, so a counted handle needs nothing more, and the MLT steps are audited for the other cases. Review with the user. No trap on a latched error in debug builds: a program behaves the same at every optimization level; the binding checks the status after constructors and before output, as the chapter says. A FreeType binding (avin-lang/freetype) waits until Cairo’s font-face step needs it; the toy font API and the platform’s own font backend come first.
  • Settled on the user’s delegation 2026-11-05 (built on branch freetype-design): C bindings, from the FreeType survey (chapter). The user: “Yes we’ll need a freetype binding to work with cairo.” The user (2026-11-05): “Yes we’ll need a freetype binding to work with cairo.” A third stressor, avin-lang/freetype, binds FreeType 2 (pkg-config freetype2) to the reference binding’s surface, and avin-lang/cairo depends on it for Cairo’s FreeType font faces (cairo-ft.h). This replaces the Cairo survey’s “a FreeType binding waits until Cairo’s font-face step needs it”. Mapping the reference surface onto the chapter found these lacks; each is the smallest addition that covers it:

    • A binding may name a handle class of another package its package depends on: the prototype names the class’s own C type or an as: type; the class’s glue is the declaring package’s, compiled once; the package’s bindings are checked after the headers, and with the pkg-config flags, of every package whose handle classes they name, in dependency order; ownership (lent, keeps:, consumes:, attach:, owned and borrowed results) crosses unchanged. Why: cairo_ft_font_face_create_for_ft_face takes FreeType’s FT_Face, and a header of one library need not include the other’s (Cairo’s happens to; most do not). Alternatives: a third package holding only the shared handle class, which the reference binding needs only to break a dependency cycle Avin does not have; Cairo declaring its own FT_Face handle, two handles with two owners and two releases on one C object, a double free; trusting each library’s header to include the other’s.
    • A header may be named by a macro: an entry of headers that is a C identifier is emitted as #include NAME, defined by an earlier entry, and a macro no earlier header defines is reported at the entry. Why: FreeType documents its headers by macro (#include <ft2build.h> then #include FT_FREETYPE_H), and Cairo’s own cairo-ft.h includes it so. Alternatives: naming the path the macro expands to (<freetype/freetype.h>), which the installed FreeType’s own ft2build.h shows and which needs nothing new, but writes into the manifest a layout that FreeType’s macros exist to keep its users out of; a prelude string of raw C lines in the manifest, wider than one rule and the start of a C file in HOCON.
    • A kept handle whose class declares retain is held by a C reference, taken through that retain when the call succeeds and given back through its release after the holder’s own release. Why: the collector finalizes the unreachable in address order, so a Face and the Library it keeps, dead in one collection, may be finalized library first; freeing the library frees every face still in it, and the face’s FT_Done_Face then frees one twice. With the reference, the library’s release, FT_Done_Library, only drops a count (FT_Done_FreeType also frees the memory manager whatever the count, so it is no release). MLT’s Consumer keeping its Playlist (keeps: "source") gains the same order. Alternatives: ordered finalization in the collector (kept before keeper), which Avin cannot change and which the collector’s address-order sweep does not offer; holding the Avin object and taking the order on trust, a use after free whenever a release touches what it keeps; making the library’s release a no-op while faces exist, a count in Avin of what C already counts.
    • kept: "name: Class" lets a holder’s release:/retain: name what it keeps, as that handle’s C pointer; the class is made only by bindings keeping exactly one handle of that class, and an unused name is refused. Why: FT_Done_MM_Var(library, master) frees the variation descriptor through a library the descriptor does not record; the face it came from publishes it (face->glyph->library), and the C reference above keeps that face valid until after the release. Alternatives: walking the descriptor into Avin data and freeing it inside one binding, which needs a binding that copies a C struct holding arrays of structs (a larger addition); a release taking a second argument from a per-handle C field the runtime stores, the same thing with a less readable spelling; leaving the variation API unbound.
    • keeps: takes a list (keeps: ["library", "base"]). Why: FT_New_Memory_Face keeps its library and its memory. Alternative: repeating the key, which HOCON merges rather than lists.
    • keeps: naming an array parameter is refused, since its C copy lives for the call; memory C keeps is a ByteBlock. Why: FT_New_Memory_Face reads its buffer lazily for the face’s life. Alternative: pinning the array, which the ByteBlock decision already weighed against.
    • length(p) may mark an inout pointer to an integer: the array’s length is written in, C’s answer is part of the result, checked to be no more than the length; None for an Option of the array passes null and zero. Why: FT_Load_Sfnt_Table takes FT_ULong *length, and is called once with no buffer to learn a table’s size, then again to fill one. Alternatives: an inout length the caller passes, which lets the length and the array disagree (a read past the end); a ByteBlock sized by a first call, the same disagreement.
    • A field accessor may answer a view of a byte-pointer field, length: a C expression in self. Why: the glyph bitmap is face->glyph->bitmap.buffer, |pitch| * rows bytes the next load replaces; the view’s closing on the face’s next use is exactly FreeType’s rule. Alternatives: bytes: on a field, a copy of every glyph before the library walks it, which the library could still choose; a glue function per field answering the pointer, the same with more C. The view’s bounds check catches the reference binding’s row * pitch indexing, which reads before the buffer when pitch is negative.
    • Cairo’s FreeType font face is an attach: class keeping the Face. Cairo keeps the FT_Face without a reference, documents that it must outlive every font face made from it, and asks for it to be given back from cairo_font_face_set_user_data‘s destructor; contexts and scaled fonts reference the font face, so keeps: on the Avin handle is not enough. The destroy unpins the record and the Face is then finalized as usual. Alternative: a destroy that calls FT_Done_Face itself, from whatever thread drops the last reference, while an Avin Face may still be in use: FreeType’s face count is not atomic.
    • FT_Error_String binds as Option[string], and the library carries its own names for the codes, as @c(const:) values of fterrors.h‘s FT_Err_*. Why: Homebrew’s FreeType is built without FT_CONFIG_OPTION_ERROR_STRINGS, so the function answers null there.
    • The test font is Kaisei Decol Regular, from the reference repository, under the SIL Open Font License 1.1 (Copyright 2020 The Kaisei Project Authors, no Reserved Font Name), bundled with its OFL.txt in the package’s tests. Alternative: a smaller OFL Latin font (4.4 MB is large for a test fixture), at the cost of a font the reference program’s output was not made with. Review with the user: the fixture’s size.
    • Left out: cairo_ft_font_options_substitute, which takes a fontconfig FcPattern * and waits on a fontconfig binding; FT_Outline_Decompose and the other callback APIs, which the reference binding does not reach.
    • The survey’s two questions, settled with it. The test font is a small OFL font, not Kaisei Decol Regular (OFL 1.1 and usable, but 4.4 MB): a Latin face of a few hundred kilobytes, its licence file beside it in the package’s tests, keeps the repository light, and the reference binding’s outputs that need Kaisei’s glyphs are reproduced with the small face’s instead. cairo_ft_font_options_substitute waits on a fontconfig binding: it takes a fontconfig pattern, and nothing else in cairo or freetype needs fontconfig. The macro-named headers and FT_Error_String, which the survey placed in step 2, ride step 3, since step 2 was already being built.
  • Settled on the user’s delegation 2026-11-05 (built on branch c-bindings-strings): C bindings of strings and truth values (stage 13 step 2), the choices building it made where the chapter is silent.

    • A C string is exactly one pointer to a plain char, const when the qualifier comes before the star (const char *, char const *); a qualifier after it (char *const) is the pointer’s own and changes nothing. signed char *, unsigned char *, void * and char ** are other pointers. Why: those are the types C’s string functions use, and the header check catches any other spelling. Alternative: taking unsigned char * as a string too, which libraries use for bytes, not text.
    • A typedef crossing as a string is checked by the C unit to be char * or const char * as a result, and const char * as a parameter (__builtin_types_compatible_p), and is not measured. Why: the same rule the chapter gives a spelled char * parameter, which C may write.
    • A typedef crossing as bool may be a C bool or an integer type (checked with __builtin_classify_type), and is passed as the integer it measures; a C bool typedef is then one byte holding 0 or 1, the same registers as an i1. An integer keyword crossing as bool may be any but a plain char, which crosses only as byte. Why: the checker cannot tell a bool typedef from cairo_bool_t, and one measured path serves both. Alternative: a marker word for a truth value, which the Cairo survey weighed and set aside.
    • The traps’ words: the string passed to `s` of `length` holds a NUL at byte 3 (the chapter’s), `fixture_invalid` answered a string that is not UTF-8 at byte 2 (the offset is where the first ill-formed sequence starts, as from_utf8 reports it; overlong forms, surrogates, values past U+10FFFF and a cut-off sequence are all ill-formed), and `fixture_maybe` answered null (the chapter’s). A parameter declared with a pattern rather than a name is named parameter N. Alternative: naming the binding rather than the C function in the result traps; the C function is what answered.
    • A string argument’s copy is freed after the result is converted, not when the call returns, since C may answer a pointer into a string it was passed (strchr, strstr); the copies are made with malloc by the runtime (avin_rt_c_string_in) and freed by avin_rt_c_string_free. A non-blocking call cannot collect, and the collector never moves an object, but the copy is still needed for the NUL. Alternative: one buffer per thread reused across calls, which a callback calling the same binding again would overwrite.
    • free: accepts a function the headers declare as void (void *), void (char *), void (const char *) or void (<the result's type>); anything else, including one answering a value, is refused at the binding, as is a name no header declares. It is called only for a non-null answer, after the copy is made, and a binding whose result is unit with free: frees what C answered and discards it. free: on a binding that answers no string is refused at check. Why: a free function that answers a status is not one a binding can ignore, and a library’s own free functions are seldom safe on null. Alternative: refusing free: on a unit result, which would leave no way to call such a function without leaking.
    • An Array[byte] result may be an Option too, null being None, and a null bound as a bare Array[byte] traps as a bare string does. An Array[byte] parameter is refused until arrays are built. Alternative: an empty array for null, which hides the difference C makes.

    Review with the user: whether free: on a unit result should stay legal.

  • Settled on the user’s delegation 2026-11-05 (built on branch c-bindings-handles): C handles (stage 13 step 3), the choices building them made where the chapter is silent.

    • shared is a bare word of the class’s @c, @c(type: …, release: …, shared). Why: the @c( lines are the whole trusted surface, and a thread-safety claim is one of them; no class modifier says it today. Alternative: a shared class modifier, a keyword for one use.
    • A handle’s method is bound by a prototype taking the receiver first, named self, of the class’s C type (or that type const); the method’s parameters follow by position. Why: the chapter’s every example writes it so, and the name makes the receiver visible in the C text. Alternative: the receiver at any position named self, which no surveyed library needs.
    • What keeps is the handle the binding answers, else a method’s receiver, and a method answering a handle may name self in keeps: to have the new handle keep the receiver. Nothing is kept unless the call succeeded: a handle answered (not null), or a zero status. Why: a library object made by a method of another usually depends on it (a face’s variation descriptor). Alternative: the receiver always keeps for a method, which leaves the made handle unprotected.
    • consumes: closes the handle passed whatever the call answers, and may name self; the consumed handle keeps what it kept until it is collected or closed. Why: C functions that take a reference take it unconditionally, and giving back what the consumed object keeps while C still holds the object would be a use after free. Alternatives: closing only on success, which most taking functions do not distinguish; releasing what it keeps at once.
    • A holder keeping a handle by a C reference also takes one to each C object that handle so holds, after it, given back after it. Why: found under the collector’s stress in the fixture: a variation descriptor keeps a face, the face’s own handle is collected first and gives back its reference to the library, and the library is freed under a face the descriptor’s release reaches through. Alternatives: holding the kept handle as the Avin object as well, which orders nothing within one collection; refusing chains of kept handles, which FreeType’s API is.
    • The class kept: names declares retain and no kept: of its own, and is found in the holder’s module or by its module and name (freetype.Face); retain: sees the name only where it takes a borrowed result’s reference, as the pointer of the handle the binding keeps; a holder keeping a handle whose class has kept: holds it as the Avin object. Why: the name is a pointer only while a C reference holds it, and a class with kept: cannot be given back from its pointer alone. Alternative: storing every kept name in the C reference’s record, which then has to hold references of its own, the same chain again.
    • A status’s code is any integer type, converted with the result’s range check (Result[unit, long] for long long; a long long code past int traps for Result[unit, int]). Alternative: int only, which loses a long status’s code.
    • The C unit includes a package’s headers after those of every package whose handle classes its bindings name, and otherwise in the order the libraries are listed, the program’s own first. Why: that is the only order the header check depends on, and it is read from the bindings themselves. Alternative: a topological order of the whole package graph, which reorders headers no binding needs reordered.

    Review with the user: shared as a word of @c rather than a modifier, and the chain of C references a kept handle brings with it.

  • Settled on the user’s delegation 2026-11-05 (built on branch c-bindings-fields): as: conversions and field accessors (stage 13 step 4), the choices building them made where the chapter is silent.

    • An as: entry’s right side is a C function’s name or an expression in self, as release:‘s is, and as: is one string or a list. The C unit checks with __builtin_types_compatible_p that what it makes is the entry’s type. Why: one rule for every piece of glue, and C would otherwise convert a wrong pointer silently (the C unit compiles with warnings off). Alternative: an expression only, which makes MLT’s every entry repeat (self).
    • A conversion is made after the closed and owner checks, from the handle’s own pointer, and passes null as null; what a binding keeps: or consumes: is the handle itself, held by its class’s own retain, never the converted pointer. Why: the converted pointer is lent and may point into the object, so a reference taken through another class’s glue would be the wrong count. Alternative: holding the converted pointer, which has no release of its own.
    • A field is a member path read as self-> followed by it; its type is named in the C unit by __typeof__ with the indices replaced by zero, so it is measured and checked without being read. Why: every surveyed accessor (MLT’s profile, FreeType’s face and glyph slot, Cairo’s path) is a member path, and an unevaluated operand needs no index. Alternative: a full C expression in self, which nothing surveyed needs and which makes self-> noise in each.
    • Only scalars are written; a string or handle field is read only. Why: a string or a reference stored into a C struct needs an owner that frees or gives it back, which no surveyed library asks Avin to be. Alternative: writing strings copied with malloc and never freed.
    • Indices are int or long, passed as long long, one bound: each, in order, a list for more than one; a bound may use self and the indices. The check is 0 <= index < bound, made in Avin before the glue reads, trapping with “index i of Class.method out of range”. Why: a two-dimensional field needs a bound per index, and the trap names the index that was out of range. Alternative: one bound for all indices.
    • A handle read from a field is lent, without borrowed written, and its class must declare retain and no kept:. Why: a struct’s pointer is never the reader’s to give back. Alternative: requiring borrowed, a word that could only ever be written one way.

    Review with the user: writers of scalars only.

  • Settled on the user’s delegation 2026-11-05: Dates and times (branch datetime-design), the choices the design makes beyond the user’s settled entry. Where the slate design leaves a name open, the names follow the widely used date/time library family of Avin’s reference standard library ecosystem (atZone, plusDays, withYear, toInstant, isBefore, toMinutes), except where a slate or a simpler spelling is better, as each entry says.

  • Representation and ranges. Every type but Zone is a data type whose fields are its representation (Duration(micros), Instant(epochMicros), Date(epochDay: int), Time(microsOfDay), DateTime(date, time), Zoned(dateTime, offset, zone), Period(months, days)); the makers check and the constructors take fields as given. A Duration and an Instant span a whole long, a Date a whole int of days, and what leaves a range traps. Why: data types are unboxed values, and every field value of Duration, Instant, Date and Period is meaningful, so those constructors are total. Alternatives: one common range for every type (±290,000 years), cleaner to state, but enforceable only with constructors the module keeps to itself, which Avin does not have; classes with private state, boxed and with identity. A Time or Zoned built through its constructor with fields no maker would give is the cost. Review with the user: a module-private constructor would close it.

  • Days and weeks are exact durations; a calendar day is plusDays(n) or Period(0, n). The settled list makes days and weeks durations, as Sysl 0.10.0’s are, so Period holds months and days (Sysl’s Period(months, days)), months and years make it, and Date + Duration does not compile (date.plusDays(1)). On a Zoned, z + days(1) is 24 hours and z.plusDays(1) the same wall clock a day later. Why: the user’s list and Sysl agree, and the exact/calendar line stays in the types. Alternatives: slate’s implementation, where days and weeks make periods so zoned + days(1) keeps the wall clock, which contradicts the settled list. Review with the user: the two spellings answer differently across a daylight-saving change.

  • Names where slate leaves them open, and where slate’s are kept. t.atZone(z), d.atTime(t), t.atDate(d), d.atStartOfDay(), zt.toInstant, plusYears/plusMonths/plusWeeks/ plusDays (no minus forms: a negative count), withYear/withMonth/withDay/withHour…, isBefore/isAfter/isSameInstant, a duration’s toHours() (whole) and toHoursPart(), a date’s daysUntil/monthsUntil/until. Kept from slate as better: weekday() (shorter, and the name of its type) over dayOfWeek, day() and so withDay over dayOfMonth, onOrAfter(w) and onOrBefore(w) over adjuster objects, parseTimestamp, the epoch* makers. Slate’s single at is spelt atZone/atTime/atDate, since one overloaded word hides which conversion is meant and atZone names what can fail. startOf("month") becomes startOfMonth() and its siblings, so a date’s startOfHour is a compile error rather than a run-time one. Alternatives: slate’s d.minutes for whole minutes (the same word makes and measures), dayOfMonth.

  • Choosing an instant for a skipped or repeated reading. dt.atZone(z) answers Result[Zoned, ZoneTimeError] (Skipped, Repeated), and atZoneEarlier(z)/atZoneLater(z), Sysl’s at_earlier/at_later, always answer: the earlier or later instant of a repeated hour, and in a skipped hour both push the reading past the gap by its length. A period on a Zoned, a with… and startOfDay push past a gap and, in a repeated hour, keep the offset the reading had where it is one of the two and otherwise take the earlier. Why: what the binding gives, and the established rule. Alternatives: slate’s string choice ("earlier" | "later" | "after"), a Pick enum argument.

  • A Zoned‘s equality and order. == needs the same instant in the same zone; Ord orders by instant, then wall reading, then zone name, so it agrees with == and a TreeMap keeps two readings of one instant; isBefore, isAfter and isSameInstant compare instants alone. Alternatives: slate’s, where < compares only the instant and so is false both ways for two zones’ readings of one instant, an Ord that disagrees with ==. Review with the user: < between two zones’ readings of one instant is decided by the zone names.

  • Text. ISO 8601 with T, the seconds always written, the fraction only when there is one and without trailing zeros (slate’s), years outside 0–9999 signed; a fixed zone’s Zoned writes no bracketed name. A duration keeps the form the user settled on 2026-11-04, its largest unit of s, ms and us (90.5s, 1.5ms); a period writes as 1y 2mo 3d. Why: one shape per column; the duration form is the user’s own decision, which a delegated choice does not overturn. Alternatives: Sysl’s renderers (a space for T, seconds dropped when zero), today’s WallTime form with six fraction digits always, slate’s 1h 30m duration form (the design agent’s proposal). Review with the user: whether durations should move to slate’s 1h 30m form.

  • Parsing. parseDate, parseTime, parseDateTime, parseTimestamp and parseZoned, each a Result with TimeParseError (BadShape(text, at), OutOfRange(text, field), Trailing(text, at), UnknownZone(text, name), at a byte offset), every display read back, ASCII digits only, a timestamp’s offset required. Why: Sysl’s error kinds, with the text a message must quote. Alternatives: a message string only (slate); reading by pattern, left out until wanted.

  • Patterns. format(pattern) with slate’s pattern language (YYYY, MMMM, WWWW, h12, a, f…, z…, |literal|, || a bar), English names and no locales; an element the value lacks, a malformed run and an unclosed bar trap, the pattern being program text. Instant has no format. Alternatives: a compiled pattern answering a Result, as Regex.compile does, for patterns read from outside.

  • Zones. zone(name) answers Result[Zone, ZoneError] (UnknownZone, NotAZoneName decided before any file is read, Malformed); localZone() always answers, utc where the host names no zone it can read; fixedZone(offset: Duration) takes whole minutes within ±23:59 and traps otherwise. An offset is a Duration and Sysl’s Offset stays behind the binding. isDaylightSavingAt and abbreviationAt read the zone’s table through sysl.time.tzif. Alternatives: an Offset type of its own (a ninth public type), localZone() as a Result.

  • The wall clock reads microseconds as the host gives them. Alternatives: whole milliseconds, slate’s choice for agreement with a back end Avin does not have.

  • Smaller additions: isoWeek() and isoWeekYear(); endOfMonth(); Date - Date a Period of days; d / e between durations a long; a Period and a Zone Eq and Hash but not Ord; a Time with no arithmetic; Weekday ordered Monday to Sunday with isoNumber() and plus(n); months and years as methods on int as the durations are on int and long; 3 * d does not compile, the built-in types’ operators gaining no methods.

  • Delays. Every delay in the library is a Duration: Future.await and Condition.waitFor gain overloads taking one beside their milliseconds; a command’s deadline is a monotonic() reading; actor timers keep the runtime’s monotonic microseconds and their Duration parameters. Alternatives: leaving the millisecond forms alone.

  • Settled on the user’s delegation 2026-11-05: Data types of one module may share a variant’s name (branch shared-variants). Replaces the rule that a variant’s name is unique across a module’s files, which kept a C or Sysl binding from mirroring two enums with one variant name (Slant.Normal, Weight.Normal; sysl.process‘s Stdio.Inherit and Group.Inherit) and two machines from sharing Idle. Review with the user. The parts:

    • The expected type decides a bare use. A shared name is the variant of the type expected where it is written: a parameter’s, an annotated binding’s, a result’s, a field’s, a collection’s element, and in a pattern the matched value’s, so nested patterns decide each name by its field’s type. Why: it is how the qualified form’s work is already done everywhere a type is known, and it keeps bare names, Avin’s usual form, working in all the places a shared name is actually used. Alternatives: refusing every bare use of a shared name (mirrors would read Weight.Normal everywhere); picking the first declared type (silent, order-dependent); deciding also by shape, a call meaning the variant with fields (a second rule for a reader to know; not built).
    • Where nothing decides it, an error names the types and the qualified forms: “Normal is a variant of Slant and Weight, and nothing here expects one of those types: write Slant.Normal or Weight.Normal“. An expected type that is none of them is not a decision, and Any or a trait expected is not either. Reached through a module, the forms keep the module: fonts.Slant.Normal. Why: the qualified form always works, so the fix is the message.
    • A comparison’s other operand decides, as it does a number literal’s type: w == Normal, Normal != w. A shared name, bare or called, is checked after the other operands, with their type expected. Why: comparing with a variant is the commonest use outside a match. Alternative: requiring is Normal or Weight.Normal there.
    • Coverage, derived impls and shapes are per type and unchanged: a match over Weight is covered by Weight‘s own variants; Display/Debug write the name; Eq/Hash/Ord, walk and build use the type’s own declaration order; layouts and mirrors are keyed by type, and a mirrored variant crosses into Sysl as its own enum’s.
    • A shared name is still one name of the module: a function, module-level value or object of that name is refused (“Normal is already a variant of Slant and Weight“), a companion object may not have a name another type’s variant has, and the name is not a type. Within one type a variant’s name stays its own. Why: functions and values are not chosen by expected type, so the clash would stay unresolvable. Alternative: letting a function or value hide the variants.
    • Imports: import m.Normal is allowed where m‘s types share Normal; the imported name is shared in the importing file as in m, and decided the same way. Why: it costs no new rule and a file importing one of the names for its own type’s use reads naturally. Alternative weighed: refusing the import and asking for the type (import m.Weight, then Weight.Normal), which the brief leaned to; refused because the bare form then could not be written at all in that file.
    • Visibility: a shared name is seen from another module where any of its types is public, and a private type’s variant is left out there, so where only one type is public its variant needs no deciding (signals.Stop). Where all are private the name is private to its module.
    • Machines: two machines’ states, and a state and an event’s variant, may share a name, by the same rule (amending the settled machine entry above). An arm’s result is its own State, handle‘s argument the event type, so machine code needs nothing written.
  • Settled on the user’s delegation 2026-11-05 (built on branch actor-state): state blocks in actors (stage 12 step 8), the choices building it made where the chapter is silent.

    • Only a transition runs leave: an actor that stops, fails or restarts runs its stopping block, which reads state(), and not the current state’s leave. Why: the chapter defines leave as running when the actor moves out of a state into another, and stopping is already the one block an ending runs; running both would run two cleanups for one ending, in an order the program cannot see. Alternative: running the current state’s leave before stopping, which suits a state holding a resource (the chapter’s Ready(socket)) but runs code written for a transition when none happens.
    • A trap in enter or leave fails the actor as a trap in an arm does, and a trap in a leave leaves the actor in the state it was leaving; one in an enter leaves it in the state entered. The first state’s enter runs as the last statement of the body, so a restart runs it again, and a trap there fails the actor as it starts. Why: the transition’s steps run in the order the chapter gives, inside the turn, and supervision already decides what a trap in a turn means. Alternative: rolling the state back on a trap, which needs a copy of the state before every transition.
    • An actor’s State type and its states are private to its module, as the class holding its state is, and state() is one of the actor’s own methods, not its reference’s. The states are still names of the module, and share a name with another type’s variant there, a machine’s states included, by the rule for shared variant names above. Why: nothing outside an actor reaches its state. Alternative: a public State type another module could match on, which nothing could hand it.
    • An actor with states needs no receive block, as a machine needs none; without states it still needs one. A shared arm of an actor with states yields a state, as a machine’s does.
    • No reentrancy trap: only the runtime hands an actor a message, one turn at a time, so the actor needs no busy flag of the kind a machine’s handle keeps.
    • A sendable function reading a stateful actor’s fields is refused with the advice to copy into a val, not to make a field a val, which cannot make an actor that moves between states sendable.

    Review with the user: the first choice; whether an ending should run the current state’s leave is the one a program holding a resource in a state notices.

  • Settled on the user’s delegation 2026-11-05: A variant pattern writes no type arguments (branch qualified-variant-targs). In an expression a generic type’s variant takes its type arguments on the type, Heap[int].Leaf, or on the variant, Heap.Leaf[int] and Heap.Node[int](…) (settled by the declarations chapter’s Option.Some[long](9); only the fieldless form had been missing, and is now built). In a pattern neither form is written: case Heap.Leaf[int], case Heap[int].Node(…) and case Some[int](x) are reported, “a pattern takes its type arguments from the value it matches; write Heap.Leaf“. Why: the scrutinee’s type already decides them, so a written list could only repeat it or be an error, and a test of the instance is a type pattern’s job (x: Box[int]). Alternatives weighed: accepting both spellings in patterns with the arguments required to equal the scrutinee’s (more symmetric with expressions, but adds a rule that only restates the type); accepting them and ignoring them (silently wrong where they differ). Revisit if a pattern on an Any scrutinee should match a variant at one instance, which would give written arguments a meaning.

  • Settled on the user’s delegation 2026-11-05: C enum mirrors, constants, statuses and out parameters, as built (branch c-bindings-enums, chapter). The chapter left these open:

    • An enumerator’s words and case. A word starts at each upper-case letter of the variant’s name, a digit and _ staying with the word before them (Yuv420p one word, ColorDodge two, Rgb16_565 → RGB16_565); they are upper case where the prefix has an upper-case letter and no lower-case one, and lower case otherwise, a prefix with no letter or none at all included. Why: it is the case rule the chapter already states, made total. Alternatives: a case: word on the mirror; matching the header’s enumerators case-insensitively, which the C unit cannot list. A name starting with a digit after the prefix (CAIRO_PDF_VERSION_1_4) is named with the variant’s own @c, and the C unit’s refusal of the derived name says so.
    • A mirror crosses only where the prototype writes its C type (or that type const), not at a plain int that happens to carry it. Why: the binding then checks that the C function means this enum. Alternative: any integer position, which loses that check. Review with the user: some C APIs take an enum’s values as int.
    • Duplicated values: a variant crosses as its enumerator’s value, and a value C answers is the first variant in declaration order holding it. Alternative: refusing a mirror listing two enumerators of one value, which refuses aliases a header keeps for compatibility.
    • A status mirror is Ok for zero whether or not it lists a zero variant. Why: zero is success by the binding’s form, not by the mirror. Alternative: requiring the zero variant.
    • Constants: an integer type takes any integer constant expression the headers define, enumerators, characters and a static const clang folds among them; real takes a floating or an integer constant; string only a string literal, its bytes checked as UTF-8. A value its Avin type cannot hold is refused at the constant with its value. bool, char and byte constants are refused. Why: the three kinds the chapter names, each checked where it is read. Alternatives: narrowing silently; a bool constant from an integer (left for when a library needs one).
    • out and inout are written before the parameter’s type (out int *x), the parameter a pointer to what is answered, never to const; a parameter may still be named out. A non-void C result is left out where the binding’s result is the out values alone (int f(out int *a) bound as -> int answers the out value), and is the first part where the result is a tuple of one more. Why: it is the chapter’s “a C result bound as unit leaves the tuple without it” without a unit part to write. Alternative: requiring a tuple whose first part is unit.
    • An out slot starts as zero or null, so a C function that writes nothing answers zero, None, or stops where the type has no null. A handle is never inout: whether C kept the reference it was passed or replaced it cannot be said. Alternative: passing it in and treating what comes back as a new owned handle, which double-frees where C answers the same pointer.
    • An inout string is passed as a NUL-terminated copy through const char ** and read back where C pointed it, before the copy is freed, so C may move it into the copy; a string C answers through an out pointer is left to C, as a borrowed result is.
    • What keeps: keeps with out handles: the holder is the handle the C result is, else the first handle answered through an out pointer, else the receiver; a status keeps only when it is zero, and a None handle keeps nothing. borrowed applies to every handle the binding answers.
  • Settled on the user’s delegation 2026-11-05 (branch time-instant): A Duration given to a millisecond wait is rounded up to whole milliseconds. Future.await(d) and Condition.waitFor(d) pass the runtime’s millisecond wait ceil(d / 1ms), so await(micros(1)) waits a millisecond; a duration of zero or less asks without waiting, as a count that is not positive does. Why: a timed wait should never end before the time it was given, the rule setTimeout already follows for a socket. Alternatives: rounding down, which turns every duration under a millisecond into no wait at all; a microsecond wait in the runtime, which the condition variable beneath does not offer.

  • Settled on the user’s delegation 2026-11-05 (branch time-instant): toMicrosPart() is the part below the second (micros % 1_000_000), as the chapter’s list goes from toSecondsPart() straight to it, with no toMillisPart(). Why: the four parts then cover a duration with nothing left over (hours below the day, minutes, seconds, microseconds). Alternatives: the part below the millisecond, which would need a toMillisPart() beside it to be complete.

  • Settled on the user’s delegation 2026-11-05: An expected type reaches a core library variant that a nearer one hides (branch none-shadowing). A module’s own variant None (a C mirror’s ImageFormat.None) hid Option‘s throughout the module, so return None from a -> Option[T] function, val x: Option[int] = None and a None pattern on an option were all refused. Now, where the type expected at a bare variant name (every position of the shared-variant rule above: parameter, annotated binding, result, field, collection element, comparison operand, pattern) is a data type that none of the nearer variants of that name belongs to, but the core library’s variant of the name does, that variant is meant: None, Some, Ok, Err, Left, Right and any later prelude variant. Where nothing decides it the nearer declaration wins, as the scoping order always said, so val f = None in that module is still ImageFormat.None; an expected type that is neither (an int, Any, a trait) also leaves the nearer one, reported against what was expected. Only the core library’s variants are reached this way: a file may not import a name its module declares, so an imported variant is never the hidden one, and an imported None hides Option‘s exactly as a module’s own does. Review with the user: it makes programs valid that were refused, and changes no valid program’s meaning (a use the rule now gives to Option was a type error before). Why: the rule for shared names is the one a reader already knows, and a C mirror’s None is common enough that writing Option.None in every option-returning function of a binding module would be a tax on exactly the code the bindings chapter shows. The undecided case keeps the nearer one because every such use was valid before and meant the module’s variant; making it an ambiguity error would break val f = None and f == None in existing mirror modules, and would make the module’s own name second-class in its own module. Alternatives: an ambiguity error naming ImageFormat.None and Option.None wherever nothing decides (no silent pick, but breaks valid programs and asks for a qualified form on the module’s own type); leaving shadowing as it was and requiring Option.None (the status quo the bug report was about); refusing a variant named like a core library variant (would rename C enumerators).

  • Settled on the user’s delegation 2026-11-05: The language server’s workspace/symbol and textDocument/foldingRange (branch lsp-symbols-folding). Workspace symbols are read off each file’s parse, for every program an open document belongs to, its unopened files included and its dependencies’ left out; a name matches a query holding its characters in order (a subsequence), ASCII letters in either case; at most 500 symbols are listed, in file order, for any query. A symbol’s location is its name, its container its module, or its type for a method, a variant or a machine’s state; an actor is listed once, as its class, and compiler-written members (names with a $) are not listed. Folding is by whole lines, from the lexer’s blocks (the line before an indent to the last line of code before the matching dedent), multi-line tokens, comment runs, the import run and, in a literate file, runs of program text; two regions of the same lines are listed once, the block’s kind winning. WHY: the parse is there while the program has mistakes, as the outline’s is; a subsequence is what editors’ symbol search does; 500 is more than a person reads and small enough to answer per keystroke; the lexer’s indent and dedent tokens already know comments, text blocks and bracketed continuations, which a reading of indentation alone would not. ALTERNATIVES: symbols from the checker’s index (absent while the program has a syntax error, and it holds no declarations of its own); prefix or fuzzy-scored matching ranked by score (fine to add later; the protocol leaves ranking to the client); Unicode case folding (needs a case table the compiler does not have); no cap, or a cap only for the empty query; folding by indentation alone. Review with the user: whether ranking by match quality is wanted, and whether a machine’s compiler-written state()/handle() should be listed (they are, at the machine’s name).

  • Settled on the user’s delegation 2026-11-05: An arm no value can reach is an error (branch unreachable-arms). An arm of a match, a match function, an actor’s receive or a machine state, and a clause of a function, is an error when the arms before it without a guard already match every value it would: after _, after a binding, after a pattern covering the whole type, or covered by several earlier arms together. The message names the earlier arm that alone covers it, by pattern and line, “this arm is never reached: the arm _ on line 3 already matches every value it would”, or says the arms before it do together. Where the covering arm binds a name spelled as a type or a variant is (an upper-case first letter), it adds “Live binds a new value there, since no variant Live is in scope”. A guard never hides the arms after it; a clause hides the ones after it only when one of its bodies has no guard; a clause body after a body with no guard is an error too. Reachability is decided on the coverage matrix, so it knows what coverage knows (variants, true/false, literals, ranges, comparisons, n + k, strings by equality, sequences by length, nesting); an extractor or a type test is taken to match every value in the arm judged and none in the arms above it, so an arm is called unreachable only when it is, whatever the extractors answer. A machine state’s own arms are judged against each other; the shared receive arms, which a state may override by handling an event itself, are judged against each other once. A match whose patterns already failed to check is not judged. WHY: an arm Live -> … meant as a variant that was not in scope bound a new name, matched every phase, and hid the arms after it: the actor runtime hung and spun at 900% CPU with nothing reported. A dead arm is always a mistake, either in the arm or in an arm above it, and it is found by a check the compiler already makes. ALTERNATIVES: a warning (Avin has no warnings channel; every diagnostic is an error, and a warning shown only sometimes is the one that is missed); an error only after an irrefutable arm (catches the bug that prompted this, but not Some(_) before Some(0), which is as dead); leaving it as it was. Review with the user: whether two identical extractor arms (Even() -> … twice) should count as unreachable, since an extractor is a function that could answer differently each time.

  • Settled on the user’s delegation 2026-11-05: C arrays as pointers and blocking calls, as built (branch c-bindings-arrays, stage 13 step 6, chapter). The chapter left these open:

    • An Array[int] or Array[long] goes only to a pointer to a signed integer of its size; an Array[byte] to any one-byte integer; an Array[real] to any eight-byte floating-point type, typedefs included, all checked by the C unit (__builtin_classify_type, sizeof and (T)-1 < (T)0). Why: “the element types must be the same size and kind, and nothing is converted” — an unsigned element read as an int would turn its upper half negative, which Avin has no unsigned type to hold, while a byte is an octet of no sign. Alternatives: any integer of the size (silently reinterpreting unsigned elements); only the C types the chapter lists by name (which refuses FT_Fixed *, aa_octet * and every typedef). Review with the user: an unsigned element array (uint32_t * pixels) needs a binding per element or a buffer.
    • length(data) is written first, before the parameter’s type and before inout (length(buffer) inout FT_ULong *length), as out and inout are; a parameter may still be named length. It marks an integer of C’s keywords (not char, not an enumeration) or a typedef, which the C unit checks to be an integer. Alternative: after the type, which reads as part of it.
    • An Option of an array is accepted wherever an array is, not only beside an inout length: None passes null and a length of zero to any binding. Why: C that takes null for “no data” is common, and the rule is the chapter’s for inout. Alternative: only beside an inout length.
    • An array’s length crosses as an int converted to the length’s C type, so an array too long for an unsigned char length stops the program at the call, naming the length’s type and the array (“value out of range for u8 (unsigned char), the length of p“). A length C writes back through inout is read as an out value, then compared with the array’s length, the program stopping where it is greater; None bounds nothing, since it asks C the length it needs.
    • Every array position crosses as a pointer in place unless the call is blocking: the collector never moves an object and no collection runs while a call that is not blocking holds the thread, so nothing is copied; a blocking call is passed a copy off the heap (an empty array’s a byte long, so C is never passed null for it), copied back only where the pointer is not const, and freed once the thread is running again. Alternative: copying for every call, which costs the common case for nothing.
    • A blocking call keeps each handle it is passed alive across the wait by using its object after leave_safe, so the collector, running while the call waits, cannot give the C pointer back under C. Alternative: relying on the caller holding it, which a temporary argument does not.
    • Arrays of mirrors, strings, handles, bool and the narrower integers are refused with the four element types the chapter lists; arrays of mirrors arrive with struct mirrors (step 7).
  • Settled on the user’s delegation 2026-11-05 (built on branch sysl-generic-bindings): generic bindings are bounded by Boundary (Sysl bindings). A binding’s type parameters, a generic handle class’s, and a bound method’s own are each bounded by Boundary, a core trait the compiler decides from a type’s structure as it decides Sendable: the integers of 8, 16, 32 and 64 bits, byte, real, char, bool, unit, string, @sysl mirrors, and Options, Results and tuples of these, and a type parameter bounded by it. It is only a bound: not a type, and no impl, trait or derivation declares it. Each call’s type arguments are held to it as to any bound, a generic function passes its own type parameter on only where that one is bounded by it too, and every instantiation gets a shim of its own that Sysl checks, so a Sysl bound the instance does not meet is reported at the binding in Sysl’s words; an Avin bound beside it ([T: Boundary & Ord]) is Avin’s to check, with no mapping between Sysl’s traits and Avin’s. A generic handle class, @sysl("m.Signal") class Signal[T: Boundary], names the generic type without arguments, its type parameters invariant and the Sysl type’s in order; each instance the program uses is a handle of its own on the Sysl type’s instance, with its own finalizer, spelled by the shim from the instance’s types, so a mirror may be a type argument (the annotation-text instances keep their narrower rule). Rationale: the declaration can be checked once and every instantiation is then sound by the bound machinery that already exists, including through a library’s generic wrappers, with no instantiation-time diagnostics in lowering (which reports none); “one Sysl type” is what a handle’s instance needs and what keeps a type argument’s Sysl type the same in both directions. Alternatives weighed: unbounded type parameters checked per call at concrete types only (refuses every generic wrapper, or needs a closed-world pass in the checker that does not exist); an implicit bound, never written (hides why a wrapper’s T is refused); admitting collections (their Sysl type is a slice going in and a slice or a Buf coming out, so a T a Sysl function stores would not be one type) and handles (one goes into Sysl only by itself, so Option[T] at a handle could not cross in); a mapping from Sysl traits to Avin bounds (no table exists, and Sysl checks its own bounds anyway). Review with the user: the name Boundary, and whether handles should become type arguments of generic handles (Signal[View]), which needs the shim to pass a handle inside a generic Sysl value.

  • Settled on the user’s delegation 2026-11-05 (built on branch sysl-generic-bindings): a callback closure’s parameters are written out where Sysl cannot infer them. A Sysl closure taking the function’s own type parameter (applied[T, U](x: T, f: &Fn(T) -> U)) left the shim’s lambda (q0) -> … untyped, which Sysl refuses, for generic and non-generic bindings alike; the shim now writes each parameter as the Avin type’s Sysl spelling on that diagnostic, and is rebuilt for as long as each build names something more to write out (the lambda’s types first, the integer answer after), not once. Rationale: the same retry the shim already made for integer answers and parameters, extended. Alternatives weighed: always typing the lambda (wrong where Sysl hands a collection as a Buf rather than a slice, which only inference gets right); refusing such bindings.

  • Settled on the user’s delegation 2026-11-05 (branch actor-isolation): A send hands a message’s handles to the receiving actor, not into transit (actors). The settled ownership decision says a send puts a message’s handles in transit for their first user, the receiver, and that the sender’s later use traps. ActorRef.tell knows the actor the message goes to, so the handles the sender owns are handed straight to that actor’s owner as the message enters its mailbox. Why: in transit, a sender that uses a handle before the receiver does would take it back, and the trap the decision promises would depend on a race; handed to the actor, the sender’s next use always traps. A message dropped because the actor has ended hands nothing over, so its handles stay the sender’s. A reply to an ask completes a future, which already puts its handles in transit for the waiting code. Alternatives weighed: in transit as written (racy, as above); handing over when the receiver takes the message off its mailbox (too late: the sender could have used the handle meanwhile). Review with the user: it refines the wording of a decision the user settled.

  • Settled on the user’s delegation 2026-11-05 (branch actor-isolation): Handing a value over stops at what is shared between owners. The runtime’s walk follows every object a value reaches, so a message holding an actor’s reference walked into that actor’s state and handed its handles away (an actor that spawned a child capturing its own reference lost its connections to the child). The standard library marks the types shared between owners @keeps_owners — ActorRef, Timer, Future, Promise, Executor, Channel, Mutex, Condition, Once, Atomic, Thread, Scope — and their type records carry the mark, at which every walk (a send, spawn, a thread’s or a future’s body, completing a future) stops: their handles keep their owners, as a channel’s values already do. Behaviour is walked, since its start’s captures are what the new actor owns. The mark is the standard library’s alone. Alternatives weighed: a walk the compiler writes for each type (exact, but a collection’s nodes are untyped to it); a marker trait instead of an annotation (visible to every program, which could then hide its own handles from a send).

  • Settled on the user’s delegation 2026-11-05 (branch actor-isolation): Which messages a send walks. A send walks its message where its type may hold a handle: a handle; a tuple, data type or class with a field that may; a generic type of the standard library, its collections and Isolated among them, at a type argument that may, or that keeps a function (Behaviour); a function value; and Any, a trait, or an open or abstract class, which may hold anything. A @keeps_owners type and the scalars and strings never are. Decided per type where the program is compiled (the actors’ intrinsic holds_handles), so a message of numbers, strings, actors’ references or Vector[int] costs no walk. Alternatives weighed: walking every message (pays for every send); a standard library generic type judged by its fields too (a Vector[int]‘s nodes hold Any, so every vector would be walked).

  • Settled on the user’s delegation 2026-11-05 (branch actor-isolation): @isolating, the mark of isolate‘s body and with‘s function (what is shared). The rule of isolate‘s body is @isolated‘s (only sendable values from around it) and the whole-program check that nothing it runs reaches module-level mutable state; @isolated deliberately leaves out the second half for a mutex’s body. A third mark between @isolated and @sendable carries both, and a program’s own function that isolates what its caller passes writes it too: a parameter so marked is passed on for @isolating or @isolated, and a @sendable one for @isolating, but not the other way. It allows capturing a var of the code around it, since the body runs at once. Alternatives weighed: holding every @isolated argument to the module-level check (a mutex’s body was thought to have no need of it, which the mutex-isolating entry below corrects); an annotation only the standard library may write (a program could then not wrap isolate). Review with the user: it adds a third annotation users can write, beside @sendable and @isolated (a mutex’s value and body take it too, below).

  • Settled on the user’s delegation 2026-11-05 (branch actor-isolation): with holds an Isolated‘s objects while its function runs. Two withs of one Isolated on two threads would change one graph at once, and a take from inside f would hand the objects out while f still works on them. So with moves the Isolated from held to in use by one atomic compare-and-set and back when f returns; a take or with meanwhile traps with `Isolated` is in use by `with`, and a with after a take traps as a second take does (`Isolated` was already taken). A trap inside f leaves it in use. Alternatives weighed: a lock that makes a second with wait (an actor holding it would stall a worker, and a with from inside f would deadlock); no check (a data race).

  • Settled on the user’s delegation 2026-11-05 (branch actor-isolation): Where Isolated lives. Isolated, isolate are in avin.actors (the chapter that defines them), imported as import avin.actors.{Isolated, isolate}; a thread passes one through a channel the same way. Isolated(objects) may be called directly, its parameter marked @isolating, as Mutex(value)‘s is. Alternatives weighed: the core module (imported everywhere, though only concurrent code wants it); avin.threads (the actors chapter names it).

  • Settled on the user’s delegation 2026-11-05 (branch mutex-isolating; found on actor-isolation): a mutex’s value and its with body are @isolating (synchronization). Under @isolated, m.with(b -> cache = b) on the main thread stored the buffer in a module-level var, so the main thread could change it later without the lock while a worker changed it under the lock; Mutex(make()), where make keeps the buffer it returns in a module-level var, did the same at construction. Both parameters now take the whole-program check that nothing they run reaches module-level mutable state. The cost: a body may not read a module-level var (or a module-level value of a type that is not sendable) even where it stores nothing; it reads a local copied before the with instead. Module-level vals of sendable types, another mutex among them, stay readable, so nested withs on two module-level mutexes are legal. Alternatives weighed: a narrower rule refusing only a flow of the guarded value into module state while still allowing reads of module vars (an escape analysis through every call, field, collection and closure; the store can go through a module val of a mutable collection or an object’s method, so the rule is the same whole-program reach with flow tracking on top, harder to make sound and to explain in one diagnostic); leaving the constructor @isolated (keeps the same hole open through the value’s maker). Review with the user: a with body that only reads a module-level var counter is now refused.

  • Settled on the user’s delegation 2026-11-05 (built on branch c-bindings-callbacks, stage 13 step 9, chapter): C callbacks, as built. The chapter left these open:

    • A function pointer finds its userdata by name: the function pointer’s own prototype marks exactly one parameter userdata, and the binding marks one of the same name, which carries it (void (*listener)(userdata void *data, …) beside userdata void *data); each of the binding’s carries exactly one function, and a parameter taking a function is named. Why: MLT and Cairo already use one name for both, and a name says unambiguously which void * goes with which function when a binding takes two. Alternatives: by position (the n-th userdata carries the n-th function; silent when C’s order differs), or one function per binding (MLT and Cairo need no more, but GLib-style APIs pass a destroy beside the callback).
    • One trampoline per binding parameter, not per C function type. Why: two bindings of one C type may cross it as different Avin types (int and long, a mirror and an integer), so the conversions differ; the trampoline is a few instructions and the function it runs is the conversion. Alternative: one per C type with the conversions chosen at run time.
    • A callback answers a scalar, a truth value or an enum mirror, and unit exactly where C’s function answers void; a string, a handle or a status as its answer is refused. Why: a string or a handle answered to C would have to outlive the call with nothing to free it. Alternative: answer a string copied into memory C must free, which no C API this stage binds expects.
    • What C calls a function with crosses as a binding’s result does, a string copied and checked (or an Array[byte], or None for null), a handle lent through its class’s retain — a handle class without retain is refused there — and a value no Avin type holds stops the program where the binding C is running was called, as the answer’s does, naming the function.
    • forget: is a C function’s name, called name(self, userdata), or a C expression in self and userdata, run in the handle’s glue for each callback it keeps, after its pointer is taken and before release; a handle that keeps a handle never takes the other’s callbacks.
    • A kept function’s record roots it until the handle keeping it is given back. Why: the record must outlive any call C makes, even one racing the collector on a thread of C’s own. Consequence: a kept function that captures its own holder keeps both alive until close(). Alternative: trace the function from the handle, which frees such a cycle but lets a C thread call a function the collector has just freed. Review with the user: whether that cycle is worth a weak record.
    • In a program that passes C a function, every call of a C library function may run the collector, and is planned as one that does: any C call may call back a function C keeps. The C unit’s glue never does. Alternative: a calls-back word on the bindings that may, which is cheaper and trusted.
    • libc’s qsort and bsearch take no userdata, so they cannot be bound; the corpus binds a C function of its own that calls qsort_r and bsearch through one.
  • Settled on the user’s delegation 2026-11-05: on branch c-bindings-structs (roadmap stage 13 step 7), C struct mirrors, opaque values and arrays C answers.

    • A mirror’s layout is measured, and checked against the header’s order. The C unit measures each field’s offset, width and sign and the struct’s size, and asserts the fields come in the header’s order, each where C’s alignment puts it after the one before, none after the last; lowering reads and writes each field at its measured offset and width, with the traps of an argument and a result. Why: a field narrower or wider than its Avin type (uint8_t as int, float as real, unsigned long as long) crosses as a scalar parameter does, and the layout is the target’s. Alternatives: a layout implied by the Avin types alone and asserted (cannot spell a float or a short field); matching fields by name in any order (hides a reordered header).
    • Every field is named, which a positional initializer checks. The unit initializes the struct by position with one zero per mirrored field under -Wmissing-field-initializers made an error, so a field hidden in the padding between two others is found. For that the unit no longer passes -w; it ignores every warning with #pragma clang diagnostic ignored "-Weverything" instead. Alternative: the layout checks alone, which miss a small field in padding.
    • A mirror has one variant named as the type, as a Sysl struct mirror does, and its fields are integer types, byte, bool, real, string, Option[string] (null as None), enum mirrors and other struct mirrors. Why: FreeType’s and Cairo’s structs carry nullable names. Alternative: string only, a stop on null.
    • Strings in a mirror passed in are copies freed after the call; strings C writes into a mirror are copied out and left to C, as a borrowed string result is. Alternative: a free: per field, which no surveyed struct needs.
    • Every out value stays in the result, the array’s length too, where array: names the array. Why: one rule for out values. Alternative: dropping the out value length: names.
    • An array C answers that is null is None for an Option, an empty array where its length is zero, and a stop otherwise; a negative length, or one past an int, stops the program; the array is freed by free: (a function or an expression in the array’s name, optional for memory C keeps) after it is copied, and unread where a status fails. Review with the user: whether free: should be required with array:.
    • Opaque values cross by value only: a parameter, a result and a method’s self, never through a pointer, inout or in an Option; each object is its own, compared by identity, and sendable, since it is an immutable copy. Alternative: also out and const T *, which no surveyed binding needs.
  • Settled by the user 2026-11-06: concurrency that waits is written as straight-line blocking code, run on lightweight threads; Avin has no async or await keywords. A lightweight thread is a runtime-scheduled thread with a stack of its own; a few operating system threads, about one per core, run whichever are ready. A call that would wait (a socket read, Future.await, a channel, sleep, a lock) parks only its lightweight thread: the runtime records what it waits on (a socket through the runtime’s poller over kqueue or epoll, a future, a timer), and runs another on the same operating system thread. spawn, the futures’ pool and actors’ turns come to run on lightweight threads, so the APIs that exist today keep their meaning and become cheap; a server holds one lightweight thread or one actor per connection, and a connection that waits holds no operating system thread. Concurrency stays explicit: Future(body) to start work and await() on it, Future.all and Future.first, channels and scope. Why: no division of functions into those that may wait and those that may not, so one library serves every caller and any function at any depth may wait; an ordinary call allocates nothing; existing code needs no change. Alternatives: stackless async functions compiled to state machines (smaller per waiting task, in the hundreds of bytes, but every function on the path to a wait marked async, libraries split in two, and an actor’s state open to change at each await); async/await as sugar over lightweight threads (async def a Future, await e e.await()), declined as a second spelling of what Future already says. Consequences: a stack per lightweight thread, reserved large and committed as touched (at least a page, 16 KB on arm64, per lightweight thread), with moving parked frames to the heap a later reduction; the collector scans parked stacks; a C call that blocks holds its operating system thread, as blocking already accounts for.

  • Settled on the user’s delegation 2026-11-06: lightweight threads are time-sliced at safepoints. A lightweight thread that has run for its slice, 10 ms to begin with and tunable, yields at its next safepoint poll and goes to the back of the ready queue, so threads that never wait share a core instead of starving the others. A timer in the runtime raises the yield request on the carrier running it; compiled code already polls a flag on every back edge of its control flow and before every call that may recur, for the collector, and the same poll answers it, so a thread that does not overrun pays nothing more. A wait still switches at once, and an actor’s turn still ends after 16 messages. A long C call cannot be interrupted; blocking lets another carrier run in its place. Built with the scheduler core. Why: fairness for computation-heavy threads at no cost to the rest, from a poll that exists already, with every interruption at a point where the roots are exact. Alternatives: switching only at waits (a long computation holds its carrier until it ends); interrupting at any instruction by a signal (needs exact roots at every instruction, which the shadow stacks give only at safepoints).

  • Settled on the user’s delegation 2026-11-06: The allocation chunk belongs to the carrier, a runtime record per operating system thread, and a context reaches it through a pointer (branch lwt-carrier-chunk). Context.carrier points at the Carrier the context runs on, which holds the gc.Chunk; allocation reads ctx.carrier.chunk, one load more than before, and compiled code never touches the chunk, so lowering is unchanged. Attaching a thread makes its carrier (a record that keeps itself alive) and links it into a list of carriers beside the list of contexts, both under the heap lock; detaching retires the chunk, unlinks the carrier and frees it, and detaching twice changes nothing. A collection retires the chunk of every carrier rather than of every context. A context’s carrier is stored only while the context is safe, by one store, so a later scheduler moves a lightweight thread between carriers without moving a chunk. Why: thousands of parked lightweight threads must hold no chunk each, and the chunk is a property of the thread that is running, not of the code it runs. Alternatives: the chunk kept in the context and handed over at each switch (a copy of the chunk’s six words per switch, and every parked context still sized for one); a thread-local carrier found through the platform’s thread-local storage (no pointer in the context, but a thread-local access on every allocation, dearer than one load); the carrier embedded in the thread’s own storage beside its context (no separate record, but a carrier would then die with the context it was made beside, which is wrong once contexts outnumber carriers).

  • Settled on the user’s delegation 2026-11-06 (branch lwt-scheduler): the scheduler is one ready queue under one lock, run by workers started one at a time as threads become ready, up to one per processor. A thread made ready goes to the back of the queue; an idle worker sleeps on a condition and is woken for it, and where none is idle and fewer workers than processors are counted, another is started. A worker is an operating system thread with a carrier of its own that runs no compiled code itself: it switches to a lightweight thread and back, and after the switch back does what the thread asked (let a guard go, re-queue it, give its stack back). Why: the simplest correct queue, with every wake in the order threads became ready, and the lock is held for a few instructions. Alternatives: a queue per worker with stealing (less contention on many cores; more code, and no ordering between workers), left for when a measurement asks for it; starting every worker at once (simpler counting, but a program with one thread would start one per processor).

  • Settled on the user’s delegation 2026-11-06 (branch lwt-scheduler): a lightweight thread’s stack keeps spawn‘s 8 MiB default, reserved through sysl.fiber and committed as touched, with 64 KiB at the least; the stacks of ended threads are kept, 64 at most, for threads asking about the same size. Why: the default costs address space only, so every program that recursed deeply in a thread before still does, and a reused stack saves a mapping and its guard per short thread. Alternatives: a smaller default such as 1 MiB (less address space at a hundred thousand threads, but deep recursion that fitted in a thread would overflow); no reuse (a map and an unmap per thread). Review with the user: the default is the knob most likely to want a different value once servers hold many thousands of threads.

  • Settled on the user’s delegation 2026-11-19 (branch lwt-stacks): a lightweight thread’s stack stays one fixed reservation, 8 MiB unless spawn‘s stack asks otherwise and 64 KiB at the least, and the runtime gives its pages back: the monitor trims a thread it has seen parked at two ticks with no run between, down to 16 KiB below where it parked, and a stack kept for reuse is trimmed to its top 16 KiB as its thread ends. This settles the Open item on stack size and growth. A worker marks a parked thread settled after it has switched away and lists it; the monitor raises the thread’s trimming mark and only then looks for it parked and settled, while a worker about to run it marks it running and unsettled and only then waits for trimming to fall, so a trim never overlaps the thread’s next run. The release is madvise(MADV_DONTNEED) on Linux; on macOS that advice leaves the pages resident, so the range is mapped afresh in place (MAP_FIXED), which frees them at once (runtime/avin/rt/__posix__/stack_release.c). A release the system refuses leaves the range as it was, mapped and committed (a failed madvise changes nothing, and a fixed mapping the kernel cannot make puts the old one back), so the runtime only counts it (stack_releases_refused) and the thread goes on untrimmed; nothing traps. The overflow trap is untouched: the guard and the report’s low end are the stack’s own, and a trimmed stack still overflows at its end with stack overflow. Measured (macOS, arm64, 16 KiB pages, -O2, resident bytes per parked thread after its recursion returned): depth 0, 17 KB before and after; depth 1,000, 66 KB before, 34 KB after; depth 10,000, 493 KB before, 34 KB after (1,000 threads: 470 MiB before, 32 MiB after). 100,000 shallow parked threads hold 1.6 GiB either way, a page and a record each. Deepest recursion, main thread and spawned thread alike, unchanged: about 40,000 calls at -O0 and 50,000 at -O2 of a one-argument function. A two-thread rendezvous ping-pong (two parks a round trip) and a start-and-join churn showed no slowdown beyond the machine’s noise (round trip 1.0–2.1 µs after against 1.8–2.9 µs before, interleaved runs). A madvise of an 8 MiB stack costs about 20 µs on macOS whether or not its pages are resident, and the fresh mapping about 0.3 µs, which is why the release is the mapping there and why it is done by the monitor after a tick rather than at every park. Alternatives: trimming at every park (a system call a park, a third or more of a rendezvous round trip); stamping each park with the clock (a clock read a park, where a run count is two stores); copying or segmented stacks that grow (refused: C frames and the native frames the collector’s shadow stack points into cannot move, and a segment boundary in a C call has nowhere to go); a soft guard page below where a thread parked, unprotected by the fault handler when the thread goes deeper (refused: a system call writing into that page first gets EFAULT instead of a fault); moving parked frames to the heap (the same objection as copying). Review with the user: the 8 MiB default and the 16 KiB kept below a parked thread, and the name stack of spawn‘s size parameter, which the trimming makes less pressing to change but which a server author may still want to set lower to bound address space.

  • Settled on the user’s delegation 2026-11-06 (branch lwt-scheduler): main stays on the program’s first operating system thread and is not a worker; its waits block that thread. Every wait has two forms: a lightweight thread parks, and any other thread (the main thread, a thread attached for a callback) sleeps on one shared condition until its own waiter is woken. Why: the main thread stays free for the ui package, which must run on it, and a program whose main never waits keeps its whole processor count of workers. Alternatives: main as a lightweight thread run by a worker, with the first operating system thread one of the workers (one kind of wait, but the ui package would then need a way to pin a thread to it, which is the open main-thread question).

  • Settled on the user’s delegation 2026-11-06 (branch lwt-scheduler): time-slicing answers at the existing poll by a second bit of its flag. requested holds Stop (1), raised by a collection, and Yield (2), raised by the monitor, a runtime thread that ticks every millisecond while a worker is busy, when a worker’s thread has run 10 ms while another is ready; it also sets that worker’s own yield_wanted. A poll still loads the word and branches on zero; avin_rt_safepoint waits out a Stop and then, on a worker whose flag is set, yields to the back of the queue, and lowers Yield once no worker wants it. Any lightweight thread yields at any poll, inside a lock or a callback too. Why: compiled code is unchanged and pays nothing while nothing overruns; while one does, the others’ polls take the slow call for at most a tick. Alternatives: a flag per carrier read through the context (no spurious slow calls, but two loads per poll and a compiler change); not yielding inside a lock (the lock’s waiters park anyway, so it buys nothing and lets one thread hold a worker).

  • Settled on the user’s delegation 2026-11-06 (branch lwt-scheduler): a blocking call is noticed, not announced: enter_safe marks the carrier blocked and counts the call, and the monitor releases a worker that has stayed blocked across a whole tick while threads are ready. A released worker is not counted against the target, and another is woken from the spares or started; when the call returns the thread runs on, and its worker rejoins the count at its next switch, or rests as a spare where the count is full. This generalizes the pools’ blocking compensation to every blocking binding, sleep and a wait for a lazy val. Why: a call that returns within a tick costs two stores and starts nothing, and the generated shims and every binding stay as they are. Alternatives: compensating at every blocking call (a thread start or wake per call, however short); a pool of threads for blocking calls only (every such call a hand-off between threads).

  • Settled on the user’s delegation 2026-11-06 (branch lwt-scheduler): every lock and condition parks: Mutex, Condition and Once as well as channels, futures, promises and joins. The runtime’s one lock and one condition, which all of them are built on, keep a queue of waiters; a lock let go goes straight to its oldest waiter. The brief planned Mutex and Condition for the next step, keeping them blocking until then. Why: channels, futures’ cells and the pools are built on the very lock and condition Mutex uses, so keeping Mutex blocking meant a second, temporary implementation of both; and a Mutex whose holder parks can then never hold every worker. Alternatives: a parking lock and condition beside the blocking ones, used by channels and futures only, until the next step (two implementations, one to remove). Review with the user: it moves part of the next step into this one.

  • Settled on the user’s delegation 2026-11-06 (branch lwt-scheduler): a context waits as the one waiter it holds, since a thread waits on one thing at a time; a timed wait of a lightweight thread is a timer the monitor fires, added by the worker after the thread has switched away and taken off by the thread when it runs again. Why: no waiter is ever made per wait, and no waiter is reachable once its wait has answered. Alternatives: a waiter in the waiting function’s frame (the same, but its address is a local’s, which Sysl’s escape check refuses to queue); a heap waiter per wait (an allocation per wait).

  • Settled on the user’s delegation 2026-11-06 (branch c-bindings-buffers): views and blocks are one object layout, the runtime’s CMemory, with their operations as intrinsics of avin.c. ByteView, MutByteView (a subclass) and ByteBlock (a subclass of MutByteView) are library classes the compiler lays out as the address, owner, length, closed flag, the two reasons they trap with and the lender; each operation is a call of the runtime that checks the code running, the closed flag and the bounds, and stops the program at the caller. Why: a class holding an address in an Avin field could be made by its public constructor with any address, since Avin has no private constructors; a layout only the compiler and the runtime fill keeps every address one C lent or Avin allocated. Alternatives: a Sysl handle per view (the view could not keep its lender, an Avin object, alive); inline MIR for every operation (more compiler, and a closed view’s reason is a string the runtime reports anyway).

  • Settled on the user’s delegation 2026-11-06 (branch c-bindings-buffers): a view’s lengths and indices are ints, and a C length past the greatest int, or negative, stops the program at the call. Why: arrays’ are ints, so a copy, a slice and an index mix with them without conversions; 2 GiB is more than a frame or a glyph. Alternatives: long lengths (every index written long(i)); long lengths with int indices (a view longer than any index reaches). Review with the user: a library lending more than 2 GiB at once would need long.

  • Settled on the user’s delegation 2026-11-06 (branch c-bindings-buffers): null lends None in an Option whatever the length, and otherwise an empty view where the length is zero and a stop where it is not, as arrays C answers are. Why: FreeType’s empty glyph is null with no rows, and a frame with no image may answer null with a size of zero. Alternative: null always a stop outside an Option.

  • Settled on the user’s delegation 2026-11-06 (branch c-bindings-buffers): a view belongs to the code owning its lender, and is lent only by a method of a handle that is not shared. A view checks its lender’s owner at each use, so handing the lender over (a thread’s body capturing the view or its frame) takes the view with it and any other thread traps. Why: closing a view is a write the lender’s next use makes, and reading memory the lender’s next call may free; both must happen on one owner at a time, which a shared handle does not have. Alternatives: an owner of the view’s own (a view handed over without its lender would race the lender’s next use); shared views closed under a lock (a lock per byte read).

  • Settled on the user’s delegation 2026-11-06 (branch c-bindings-buffers): a failed status lends nothing and copies nothing, but is a use of its receiver, which closes the view lent before it. Why: the call ran, and may have freed the memory. Alternative: closing only on success (a stale view after a failed conversion).

  • Settled on the user’s delegation 2026-11-06 (branch c-bindings-buffers): the record attach: gives C belongs to one handle object: later keeps through the same handle add to it, the handle lets go of it when its reference goes back, and C holds it until destroy; on an attach: class every kept object, handles too, is held as its Avin object, so a kept handle’s own C reference lives as long as the record. key: may be left out (a char of the class’s own keys the record), and attach: with shared is refused. Why: the record’s slot is reused only once neither the handle nor C holds it, so a handle never updates another’s record; holding kept handles as objects keeps their references alive past the holder’s close(). Alternatives: one record per C object, found through the library’s own getter (no getter is named, and attach: would need a second expression); C references for kept handles (given back with the holder’s handle, while C still uses them). Review with the user: two Avin handles on one C object each attach under the same key, so the second replaces the first’s record, and C’s destroy of the first lets go of what the first kept while the first handle still keeps it.

  • Settled on the user’s delegation 2026-11-06 (branch c-bindings-buffers): a ByteBlock‘s own constructor makes a block of no bytes, passed to C as null, and ByteBlock(length) is the companion’s apply. Why: a class has a constructor, and the empty block is harmless where every index is out of range. Alternative: an abstract class with a factory (a block could not be named as the type ByteBlock(n) makes).

  • Settled on the user’s delegation 2026-11-06 (branch c-bindings-buffers): bytes: is array: for an Array[byte], with free: where C allocated the bytes. Why: the spec’s copy was the one-element case of the generalized array:; one path copies both. Alternative: bytes: with no free: (a leak per call for a library that allocates).

  • Settled on the user’s delegation 2026-11-06 (branch lock-turn-leak): a join answers only once the ended thread keeps nothing alive (threads). An ending lightweight thread detaches its context (its frames, which hold its closure and its joint, stop being roots) and then marks its joint done and wakes its joiners, both under the heap lock, so no collection runs between the two and the joint outlives its last use even when nothing else reaches it. Why: before, the joint was marked done first, so a collection right after a join could still find the closure and the joint through the ended thread’s frame; a program saw its memory freed one collection late, and a runtime test asserting an empty heap after a join failed under load. Alternatives: keep the old order and promise only that an ended thread’s objects are collected eventually (weaker, and visible to any program measuring its heap); or clear the frame’s slots before marking the joint done (the joint, then reachable from nothing for a thread nobody joins, could be collected while the ending thread still writes to it).

  • Settled on the user’s delegation 2026-11-06 (branch lwt-timers): sleep parks a lightweight thread on a timer, and the monitor thread fires the timers. sleep in a lightweight thread parks it with no guard and a timer at its deadline, as a timed wait parks, so its worker runs other threads; main and other threads that are not lightweight block, safe for the collector. The monitor, which already wakes once a tick while any worker is busy and sleeps until the soonest timer while none is, fires the timers that are due. Why: the monitor exists, already fires timed waits and already sleeps until the soonest one, so sleeps need no thread of their own and no new wake-up path; a sleep is never more than a tick late while workers are busy. Alternatives weighed: the poller’s timeout (the poller of sockets, step 4, is not built yet; once it is, its wait could take the soonest timer as its timeout and the monitor could hand timers over, which this choice does not preclude); a timer thread of its own (one more operating system thread doing what the monitor does); keeping sleep a blocking call that the monitor compensates for (a worker per sleeper, which is what the lightweight threads are for). Review with the user only if sleep precision under 1 ms matters.

  • Settled on the user’s delegation 2026-11-06 (branch lwt-timers): the timers are a binary heap of waiters keyed by deadline, ties broken by the order they were set, each waiter keeping its place in the heap. Adding, firing and cancelling a timer each cost O(log n) under the timer lock, and reading the soonest is O(1); threads whose time runs out together are made ready soonest first, and two due at the same microsecond in the order they began waiting. A timed wait that its event ends first takes its own timer off when it runs again (its place makes that one step, not a search); the timer and the event race on the waiter’s state, and only the one that changes it from pending makes the thread ready, so a wait answers exactly once and leaves no timer behind. Why: the linear list cost a scan per cancel and per tick, which ten thousand sleepers turn into a hundred million steps a second; a heap of the waiters themselves needs no allocation per timer beyond the heap’s array. Alternatives weighed: a hierarchical timing wheel (O(1) add and cancel, but a tick-quantized deadline and more machinery than a heap that is already fast at this scale); a sorted list (O(n) insertion); a heap without places (cancel would search, O(n)).

  • Settled on the user’s delegation 2026-11-06 (branch unix-sockets): Unix domain sockets in avin.net: UnixStream and UnixListener mirror TcpStream and TcpListener, sharing the read-ahead code (read, readLine, readAll) through one private class both hold; UnixListener.bind(path) fails with AlreadyExists where anything is at the path, and the separate bindReplacing(path) removes a socket file nobody listens on (a probing connection is refused) before binding, leaving a live listener’s path and any non-socket file alone; close() leaves the socket file; a path the platform cannot carry (103 bytes on macOS, 107 on Linux) is an Err with the platform’s message, and a connect to a path with nothing at it is NotFound. Waits are the TCP ones: blocking bindings that park the lightweight thread’s carrier as TCP’s do, with no poller integration. WHY: a daemon and its command-line client need a local socket with the API they already know from TCP; silently deleting an existing path could remove another program’s live socket or an unrelated file, so the safe bind refuses and the replacing form is explicit. Alternatives weighed: bind always removing a stale file (a surprise on a path that is a live socket or not a socket at all); close() removing the file (wrong for a listener handed between threads, and a second program may already have replaced it); one shared Stream trait over TCP and Unix (no use yet, and the language’s traits would add a dispatch to every read). Review with the user: bindReplacing‘s probe connection is seen by a live listener as an immediately closed connection.

Open files in avin.fs (branch fs-file, for the job manager’s log following and event log; the system library chapter has the surface). Each choice below the spec did not settle, each settled on the user’s delegation 2026-11-06. Review with the user: the first two (a File kept to one thread, and no seek from the end).

  • Settled on the user’s delegation 2026-11-06: the type is File, opened by fs.open, create, append, openUpdate and createUpdate. WHY: the five modes cover every combination a program asks for, named for what happens to what is already there, as Sysl names them, and the whole-file functions keep their names. ALTERNATIVES: an OpenMode argument (one function, but a mode a program can get wrong at runtime and a longer call for the common case); only read, create and append (no way to overwrite part of a file).

  • Settled on the user’s delegation 2026-11-06: a File is not Sendable. WHY: its Sysl handle belongs to the thread that opened it, and a program that wants another thread to use a file opens it there; TcpStream‘s hand-over machinery buys nothing for a file a program can reopen. ALTERNATIVES: make it Sendable with the owner check a TcpStream has. Review with the user if a file must move between actors.

  • Settled on the user’s delegation 2026-11-06: seeking is from the start only, plus seekToEnd(); a negative offset is an Err, a seek past the end is allowed. WHY: following a log needs “start at the end”, and a tail needs absolute offsets, which size() gives; offsets back from the end are size() - n, with no second vocabulary. ALTERNATIVES: a Whence argument; a signed offset meaning from the end.

  • Settled on the user’s delegation 2026-11-06: readLine answers an unterminated last line; readCompleteLine does not, and leaves the partial line unread. WHY: a file followed while another program writes it shows half a line at some moment, and a follower must not act on it; a file read to its end wants the last line even with no \n. ALTERNATIVES: one readLine with the first meaning (torn lines when following), or the second (the last line of a file with no final newline lost).

  • Settled on the user’s delegation 2026-11-06: read(max) and the line calls share one buffer of the File‘s own, and position() is the logical position (the file’s, minus what is buffered and unread). WHY: lines need a buffer, and read, seek and write have to agree with it. A write or seek gives the buffered bytes back first. ALTERNATIVES: separate byte and line modes (a program mixing them gets surprises).

  • Settled on the user’s delegation 2026-11-06: a read at the end is not sticky. WHY: following a growing file is the point; the next read asks the file again. ALTERNATIVES: a latched end that seek clears (Sysl’s own flag is not used).

  • Settled on the user’s delegation 2026-11-06: misuse is an Err, not a trap: a call on a closed file, a read of a write-only file, a write to a read-only one, a negative seek offset; a negative max or count or tail size traps like TcpStream.read‘s, being a program mistake at the call. WHY: the first group depends on the state the program’s files are in at runtime. The Err for those is Other with a plain sentence, as TcpStream‘s closed connection is. ALTERNATIVES: a dedicated IoError variant for a closed file (more to match on for a rare case).

  • Settled on the user’s delegation 2026-11-06: readTail(file, maxBytes) answers text, begins at a whole character, and replaces invalid bytes with U+FFFD; readTailLines(file, count) answers lines. WHY: the caller wants to print or search the end of a log, where a cut character is garbage and an invalid byte elsewhere should not refuse the whole tail. A start inside a UTF-8 sequence skips the rest of that sequence (continuation bytes), never reading earlier bytes to complete it, so exactly the bytes asked for or fewer come back. ALTERNATIVES: back up to include the whole character (more than maxBytes); answer bytes and leave decoding to the caller; InvalidUtf8 for a cut start.

  • Settled on the user’s delegation 2026-11-06: opening a directory for reading or updating is IsADirectory. WHY: the platform opens a directory for reading and fails only at the first read, which would show up as an unexplained failed read. ALTERNATIVES: leave it to the read.

  • Settled on the user’s delegation 2026-11-06: the calls do not park a lightweight thread. WHY: the whole-file avin.fs calls do not either, and a regular file’s read does not wait for a peer. ALTERNATIVES: bind them blocking (needed only for files on a stalled network mount).

  • (Superseded by the Proposed entry JSON is avin.json in the standard library.) Settled on the user’s delegation 2026-11-06 (branch json): JSON is the package json, in packages/json of this repository, module json, rather than avin.json in the standard library (JSON). Why: the system library chapter already says JSON is a package of its own; the package mechanism reads a path dependency and a git dependency on a directory of a repository (//packages/json), as the ui package is reached; and a domain library outside the standard library keeps the compiler’s library small. Alternatives weighed: avin.json in the standard library (contradicts the system library chapter, and every compiler release would carry it); a repository avin-lang/json of its own (premature while the derivation templates it is to carry are still being built in this one). Review with the user: whether JSON should after all ship with the compiler, since marshal and most services need it.

  • Settled on the user’s delegation 2026-11-06 (branch json): a JSON number is a Long when the text writes a whole number that fits a long, and a Real otherwise; a Real is always written with a fraction or an exponent. Why: identifiers, counts and sizes stay exact past 2^53; writing 1.0 rather than 1 makes parse(render(j)) == j for every finite value, kind included. -0 is the Long 0 (a whole number, and a long has no minus zero); -0.0 is the Real minus zero. A whole number beyond a long is a Real, rounded. The Real form follows the usual shortest-digits rule, written out from 1e-6 up to 1e21 and with an exponent outside. Alternatives weighed: one Num(real) (loses integers beyond 2^53); keeping a number’s text (Num(text), exact for any size but every reader parses again); a third Big(digits) variant for integers beyond a long (exact, at the cost of a case every match must handle). Review with the user: the variant names Long, Real, Str, Arr, Obj (chosen because Array is a built-in type’s name and String/Object read as types), and the companion’s obj/arr/str/num.

  • Settled on the user’s delegation 2026-11-06 (branch json): a number too large to be a finite real is an error, and a NaN or an infinity is written null. Why: a Real holding an infinity cannot be written back as JSON, so accepting 1e400 would break the round trip; writing null keeps render total, as most writers do. Alternatives weighed: reading 1e400 as an infinity; trapping when writing a non-finite value.

  • Settled on the user’s delegation 2026-11-06 (branch json): an object keeps every member, a key written twice included, and get and apply answer the last. Why: reading is lossless and the order is the document’s, which a log or a configuration file shown back to a person needs; the last-wins lookup is what most readers do. Lookup is a scan from the end, which is fast for the objects a protocol carries. Alternatives weighed: refusing a duplicate key (strict, but RFC 8259 allows it); the first one winning; members in a Map (fast lookup, loses order or needs an ordered map).

  • Settled on the user’s delegation 2026-11-06 (branch json): arrays and objects nest at most 512 deep unless parse is given another limit, a scalar being 0 deep. Why: the reader is recursive, and a hostile document of a million [ would otherwise end in a stack overflow trap; 512 is far beyond any real document and far inside a lightweight thread’s 8 MiB stack. Alternatives weighed: no limit; an iterative reader with no limit (more code, and the values built are still recursive to write); 1000 or 10000.

  • Settled on the user’s delegation 2026-11-06 (branch json): a lone surrogate escape is an error. Why: a string holds only characters, and U+D800 is not one. Alternatives weighed: replacing it with U+FFFD (silent loss); carrying it as WTF-8 (a string that is not UTF-8).

  • Settled on the user’s delegation 2026-11-06 (branch json): an error’s line ends at a line feed only and its column counts characters; it also carries the byte offset. Why: the line feed is the only line end JSON text ordinarily has, a \r\n counts the same, and counting characters matches what an editor shows. The place is counted out only when an error is made, so reading pays nothing for it. Alternatives weighed: a lone carriage return also ending a line; columns in bytes.

  • Settled on the user’s delegation 2026-11-06 (branch json): the accessors answer Options, apply traps, and asLong takes a Real that is a whole number within a long. Why: Options chain with ? in a function answering an Option (j.get("a")?.get("b")?.asInt()), and apply is for a member the program knows is there, as a map’s is; a producer writing 3.0 for a count is common. Alternatives weighed: a missing member answering Null (confuses absent with null); a cursor type with its own errors (a later layer, which the derivation’s JsonReader covers).

  • (JSON’s tests have since moved to library/tests; see the Proposed entry JSON is avin.json in the standard library. The rule stands for any later package with tests.) Settled on the user’s delegation 2026-11-06 (branch json): the corpus runs every package under packages/ that has a tests directory, with avin test at -O0 and -O2. Why: a package’s tests are what avin test runs in it, and the repository’s own packages must be gated like the core library is. A package whose behaviour needs a window (ui) has no such directory.

  • Settled on the user’s delegation 2026-11-06 (branch process-control): A Child‘s process ids are recorded, and read by any thread (commands). pid(), group(), signal and signalGroup read atomics the starting code writes as each program starts, never the command’s handles, which belong to one thread, so a job manager can signal a child another thread is waiting for. pid() is the program started last (a pipeline’s last stage, a sequence’s latest part, as a shell’s $! is), and signal reaches that one program; kill remains the call that reaches every program and stops a sequence. A command seen to have ended is refused with the platform’s “No such process” rather than signalled, since its id may have been given again; one that ended unseen is a zombie the signal reaches harmlessly. Alternatives: signal through the owner, which traps on a child another thread waits for (what the marshal survey met); a signal reaching every program, which needs every program’s id kept and the job’s handles’ state shared; pid() as an Option, rather than 0 for a command whose time ran out before it started a program.

  • Settled on the user’s delegation 2026-11-06 (branch process-control): One group per command, and signalGroup without one is an Err (commands). inNewGroup() puts every program of the command in one group its first program leads, the outermost setting deciding; a sequence’s later part whose group has emptied leads a new one (joining a gone group is refused by the platform), and group() follows it. signalGroup on a command with no group of its own is Err(Other("the command has no group of its own")), never a signal to the program’s own group, and it still signals after the command ended, since a group outlives its leader while anything it started is left: the case a job manager kills for. Alternatives: a trap for signalGroup without a group (a daemon would die of a missed setting); a group per part; refusing the later part. Review with the user: whether signalGroup should trap.

  • Settled on the user’s delegation 2026-11-06 (branch process-control): Standard error is redirected as output is (commands): errorsToFile, errorsAppendTo and errorsToOutput(), the last sharing the output’s open file (one offset, so neither stream truncates or overwrites the other), going into what output() and lines() capture, and, where the output is the program’s own, opening /dev/stdout to append. On a pipeline every stage’s errors go to the pipeline’s redirection. The redirections apply output first whatever the order they were called in. Alternatives: one bothToFile(file) (a second name for a pair of calls); Stdio-like values passed to one withStreams; 2>&1 read as the output at the point of the call.

  • Settled on the user’s delegation 2026-11-06 (branch process-control): Signals are watched in avin.signal, and a wait looks every 20 ms (avin.signal). The platform’s facility is a counted flag, so wait() parks its lightweight thread and looks again every 20 milliseconds, the latency bound; take() asks once. Constants are vals named for what they mean (Terminate, Interrupt, Hangup, User1…), the user ones numbered by the runtime for the platform; sending stays in avin.process beside the process ids it takes. Alternatives: the POSIX short names (TERM), against Avin’s naming; a data Signal (a closed set, while numbers are open, and ExitStatus.Signalled speaks int); a wake from the handler through the scheduler, which needs a runtime handler that is async-signal-safe, for a latency no program has needed yet.

  • Settled on the user’s delegation 2026-11-06 (branch nested-literal-typing): A number literal nested in an argument takes the numbers the other arguments decide (generics). An argument that is or holds an integer literal (a collection literal, a tuple, or a call other than a conversion such as long(1), with such a part) is checked after the arguments that hold none, against the type they decided so far, and an expression of literals alone (a literal, or an operation or if on such expressions) after both, so assertEq(count(Box(1)), 1_000_000_000_000 + 1) with a long result is a long whichever is written first. Where the decided type would otherwise be left open so a later argument may widen it, the argument is given its shape with the value types and every invariant type argument kept, and every class or other reference leaf at a covariant place left open. So assertEq(f(), [1, 2]) with f() -> Vector[long] is a Vector[long], while same(dogs, [Cat(2)]) still joins to a Vector[Animal]. Why: the chapter already says a literal takes the type the other arguments decide, and a literal one level down is the same literal to a reader. Two limits, chosen as the smallest rule: of two arguments that both hold literals, the first written decides for the second (same((1, x), (x, 2)) for x: long is an error, where a part-by-part solution would type it); and choosing an overload checked a nested literal once at its own type where the candidates’ parameters differ. Review with the user: whether the first limit is worth lifting.

    Proposed (branch fix-literal-expected, 2026-11-14): the second limit is lifted. Choosing an overload checks a value built around number literals by itself first, as before; where that leaves no candidate fitting (or it does not check by itself, as [5_000_000_000] does not), it is checked against each candidate’s parameter instead, with the type arguments the receiver, the lower bounds and the other arguments decide, as a bare literal is. So kind(Some(1)) beside kind(o: Option[long]) and kind(o: Option[string]) is the long one, and longs ++ [400], which met two overloads of ++ (Vector[W] and Iterable[W] with W >: long), is a Vector[long] (found writing marshal). Where the literal fits candidates at its own type, the choice is unchanged, so own([1]) beside Vector[int] and Vector[long] stays the int one. With it, a reference type that takes integers or decimals (BigInt, BigDecimal, a type implementing FromInteger) is kept in the expected type a literal argument gets, as a number is, so pair(cents, [3]) for pair[T](a: Vector[T], b: Vector[T]) builds Cents where it had built an int. Why: a literal one level down is the same literal to a reader, and an operator method on a collection is the commonest place it meets overloads. Alternatives: checking against each candidate first (would change which overload own([1]) picks, and is ambiguous where both take it); trying candidates by the literal’s structure only (more code, same result).

  • Settled on the user’s delegation 2026-11-06 (branch stdout-flush-isnan): standard output gets an explicit flush(); reading flushes it; real gets isNaN, isInfinite and isFinite. flush() is a prelude function and a method on StandardOutput and StandardError (a no-op beyond flushing output, as error keeps no buffer); a read of standard input that must wait flushes output first. The classifiers are methods on real in avin, written in Avin (self != self; comparison with the infinities; self - self == 0.0); real.NaN, real.PositiveInfinity and real.NegativeInfinity already existed, and real is the only floating type. WHY: a drawing program must push a frame without a newline, and a prompt must be seen before the wait; the methods read as char‘s do, where the avin.math functions are not methods. ALTERNATIVES: a Writer.flush on the trait (every writer would need a meaning); flushing only on print (defeats buffering); math.isNaN(x) functions (the spec keeps avin.math for elementary functions). Review with the user if a Writer-level flush is wanted.

  • Settled on the user’s delegation 2026-11-06 (branch exit-hooks): Exit hooks are process.onExit(@sendable body: () -> unit) -> ExitHook, with cancel() -> bool, run newest first and once each (exit hooks). Why: a library that changes the world outside the program (tui’s raw mode and alternate screen) must put it back on every ending, and the language has no finally or defer; a hook per change, cancelled when the change is undone normally, is the smallest shape, and newest first undoes changes in the reverse of the order they were made. Alternatives: one global handler to set (libraries would overwrite each other); a defer construct (scoped to a frame, so it cannot run on a trap or an exit from another thread); oldest first.

  • Settled on the user’s delegation 2026-11-06 (branch exit-hooks): The thread that ends the program runs the hooks: the main thread when main returns, the thread calling exit, the trapping thread after its report (an escalated actor failure and running out of memory included), a test’s process as a program. The other threads go on running meanwhile; one that traps or calls exit waits for the end silently, the first ending being the program’s. So the body is @sendable. Why: a trap on another thread cannot hand work to the main thread, which may be blocked or be the one that trapped, and stopping every other thread first would stop the threads a hook needs (a future’s pool) or leave them stopped holding locks. Alternatives: always on the main thread (impossible when it is the one waiting or trapping); stopping the other threads first; hooks free to capture anything (a data race with the threads still running). Review with the user: whether a hook should rather be allowed to capture non-sendable state from the main thread for the common case.

  • Settled on the user’s delegation 2026-11-06 (branch exit-hooks): A hook that traps or calls exit never goes on, and the hooks after it still run, on top of its stack rather than after unwinding it (the runtime’s frames hold counted values a jump past them would leak). The trap is reported as avin: trap in an exit hook: and the program then ends as a trap ends it, even where main returned or exit was called; an exit in a hook keeps the status of the ending that ran the hooks. A trap in a hook while a mutex is held stops the program at once, since a later hook may need what the lock guards. Why: one bad hook must not keep the others from putting their state back, and a failed cleanup must not end with a status that says success. Alternatives: a trap in a hook ends the program at once; an exit in a hook replaces the status (the last word wins, which a cleanup should not have).

  • Settled on the user’s delegation 2026-11-06 (branch exit-hooks): A hook registered while the hooks run runs too, at once after the one that registered it; cancel() answers false for a hook that has run or begun. Why: the registry is a stack the runner pops, so a hook a cleanup registers is the newest. Alternative: ignore registrations once the program is ending (silently drops cleanup a hook asked for).

  • Settled on the user’s delegation 2026-11-06 (branch exit-hooks): No hook runs on a stack overflow or on an unwatched signal. A stack overflow is reported by a handler on its own small stack where no Avin code can run. A signal the program does not watch keeps its platform action; a program that wants its hooks on Terminate, Interrupt or Hangup watches it and calls exit, as tui already watches them. Why: running hooks on an unwatched signal needs a watcher thread in every program with a hook, and a library watch of its own would change what the signal does for the program, which avin.signal promises it does not. Alternatives: the runtime watches Terminate, Interrupt and Hangup whenever a hook is registered and nothing else watches them, ending with exit(128 + sig) after the hooks; running hooks from the overflow handler on a fresh stack (the thread may have overflowed inside a lock). Review with the user: the signals, if a program wants cleanup on Ctrl-C without watching for it.

  • Settled on the user’s delegation 2026-11-06 (branch generic-joins): Two tuples join part by part (generics). (Dog, long) and (Cat, long) agree on (Animal, long) wherever two types are joined: the arguments of one type parameter, the branches of an if, the arms of a match, the elements of a literal, and a tuple inside a covariant argument (Option, Vector, List). Each part joins as two types alone do, so a part of an invariant type (Array[Dog] beside Array[Cat]) or two different value types (long beside int) still have no join, nor have tuples of different sizes. Why: the chapter already lists a tuple part among the places a value is read out, and two classes alone join; a tuple of them failing to was an omission in the checker’s join, which handled classes and generic types but not tuples. Alternatives: requiring the tuple type to be written (a contortion the class case does not need). Nothing here deserves a conversation.

  • Settled on the user’s delegation 2026-11-06 (branch generic-joins): A number literal among values that agree on one type takes the type the others decide (generics, collections). Among the elements of a collection literal, the keys or values of a map literal and the branches of an if, the values are checked in tiers, as a call’s arguments are: those holding no literal first, then values built around a literal (Some(2), (2, "b"), [2]), then expressions of literals alone (2, 2 * 3, -5), then empty literals, each later tier given the shape of what the earlier agree on with its value types kept and its classes left open. So [long(1), 2], [2, long(1)] and if c then 2 else big are long, and [1.5, 2] is Vector[real]. A match arm takes part only where it is an expression of literals alone, since an arm checked after the others would be checked outside its pattern’s scope, and a value built around a literal may name a pattern’s binding. Diagnostics for values with no common type still read in written order, at the later value. Why: types.md already says a literal takes its width from the other operand, and the literal chapter says elements agree as an if‘s branches do; [long(1), 2] being an error while long(1) + 2 is not read as a gap to programs. Alternatives: only the collection literal (leaves if and match stricter than the literal that is said to agree as they do); leaving each literal an inference variable settled at its use (the alternative weighed for nested literals too, deferred for the same reason); deferring every match arm that holds a literal by re-entering its pattern’s scope (more machinery for a rare shape). Review with the user: whether match arms such as Some(2) beside Some(big) should also agree.

  • Settled on the user’s delegation 2026-11-06 (branch okor-command-message): Option.okOr / okOrElse and CommandError.message. Option[T] gains okOr[E](error: E) -> Result[T, E] and okOrElse[E](f: () -> E), the Result counterparts of toRight; Result.ok and err() already existed. okOr takes its argument by value and okOrElse a function called only for None. WHY: the two names say which form evaluates; the by-name form already exists as a lambda call, and a by-name okOr would leave okOrElse redundant. Alternatives: a by-name okOr only (as toRight is; one method, but an argument with effects reads as eager and is not), or toRight-style names (toOk). Review with the user if okOr‘s eagerness should instead match toRight‘s. CommandError.message -> string reads exited with status N, killed by signal N (Name) (unknown for a signal avin.signal has no name for), timed out, and an Io error’s own IoError.message. WHY: one sentence per variant in IoError.message‘s lower-case style, the signal’s name beside its number as avin.signal names them. Alternatives: the number alone; ExitStatus.message as well (not added: nothing needs it yet).

  • Settled on the user’s delegation 2026-11-06 (branch sysl-098): Child.detach() (commands). detach() -> long lets go of every program of the command still running without stopping it (Sysl’s Spawned.detach) and answers pid(), the same long the Child already answers it as; a sequence’s later part not yet started is never started, and the sequence’s own redirected files are closed, the running part holding its copies. Afterwards waitFor, isAlive and kill trap (a detached Child is not waited for, asked after or stopped), while pid, group, signal, signalGroup and residentBytes answer from the ids recorded at each start; a second detach answers the pid again, and detaching a command already waited for lets go of nothing. Nothing reaps a detached program: one that ends while the program runs is a zombie until the program ends. WHY: once detached the Child can no longer see the command end, so an answer from waitFor or isAlive would be a guess, and a trap is how the library treats a handle used against its state (a Child used from the wrong thread); keeping the id-based operations lets a program still stop what it started. ALTERNATIVES: waitFor still waiting by pid (reaping, which makes a detached command a waited one again and races a reaper the program may run itself); Err from waitFor and false from isAlive (an isAlive of false would be a lie about a running program); answering int as Sysl does (the Child answers every id as a long); refusing to detach a pipeline or a sequence. Review with the user: whether a detached command should be reaped by the runtime so it leaves no zombie.

  • Settled on the user’s delegation 2026-11-19 (branch process-pipes): a started command’s standard streams as pipes (pipes to a started command). pipeInput(), pipeOutput() and pipeErrors() on Command ask for them, each replacing an earlier redirection of its stream as the other redirections do, and pipeOutput().errorsToOutput() merges standard error into the output’s pipe; Child.stdin(), stdout() and stderr() answer them, the same end every time, and trap for a stream not piped. The ends are new public classes, ChildInput: avin.net.StreamWriter and ChildOutput: avin.net.StreamReader, with ChildOutput.readAvailable(max) as standard input has it. Why: the halves of a split connection are exactly the shape (a Reader/ByteWriter that is also a Readiness/Writability, with readLine, readAll, writeSome, setTimeout and close), so a protocol written against a connection’s halves (a language server’s client) runs over a child unchanged, and select and Selector take them with no new arm. Each end is non-blocking and waits as a socket does (runtime/avin/rt/pipes.sysl), parking a lightweight thread on the poller; a write to a reader that has gone answers ConnectionReset (on macOS the end is marked F_SETNOSIGPIPE, since that system raises the write’s SIGPIPE on the whole process; elsewhere SIGPIPE is blocked on the writing thread for the write and taken back). The ends are made by sysl.process.pipe, closed on exec. Choices: only start() hands pipes over: run(), output(), lines() and a part of a pipeline or sequence asking for one trap, since nothing could ever hold the pipe; the pipes do not belong to the Child (Pipes is @keeps_owners), so handing the Child to a thread that waits for it leaves the pipes with the code using them; waitFor and Child.close() leave the pipes alone (each end closes with its own close(), or when collected), because an end may belong to another thread at the time; the command’s time limit bounds every wait on its pipes, a wait past it answering TimedOut, so withTimeout cannot be outwaited by a read nobody times; the pipes do not keep the command running. Alternatives weighed: the ends as io.Reader/io.ByteWriter classes of avin.process alone (no avin.net dependency, but every connection protocol would need an adapter); socket pairs in place of pipes (all of the socket code reused, but a child sees a socket where it expects a pipe); Option-answering or take-once accessors (takeStdout()), which make a loop of child.stdin().write(…) wrong; ends owned by the Child and handed over with it, which traps a program reading a child’s output while a thread waits for it; waitFor closing the input first, which reaches across threads; run() with a pipe meaning an empty input. Review with the user: whether Child.close() should also close the pipes the closing code holds, and whether the ends should keep the command alive.

  • Settled on the user’s delegation 2026-11-06 (branch sysl-098): totalMemory and residentBytes (the environment and the platform). process.totalMemory() -> Result[long, IoError] and process.residentBytes(pid: long) -> Result[long, IoError] over Sysl’s total_memory and resident_bytes, the u64 bound as a long (machine memory and a process’s resident pages are far below 2^63), and Child.residentBytes() for the program pid() names. A process that is not there (Sysl’s NotFound, which from Sysl 0.9.9 it answers for a reaped child and an unused pid alike), a pid of zero or less and one past the largest int are Err(NotFound); Sysl’s NotPermitted is Err(PermissionDenied), which macOS answers for pid 1 and Linux does not (it reads any process’s size). A Child seen to have ended, or with no program started, is Err(NotFound) without asking. WHY: the pid is a long everywhere else in avin.process (pid(), signal); NotFound and PermissionDenied are the IoError cases a program tells apart, where Sysl’s NotPermitted would otherwise read as Other(text). ALTERNATIVES: pid: int as Sysl takes it; Option[long] (loses why); passing Sysl’s “no such process” through as Other(...) as signal does.

  • Settled on the user’s delegation 2026-11-06: A group of only ended, unreaped processes answers “No such process” (branch group-signal-eperm; commands). signalGroup maps the platform’s permission refusal to Err(Other("No such process")): on macOS kill(-pgid) answers EPERM while a group holds only zombies and ESRCH once they are reaped, so the same program saw either answer by the timing of the reaping. Every process in a group a command made belongs to the program’s user, so a refusal can only mean that. WHY: one answer for an empty group, however the reaping falls. Alternatives: leave the platform’s answer and have callers wait for reaping (no way to observe it, and the flake stays); report the permission error only for a group the program did not start (not reachable, since signalGroup only names groups of its own commands).

  • Settled on the user’s delegation 2026-11-06 (branch parallel-codegen): A build compiles the program’s LLVM text as codegen units at once, one clang each, at most eight, and keeps each unit’s object in the toolchain’s cache by its text. A function only one function calls goes with its caller (kept local, so still inlined there: without this a hot single-caller function across a cut ran ~6% slower at -O2); other functions are placed by a hash of their name, globals with their first user, aliases with their global; a local crossing units is promoted to a hidden avin.cgu: name; at -O2 small functions (body cost at most 32) and short constants are copied available_externally into the units that use them. Why: clang -O2 on one 34 MB module was ~10 s of a 15 s rebuild of tui’s top on one core of eighteen; the hash placement keeps an edit to one function inside one unit, so the cache recompiles one unit. Eight: on a machine of six performance and twelve efficiency cores more units land on the slow cores and repeat more declarations and copies (the same cap Sysl’s builds measured). Alternatives weighed: units balanced greedily by size (better balance, but every edit that shifts a size reshuffles the units and defeats the cache); copying small local functions as local copies (cheaper, but a function would have one address per unit); no copies at -O2 (a call across units could never be inlined); no object cache (a one-line edit recompiles every unit); one unit per processor without a cap. AVIN_CODEGEN_UNITS overrides the count. Review with the user only if -O2 run-time performance across units ever shows up in a profile: the copy limit is the knob.

  • Settled on the user’s delegation 2026-11-06 (branch parallel-codegen): The cache of unit objects is trimmed to 1 GiB, oldest first, after a build that compiled a unit, sparing anything used in the last hour; a reused object’s time is refreshed. The test corpus links without keeping objects. Why: a build of top keeps ~8 objects of a few MB per level, so 1 GiB holds dozens of builds; the hour keeps a concurrent build’s objects from being evicted under it. Alternatives: a count of objects; no trimming.

  • Settled on the user’s delegation 2026-11-06 (branch process-exec): process.exec and its environment (becoming another program). exec(program, args) -> Result[Nothing, IoError] over Sysl 0.9.9’s sysl.process.exec, inheriting the environment, and an overload exec(program, args, environment: Map[string, string]) giving exactly that environment, nothing inherited, a bare name looked for on its PATH. Why: a Result with Nothing on its Ok side lets ? pass the failure on and says in the type that success never comes back; a whole Map matches what process.environment() answers, so adding to the program’s own is environment().updated(...), and a self-upgrading daemon wants the environment it was started with. Alternatives weighed: answering a bare IoError as Sysl does (no ?); a Command.exec() carrying withEnv/clearEnv edits (a command’s directory, time limit and redirections have no meaning for an exec, and would need refusing); a vector of environment edits. Standard output is flushed by the Sysl call (fflush of every stream, which is where Avin’s output is buffered). A match over the answer still needs an Ok(_) arm, since exhaustiveness does not yet treat a variant holding Nothing as impossible. Review with the user whether such arms should be dropped from exhaustiveness.

  • Settled on the user’s delegation 2026-11-06 (branch process-exec): waitPid and tryWaitPid answer Err(NotFound) for anything not there to wait for: a pid that is not this program’s child or was already reaped (Sysl’s Other(10), ECHILD), and a pid of zero or less or past the largest process id (Sysl’s Other(22) for the first, refused before the call for the second). Why: it matches residentBytes, where a process that is not there, a reaped child among them, and a pid of zero or less are NotFound, and gives a caller one case to match. waitPid is bound blocking, as Child.waitFor is, and both answer the same mirrored ExitStatus. Alternatives weighed: Other with a sentence (unmatchable by kind); a trap for a pid of zero or less (a pid read back from saved state is data, not a programming error).

  • Settled on the user’s delegation 2026-11-07 (branch fs-rename): fs.rename(from, to) -> Result[unit, IoError] (system library) replaces what is at to, in one step, and does not refuse. A file replaces a file; a directory replaces an empty directory; a directory that holds entries is DirectoryNotEmpty; a file onto a directory is IsADirectory, a directory onto a file NotADirectory. Renaming a path to itself succeeds and changes nothing. WHY: the call exists for the atomic write (write state.json.new, rename it over state.json), which is only atomic if a reader sees the old file or the new and the replacement never fails because the old one is there; replacing is also what the platform’s own rename does, so no extra check can race. ALTERNATIVES: refuse with AlreadyExists when to exists (a separate check-then-rename is racy, and the atomic write would need a remove first, losing atomicity); two functions, rename and renameReplacing. Across file systems the call fails and moves nothing (Other), never copying. Review with the user if a refuse-by-default rename is preferred.

  • Settled on the user’s delegation 2026-11-07: A Zone holds its rules in Avin until Sysl’s own zone can be held (branch local-time). A zone is a final class of a name and its rules: one fixed offset, or the bytes of the host database’s file for it as an immutable Vector[byte]. Each question (offsetAt, isDaylightSavingAt, abbreviationAt) passes the bytes to the runtime, which decodes them with Sysl 0.9.9’s sysl.time.tzif and answers. Why: that release’s decoded tzif.Zone is a view of the bytes it was decoded from, so it cannot be held as a handle past the call that made it; the bytes can, and a zone so held is an immutable value any thread may share, as the chapter says, where a handle belongs to one thread. Decoding a table walks its header, short beside reading it. Alternatives weighed: a handle over the borrowed view (a dangling reference once the shim’s copy is freed); a runtime table of decoded zones under a lock, handed out by number (global state and a lock for what is a pure function of the bytes); waiting for Sysl 0.10.0’s owning Zone (marshal needs the local time now). When Avin moves to Sysl 0.10.0, Zone becomes a handle over its zone with no change to Avin’s API. Review with the user: the roadmap planned the handle from the start.

  • Settled on the user’s delegation 2026-11-07: The local zone is the one TZ names, else the one /etc/localtime is, read from the database like any other (branch local-time). TZ with a leading : dropped is a zone’s name, a TZ that is a path is that file, named for what follows its zoneinfo/; with TZ unset, /etc/localtime‘s bytes are the table and its link’s target after zoneinfo/ the name (localtime where it is a copy). An empty TZ, one naming no zone, one that is not a zone’s name, and a file that does not decode give utc. Why: one source for the offset, the abbreviation and daylight saving, and a local zone equal to zone(name) of its own name, so localZone() == zone("America/New_York")? where that is the host’s zone. Alternatives weighed: the offset from localtime_r (Sysl’s local_offset) with the abbreviation from the table (two sources that could disagree, and a POSIX rule TZ such as EST5EDT with no file would have an offset and no abbreviation); a zone named local (never equal to the named zone it is). A POSIX rule string with no file of its name in the database is therefore utc.

  • Settled on the user’s delegation 2026-11-07: Pattern details the chapter left open (branch local-time): || is a bar between the bars too (|a||b| writes a|b), as it is outside them, so any text can be quoted; DDD pads the day of the year to three digits, as DD pads the day of the month to two; YY is the last two digits of the year’s magnitude (01 for year -1); YYYY outside 0 to 9999 writes the year as the display does (+12345, -0001); z and zz of UTC are +00:00 and +0000, never Z, so a pattern writes one shape for every zone (a literal Z is written as itself); f … ffffff cut the fraction rather than rounding, so a reading never rounds into the next second; and the whole pattern is read before anything is written, so a malformed pattern traps as malformed whatever value it is given. Alternatives weighed: DDD unpadded (a column of days of the year would not line up); Z for UTC’s z (a pattern’s output would change shape with the zone).

  • Settled on the user’s delegation 2026-11-07 (branch stop-signals): avin.signal names Stop, Continue, TerminalStop and Child. Each is an int numbered by the runtime for the platform (avin.rt.job_signal, over Sysl’s STOP, CONT, TSTP and CHLD, as User1 and User2 are over USR1 and USR2), since all four differ between macOS and Linux. Stop cannot be watched: watch(Stop) is Err(Other("Invalid argument")), the refusal Kill already gets, because the platform lets nothing catch it. Continue, TerminalStop and Child can be watched like any other signal; a watched TerminalStop no longer stops the program, and a watched Child is raised whenever a program the program started ends, is stopped or continues. A status a signal ended also names them (killed by signal 19 (Stop)), and now names User1 and User2, which it called “unknown”. Why: a supervisor pauses a job’s process group with Stop and Continue, and needs Child to see an end that races a restart; an Err, not a trap, is the existing treatment of a signal that cannot be watched, and a refusal is a value the caller can act on. Alternatives weighed: a trap on watch(Stop) (inconsistent with Kill, and a platform-dependent number would make “this one traps” a hidden fact of the platform); leaving Stop out of the library and sending a literal number (the number is not portable); spelling Continue as Cont (the library spells every other name out). Review with the user: whether TerminalStop should be left unwatchable, as a program that traps Ctrl-Z rarely means to.

  • Settled on the user’s delegation 2026-11-07 (branch lambda-after-literal): A lambda’s result takes part in a call’s literal tiers (generics). A lambda whose parameter types are known is checked in the tier of the value it yields (the last item of its block; the lowest tier among an if‘s or a match‘s branches), after the other arguments of that tier, rather than after every argument. So pick(s -> s.toLongOption(), 0) for pick[T](read: (string) -> Option[T], absent: T) takes T = long, as passing a named function does, and pick(s -> s.toRealOption(), 0) takes real; a lambda yielding Some(1) or 1 takes the numbers the other arguments decide. A lambda that leaves its body by return or ?, and a match function, are still checked last, since such a body needs its result type known before it is checked. Why: the settled number-literal decision says a literal gives way to a type from a neighbour, and a lambda’s result is a neighbour; a lambda checked last let the 0 fix T = int first, so the lambda and a named function of the same type behaved differently (marshal met it). Alternatives: deferring the literal instead of advancing the lambda (the same order in effect, but it reaches only literals, not the lambda’s own literal result); checking a lambda with ? against a result type known only in shape, deferred here and since built (next paragraph).

    Settled on the user’s delegation 2026-11-15 (branch lambda-question-shape): a lambda using ? or return checks against a result known only in shape. Where the function type expected for a lambda yields an Option[T], or a Result[T, E] with E known, and T is still to be inferred (wholly or in part), the lambda’s result is that shape: ? passes a None, or an Err converted to E as in any function, and the body’s value solves T, so inside(n -> Ok(half(n + 1)? + 1)) for inside[T](f: (int) -> Result[T, string]) takes T = int. A Result whose E is itself unknown, and any other shape, stay refused with “this lambda uses ?, so its result type must be known where it is written”. WHY: the pg package needs it for every c.transaction(tx -> { tx.execute(…)?; Ok(x) }) and pool.use body, where the transaction’s value type is the caller’s and the error type is the library’s; the error type is what ? needs, and it is known. Only a lambda that exits by ? or return takes the shape as its declared result; any other lambda still infers from the body against the shape as a hint, so nothing it accepted changes. ALTERNATIVES: inferring E from the first ? too (makes a lambda’s error type depend on which failure is written first, and a later ? of another error type then fails to convert rather than widen); making a ? lambda take part in the literal tiers as well (it is still checked after the other arguments, so pick(s -> Some(s.toLongOption()? + 1), 0) still fixes T = int from the 0 and is refused: checking it earlier would refuse a ? lambda whose result is a bare T that only a later argument decides). Review with the user: whether a ? lambda should also join the literal tiers when its expected result has the shape, which would make the pick example a long.

  • Settled on the user’s delegation 2026-11-07 (branch hash-digest): avin.crypto, digests over sysl.crypto. The module is avin.crypto; it has sha256, sha512, sha1 and md5 (each taking a Vector[byte] or a string, hashed as UTF-8, answering a Vector[byte]), hmacSha256 and hmacSha512, toHex, and incremental Sha256(), Sha512(), Sha1() and Md5() with update and finish. WHY: marshal hand-wrote FNV-1a to key a build cache because the library had no digest, and Sysl already has SHA-2, SHA-1, MD5 and HMAC; a binding cannot disagree with Sysl. avin.crypto rather than avin.hash because the module holds keyed digests, and “hash” in Avin already means the trait behind HashMap. A digest is a Vector[byte], not a string, so it compares, keys and stores as bytes and hex is one call away. Details: finish() caches its digest and answers it again, and update after finish traps (a Sysl hasher cannot be finished twice); the hashers are Avin classes over private handles because a handle has no constructor; the one-shot digests and HMACs go through small avin.rt functions (runtime/avin/rt/digest.sysl) because Sysl’s one-shot functions answer a fixed array ([32]u8), which no binding result takes, and Sysl keeps its streaming HMAC private. ALTERNATIVES: avin.hash (above); digests as hex string (loses the bytes); one-shots through the Sysl hasher handle only (cannot reach HMAC); making the boundary accept fixed [N]u8 results (a compiler change for a handful of functions); an HMAC written in Avin over the hashers (a second implementation to keep correct); also offering SHA-224, SHA-384, HMAC-SHA-1 and HMAC-MD5 (Sysl has them, nothing asks) and a constant-time verify (Sysl has one; add it when a program checks tags). Review with the user: whether sha1 and md5 belong in the standard library at all, and whether the other SHA-2 widths and verify should be added now.

  • A top-level name declared twice is reported with the first declaration’s place, and a clash between two files of a module suppresses every other diagnostic. Settled on the user’s delegation 2026-11-07. Each duplicate message ends ; first declared at FILE:LINE:COL. When the clash spans files, the program’s other errors are dropped before printing, because they are almost always cascades of the clash (two Filter types in one module gave 48 conformance errors and no word of the clash, and the CLI shows five). A clash inside one file keeps its other errors, since existing reject cases mix a duplicate with unrelated errors and the duplicate is easy to see there. WHY: the clash is the cause and must be the error read first. ALTERNATIVES: suppressing for same-file clashes too (hides real unrelated errors in one file); ordering duplicates first without suppressing (the cascade still fills the five shown). Review with the user: whether same-file clashes should suppress the cascade too.

  • File metadata in avin.fs Settled on the user’s delegation 2026-11-07: metadata(path) answers Result[Metadata, IoError] with Metadata(size: long, modified: Instant, isDir: bool, isFile: bool), from one stat, so the fields describe one entry; size(path) and modified(path) are shorthands for the two fields a program usually wants, and setModified(path, instant) sets the modification time (and the access time with it). Every call follows symbolic links, as exists, isDir and isFile do; a dangling link is NotFound. modified is an avin.time.Instant, the type now() answers, so a program compares a file’s age with now() - modified-style arithmetic and nothing else. Why: marshal’s retention kept .used sidecar files because a file’s age and size could not be read; one stat is also one trip, and a value is not three answers about three possibly different files. Alternatives weighed: separate size/modified only (three trips for three facts, no directory answer); returning Sysl’s whole Meta (owner, inode and permission bits are not what Avin programs ask yet, and they tie the type to POSIX); a linkMetadata that does not follow (nothing needs it yet, and avin.fs offers no way to make a link to ask about); setModified omitted (Sysl has set_modified, so it costs a line, and it lets “last used” be recorded without writing). Times are microseconds, the library’s resolution.

  • Permission bits in avin.fs Settled on the user’s delegation 2026-11-23 (branch fs-permissions): Metadata gains a fifth field, permissions: int, the twelve low bits of the mode (the nine rwx with setuid, setgid and sticky; never the file type), read by the same one stat; permissions(path) is its shorthand, as size and modified are; setPermissions(path, mode) sets exactly mode, following a link. The mode is an int written as an octal literal (0o600), which the lexer already reads. A mode outside 0o0..0o7777 is an Err of kind Other naming it in octal (a mode outside 0o0 to 0o7777: 0o10000), raised before the path is touched, so the file keeps its mode. Setuid, setgid and sticky are accepted, since permissions reports them and the two must round trip; where a platform refuses one (macOS: sticky on a plain file for a non-superuser) its error comes back as the platform’s. Why: marshal’s token file must be owner-only, and the bits belong with the other facts one stat gives. Alternatives weighed: a separate Permissions type with ownerRead-style accessors (more surface than one octal number, which is how every reader already thinks of a mode; can come later over the same int); masking an out-of-range mode silently to 0o7777, as Sysl’s set_permissions does (a type bit passed by mistake, 0o100644 from a raw st_mode, would succeed quietly); trapping instead of Err (a mode read from a config file is input, not a program bug; File.seek‘s negative offset is the same shape and answers Err). Creating a file with a mode from the start (no moment with wider bits) is not in this entry: Sysl 0.13.2 exposes no create-with-mode, fchmod or umask call.

  • isFile means a regular file Settled on the user’s delegation 2026-11-23 (branch fs-metadata): fs.isFile(path) and Metadata.isFile are true for a regular file alone; a FIFO, a socket and a character or block device now answer false, where before isFile was “exists and is not a directory”. Why: every caller in the library, marshal and fettle asks isFile before reading, running or sizing a file, and a FIFO there blocks the read and a socket fails it; the evictOlderThan example in the chapter would have removed another program’s socket. Alternatives weighed: keeping “not a directory” and adding isRegular (the common name would keep answering the question no caller means). Review with the user: it changes behaviour, though no test, example or caller found relied on the old meaning.

  • Complete file metadata in avin.fs Settled on the user’s delegation 2026-11-23 (branch fs-metadata): Metadata gains kind: FileKind, accessed, changed (both Instant), owner, group, links, inode and device (all long), after its five existing fields, and an isLink member; linkMetadata(path) reads a link itself; exists(path, followLinks = true) asks about a dangling link with followLinks = false; isSameFile(a, b) -> Result[bool, IoError] compares inode and device; isReadable/isWritable ask the platform’s access; and avin.process gains userId(), groupId() and userName(id). FileKind is Regular | Directory | Symlink | Fifo | Socket | CharDevice | BlockDevice | UnknownKind(bits), named from the type bits Sysl’s Meta.kind reports (its Special(bits) split into the four POSIX kinds). Why: walking safely, de-duplicating and copying with attributes need the kind, identity and owner of an entry, and they come from the one stat already made. Choices: ids are long, since a user id is unsigned 32-bit and macOS’s nobody is 4294967294; inode and device are long wrapped from 64 bits, compared, never done arithmetic on. Regular rather than File: File is the open-file class of the same module, and a variant is a module-level name. isSameFile is a Result, not false for a missing path, since “no such file” is not “a different file”. exists takes a named flag rather than a second name (existsNoFollow), as the copy options will. isReadable answers for the user who started the program (access(2)‘s real ids), and the superuser is true whatever the bits. Owner names are user names only, in avin.process: Sysl 0.13.2 has user_name and no group-name lookup, so groupName is left out until it does. Alternatives weighed: a separate LinkMetadata type (the fields are the same); a Permissions-style object for ids (one number is what every reader thinks in); accessed left out because some file systems do not record reads (it is still right after setModified, and the chapter says which do not).

  • Settled on the user’s delegation 2026-11-08 (branch runner-streaming): avin test pushes its report out as it goes, and on SIGTERM or SIGINT writes out what it holds and names the work in progress. The report text of a run is unchanged. The report is pushed to its reader when a test finishes and at least half a second has passed since the last push (the first finish always pushes), and at the end of the run, so a log read while the run is alive shows every test but the last half second’s, and speed is unchanged. On SIGTERM or SIGINT the runner pushes the report at once, then writes avin test: interrupted by SIGTERM; in progress: (or SIGINT) and one line for each piece of work still running, in the form run <file> <test> <seconds>s for a test and compile <program> <seconds>s for the build of the program, stops the test processes it started and exits with 143 (TERM) or 130 (INT), within about 20 ms of the signal. A watcher thread reads the signals, so a build blocked in a tool, or a compiler pass that is busy, cannot keep the lines from being written. The new option avin test --prefix puts the file’s path and a colon before every result line (a.avin: ok passes 3ms), for runs whose output is interleaved with other runs’ in one log; headings and the summary are not prefixed. Why: a job stopped at its deadline left a zero-byte log because the report sat in a buffer until the run ended, and a hung build named nothing. Alternatives weighed: flushing after every line (cost: a write for every line of a many-test run), a prefix always on (changes every existing report), a prefix on only when output is not a terminal (the same program would write different text by where it was sent), and polling the signal flag between tests (a blocked test or build would never reach the poll). Review with the user: the option’s name --prefix, and the exit codes 143 and 130 (the shell’s 128 + signal convention).

  • Settled on the user’s delegation 2026-11-09 (branch with-update): with is refused on a data type with several variants, and a path through a field of such a type (Option among them) is refused too. Why: variants are constructors, not types, so no static type says which variant a value is and which fields it has; the language already refuses s.radius on a Shape for the same reason, and a match arm makes the new variant directly (Circle(r) -> Circle(r + 1)). Alternatives weighed: accepting it where every variant has every named field, with the same type, and choosing the variant at run time (a hidden match), which makes the form’s cost and its errors depend on edits to other variants; and trapping on a variant without the field, which turns a compile-time error into a run-time one. Review with the user: whether the every-variant-has-it form is wanted for enums whose variants share a common header.

  • Settled on the user’s delegation 2026-11-09 (branch with-update): a with keeps the base’s type arguments: Box[int] with { v = "s" } is a type error, not a Box[string]. Why: the result is then always the base’s type, as the desugaring to a copy says, the value of each change is read against a known field type (so literals and None take it), and a field the change does not name, which may hold a T, never has to be re-checked at a new type. Alternative weighed: re-inferring the type arguments from the changed fields and the kept ones, which is what a call of the variant would do; it is left for an explicit construction, Box("s", b.label).

  • Settled on the user’s delegation 2026-11-09 (branch with-update): with is read as the update only when the brace follows it on the same line, as a postfix tail binding tighter than every prefix and infix operator; before anything else it is an ordinary name, so a with b stays the infix call of a method with. Why: keywords are contextual, and Isolated.with and the library’s shared.with(f) keep their names. The cost: an infix call of a method with whose argument is a set or map literal must be written a.with({…}). Alternative weighed: making with a reserved word, which would rename those methods.

  • Settled on the user’s delegation 2026-11-09 (branch with-update): a misspelt field is reported with the nearest field when it is at most two single-byte edits away and fewer edits than the name’s length (nmae suggests name; a one-letter name suggests nothing). Alternative weighed: listing every field of the type, which is long for wide types.

  • Settled by the user 2026-11-09: placeholder lambdas _ + 1 (placeholder lambdas; branch placeholder-lambdas). Each _ in a call’s argument is a parameter of its own, in the order written, and the smallest argument holding it is the lambda’s body: xs.map(_ + 1), xs.map(_.name), xs.reduce(_ + _), xs.map(f(_, 2)). The right side of a val with a declared function type takes one too. Parameter types come from the expected type, as for any lambda. Why: the user’s rule that Avin adopts the conveniences that add no complexity; the short form reads as what it does and is the usual one for a one-step function.

  • Settled on the user’s delegation 2026-11-09 (branch placeholder-lambdas): a _ that is a whole argument belongs to the argument around its call, so xs.map(f(_, 2)) is xs.map(x -> f(x, 2)) and f(_) is never the identity lambda f(x -> x). Where a call with such a _ is itself no argument and no declared value’s right side (f(_, 2) as a statement), it is an error asking for the lambda to be written out. Why: the identity is rarely what f(_) means, and x -> x is short; reading the whole call as the lambda is what makes partial application, f(_, 2), work. Alternative weighed: the identity lambda, which makes f(_, 2) a call of f with a function.

  • Settled on the user’s delegation 2026-11-09 (branch placeholder-lambdas): xs.map(f(_)) is an error saying to pass f: a placeholder lambda that only calls a function named in lowercase with all its parameters in order (f(_), add(_, _)) is that function, and functions are already values. A name starting in uppercase (Some(_), Point(_, 0)) is taken for a constructor and makes the lambda. Why: one spelling for one meaning, and the error teaches that a function is passed by name. Alternatives weighed: accepting it as x -> f(x) (harmless, but two spellings), and deciding by what the name resolves to rather than its case, which needs the parser to know the checker’s answer; the case test follows the settled naming rule. Review with the user: whether the redundant form should simply be allowed.

  • Settled on the user’s delegation 2026-11-09 (branch placeholder-lambdas): where a placeholder is searched for. Through operators of every precedence, member access and method calls, tuple parts, is, ranges, ?, with‘s base, a call’s callee and a call’s arguments that are _ alone; never into a lambda, a block, if, match, a collection literal, an interpolation, an assignment or another call’s other arguments. A _ in those is an error, not a lambda around the nearer construct. Why: the set is the expressions that read as one step on one value, and a _ inside a nested lambda or a branch would make the reader search for which lambda it belongs to. Alternatives weighed: searching everything to the argument (makes xs.map(n -> n + _) a lambda returning a lambda) and searching operators only (rejects (_, 0) and _ is Some(_)).

  • Settled on the user’s delegation 2026-11-09 (branch placeholder-lambdas): a declared value takes a placeholder lambda only by its written type: val f: (int) -> int = _ + 1 and any declared type other than a tuple; an undeclared val f = _ + 1 is an error, as are a function’s body, return and an assignment’s right side, whose expected type the parser does not see. Why: the brief’s rule, kept syntactic so the lambda’s extent never depends on type inference. Alternative weighed: any expression with an expected function type, which makes the extent of a lambda depend on checking. (Amended 2026-11-19, branch underscore-fn-expected: a function’s body with a written result type is a place too, since its type is written as a declared value’s is; see the entries below.)

  • Settled on the user’s delegation 2026-11-19 (branch underscore-fn-expected): a branch is a place of its own. Where an if, a match or a block stands where a placeholder lambda may (a call’s argument, a declared value, a function’s body with a declared result), each branch of the if, each arm of the match and the block’s last line is such a place in turn, recursively, with a call argument’s rules: val key: (Request) -> string = by match "method" -> _.method … and xs.map(if up then _ + 1 else _ - 1). The condition, subject, guards and a block’s earlier lines keep their own _, and an if or match anywhere else gives no branch a place, so val f = if c then _ + 1 else 0 keeps its error. Why: a choice among functions is common (ported command-line programs met it at once), each branch’s value is the function expected, and the rule stays syntactic, so a lambda’s extent still never depends on checking. Alternatives weighed: searching the whole if/match for one lambda around it (makes if _ > 0 then … a lambda of the condition, a different meaning per position), and deciding by the expected type the checker finds (any position, but extent then depends on inference). Review with the user: it widens the 2026-11-09 rule that an if and a match keep their own _.

  • Settled on the user’s delegation 2026-11-19 (branch underscore-fn-expected): a function’s body with a declared result type, and each of its clauses’ bodies, is a placeholder’s place, by the same rule as a declared value: any written result but a tuple, so a type alias of a function type works, adder(n: int) -> (int) -> int = _ + n. A function with no declared result is not one, and return‘s value stays none (the parser does not carry the result type to it). Why: the result type is written beside the body as a value’s type is beside its value. Alternatives weighed: only a result written as a function type (excludes aliases, unlike values), and leaving bodies out as before (the 2026-11-09 reason, that the parser does not see the type, holds for return but not for a body whose type is written above it).

  • Settled on the user’s delegation 2026-11-19 (branch underscore-fn-expected): a placeholder lambda where no function is expected is reported once, as “cannot infer the type of this _“, and is then of no type, so val n: int = _ + 1 and count() -> int = if c then _ + 1 else 0 no longer add “expected int, found () -> “ or “the branches agree on no type”. Why: the second message only repeats the first in worse words. Alternative weighed: keeping the function of errors, which is what a written lambda’s unknown parameter still gives.

  • Settled on the user’s delegation 2026-11-09 (branch type-aliases): type aliases are transparent, type Name[T] = Body (type): each use is the body with the type arguments substituted, and the checker keeps no trace of the alias, so diagnostics name the expansion. Why: an alias is shorthand for a long type, and a type a reader can see through needs no conversion and no new rules for equality, overloading or patterns. Alternatives weighed: a nominal alias (a new type, as data makes), which would need conversions everywhere and duplicates what a one-variant data type already does; remembering the alias for diagnostics, which needs an alias-carrying type in every type the checker builds and is left as a later improvement.

  • Settled on the user’s delegation 2026-11-09 (branch type-aliases): type is a declaration word only before a name, and elsewhere an ordinary name, as actor, machine, lazy and with are. Why: no Avin code in the library or the tests names anything type, but a field called type is common in data that mirrors JSON or C, and keywords are contextual where they can be. Alternative weighed: a reserved word, which would forbid those names for no gain in parsing.

  • Settled on the user’s delegation 2026-11-09 (branch type-aliases): an alias’s type parameters take no variance, no bounds and no lower bound; the types its body names hold its type arguments to their own bounds at each use. Why: the alias is its expansion, so its uses are held exactly as the expansion written out would be, and a bound on the alias would only repeat the body’s (or wrongly differ from it). Alternatives weighed: bounds on alias parameters checked against the body, as a data type’s are, which adds a second statement of the same constraint; no check at all until the expansion is used as a value, which would accept Sorted[Opaque] in a signature.

  • Settled on the user’s delegation 2026-11-09 (branch type-aliases): an alias whose body does not use one of its type parameters is refused. Why: A[int] and A[string] would be one type, which reads as a distinction the program does not make. Alternative weighed: allowing it as a phantom parameter, which a transparent alias cannot give any meaning. Review with the user: a phantom-type idiom would need data instead.

  • Settled on the user’s delegation 2026-11-09 (branch type-aliases): an alias names only a type: it is not a value, a constructor, a pattern, an impl’s target or a parent in a class’s list, each refused with a message naming the expansion, and the name that makes and matches its values where there is one. Why: one meaning for an alias’s name keeps a call and a pattern reading as what they make and match, and the expansion may be a tuple or a function type that has no constructor at all. An alias of a function type in a class’s parent list is refused with the rest, though the function type itself may be written there. Alternatives weighed: allowing an alias of a data type or a class as its constructor and in patterns (P(1, 2)), which makes an alias’s use depend on what it expands to; allowing impl Alias, which would add methods to a type under a name that does not say which. Review with the user: aliases of traits in a parent list may be wanted later.

  • Settled on the user’s delegation 2026-11-09 (branch type-aliases): an alias’s name may be shared with a function or a module value, but not with any other type of its module (data type, class, object, alias), a built-in type or Self. Why: an alias lives only where types are written, so a function of its name is never ambiguous, while two types of one name would be. Alternative weighed: refusing every clash, as a class’s name clashes with a function’s because the class’s name is also its constructor, which an alias is not.

  • Settled on the user’s delegation 2026-11-09 (branch derives-enumerable): Enumerable is a core library trait derived through an ordinary template (library/avin/enumerable.avin), its members static values() -> Vector[Self], ordinal() -> int, name() -> string and static valueOf(name: string) -> Option[Self]; the compiler’s only part is who may derive it. Why: the template mechanism already gives every member (T.shape(), T.variantOf, T.build), so nothing new enters the compiler but the refusal, and the trait can be a bound (E: Enumerable) in generic code. Alternatives weighed: members the compiler writes out per type (a constant vector made once, faster values(), but a second derivation path beside the templates); an enum keyword (new syntax for what a data type already is).

  • Settled on the user’s delegation 2026-11-09 (branch derives-enumerable): values() is a Vector, made anew at each call. Why: Vector is the library’s default sequence, what a literal [a, b] makes; a template has no per-type storage to keep one in, and the vector is immutable, so a fresh one is indistinguishable from a kept one except in cost (O(variants) per call). Alternatives weighed: Array (mutable, so it would have to be copied anyway); List; an iterator (cannot be indexed by ordinal()). Review with the user if values() turns up in a hot loop: a compiler-kept constant would make it free.

  • Settled on the user’s delegation 2026-11-09 (branch derives-enumerable): name() is part of Enumerable, separate from Display. Why: Display can be replaced by an impl, so it cannot be the inverse of valueOf; name() always is, T.valueOf(x.name()) == Some(x). Alternatives weighed: reusing toString()/Display (breaks the round trip once Display is customised); a static names() (redundant with values().map(v -> v.name())). A type’s own method named name then clashes, reported as two methods of one name; review with the user if that proves common.

  • Settled on the user’s delegation 2026-11-09 (branch derives-enumerable): valueOf matches the declared name exactly, byte for byte, answering Option. Why: exact is predictable and cheap, and a program wanting another rule (case-insensitive, trimmed) writes it over values() and name(). Alternatives weighed: a trapping valueOf (the library answers input that may be wrong with Option, as toIntOption does); case-insensitive matching (ambiguous where two variants differ only in case).

  • Settled on the user’s delegation 2026-11-09 (branch derives-enumerable): a generic data type cannot derive Enumerable, even when every variant has no fields (data Tag[A] with X | Y). Why: a derived impl of a generic type bounds each parameter by the trait (impl[A: Enumerable]), which means nothing for a phantom parameter, and Tag.values() would need a type argument nobody can infer. A parameterless enumeration is what such code wants. Alternative weighed: allowing it with unbounded parameters, Tag[int].values(), a special case in how templates are applied.

  • Settled on the user’s delegation 2026-11-09 (branch derives-enumerable): only data types derive it; a class (an object cannot write derives) is refused even without constructor parameters. Why: a class instance has identity, so values() would make a new instance per call, unequal to the last. Alternative weighed: allowing a class of no parameters as an enumeration of one.

Exports between modules (branch export-reexports; modules)

  • Settled on the user’s delegation 2026-11-09: export is written exactly as import is: export a.b.X, export a.b.{X, y as z}, renaming with as, one top-level line each, at the top of any file of the module. Why: one syntax to learn, and every form an import has means the same thing in an export. Alternatives weighed: an export modifier on an import line (export import a.b.X), which ties presenting a name to bringing it into one file; a list in the package manifest, far from the code it shapes.
  • Settled on the user’s delegation 2026-11-09: an exported name is a name of the module, seen by every file of the exporting module without an import, and found after the module’s own declarations and before the file’s imports. Why: a module’s files are one namespace, and an export adds to that namespace exactly as a declaration would; a module presenting Point and writing centre(p: Point) beside it should not have to import what it already offers. Alternatives weighed: an export visible only to other modules, so the exporting file also writes the matching import (two lines per name, and a file of the module that forgets the import sees a name its importers see but it does not); an export visible in its own file only, as an import is (breaks “a module’s files are one namespace”).
  • Settled on the user’s delegation 2026-11-09: no wildcard export, as there is no wildcard import. Why: a module’s surface stays readable from its export lines, and a declaration added to an internal module never silently joins the public surface. Alternative weighed: export a.b.*, convenient for a facade over one module; revisit with wildcard imports if those are ever added.
  • Settled on the user’s delegation 2026-11-09: an export names a public declaration of another module, directly or through that module’s export; private, unknown, whole-module, own-module and root-module exports and a private export are errors. Why: an export presents a declaration, never widens one, and the root module has no name to be imported by. A whole module is not a declaration: export a.b would make a module a member of another, which modules are not. Alternatives weighed: exporting a whole module as a nested name (shapes.geometry reachable as facade.geometry), which needs module members and is left for later; letting an export make a private declaration public, which would make private meaningless to the module that wrote it.
  • Settled on the user’s delegation 2026-11-09: exports chain, and two modules may export each other’s declarations; exports that lead round without reaching a declaration are an error at each export of the cycle. Exports are resolved from the source before anything is declared, following each chain with the names it has passed, so a cycle stops rather than loops. A link that is wrong (a private or unknown target) is reported where it is written, and the exports chained after it are not reported again; an import through such a chain reports the name as private to, or missing from, the module it names.
  • Settled on the user’s delegation 2026-11-09: an exported name clashes as a declaration does, but two paths to one declaration never clash. An export clashes with a declaration of its module, with another export of the name reaching a different declaration, with an import of a different declaration in a file of the module, and with a module imported under that name. A module exporting a name and importing the same declaration, exporting it from two files, and a file importing it both directly and through an export are all accepted. Why: the error exists to stop one name meaning two things; when both mean one declaration nothing is ambiguous. Alternative weighed: refusing every duplicate, which makes a module that both uses and presents a declaration choose between an import and an export for no reason.
  • Settled on the user’s delegation 2026-11-09: every kind of top-level declaration can be exported: data types, aliases (generic ones too), classes with their companion objects, objects, traits, machines (with Door.State), functions (all public overloads of the name, never a private one), module-level val, var and lazy val, and variants. A type’s variants are not exported with it: each is exported by its own name, as each is imported by its own, and Color.Red reaches one through an exported type either way. Why: an export is a name for a declaration, and every name an import can bring in is one an export can present; variants follow imports so the two never differ. Alternative weighed: exporting a data type’s variants with it, which an import does not do either.
  • Settled on the user’s delegation 2026-11-09: a module that exports a declaration of another presents that module’s extensions: the exporting module’s own files, and every file importing it whole or any name of it, see the methods the other module’s extensions add; a file importing a declaration through an export sees its declaring module’s extensions as a direct import would. Why: “importing a module or any of its declarations brings in its extensions” should not depend on which path reached the declaration, and a facade over a package should carry the package’s extensions with it. Only modules whose declarations are exported are presented, not modules the exporter merely imports. Alternatives weighed: extensions reached only by importing their module directly (a facade could not offer a package’s extension methods at all); an explicit export of an extension (an impl has no name to export). Review with the user: this widens which extensions a file sees.
  • Settled on the user’s delegation 2026-11-09: export is a contextual word, meaning an export only at the start of a top-level line before a name, and an ordinary name everywhere else (a function export(…), a field, a parameter, a local). Why: as type is; nothing in the library or tests names anything export today, but the word is a natural method name (report.export()), and keeping it free costs one token of lookahead. Alternative weighed: a reserved keyword, simpler to lex but taking a useful name from every program.
  • Settled on the user’s delegation 2026-11-09: a diagnostic and the language server name the declaration an export reaches: an import clash reports already imported, from \inner.Widget`, the declaring module's path, and go-to-definition on an exported name (at the export line or any import of it) goes to the declaration itself. Completion after m.` does not yet list a module’s exports (see Open).

Member exports (branch member-export; exporting members)

  • Settled on the user’s delegation 2026-11-19: export f.m in a type’s body is written as a module export is, one member, a {…} group, as renaming, with operators by their spelling (export n.+), in the body of a class or an object, or in a plain impl of a data type of the impl’s own module (a data type has no body of its own). Why: one form for presenting something as one’s own, at the module and at the type. Alternatives weighed: a modifier on the field (delegate val items, all or nothing); generated wrapper methods the program writes itself (what the feature exists to save).

  • Settled on the user’s delegation 2026-11-19: export f.* presents every public member of what f holds that the type does not have itself, unlike module exports, which have no wildcard. Why: the usual forwarding is a wrapper over one value’s whole surface, with a few members of its own replacing the wrapped one’s; listing every member defeats it. The module rule was about a declaration added to an internal module joining a public surface unseen; here the wrapped type is named in the field’s declared type, so what joins is visible there. Spelled *, not _, since _ is a placeholder lambda in an expression and a hole in a type. Alternatives weighed: no wildcard, as for modules; _. Review with the user: the one place the two export forms differ.

  • Settled on the user’s delegation 2026-11-19: a use is the use of x.f.m, checked as that code, a fallback of the checker’s member lookup after the type’s own members, its superclasses’, its traits’ and its impls’: calls with every overload, defaults, named and repeated arguments and type arguments, reads, assignments of a var field (x.m = v, +=, ++), method values bound to x.f as read then, infix calls and operators (a + b, a lone a < b). Why: forwarding then means exactly what the longer code means, with its diagnostics, and needs no copy of a member’s signature to drift from it. Alternatives weighed: a wrapper method per overload, generated into the type (copies defaults, repeated and by-name parameters and type parameters of each member, and reports mistakes against the copy).

  • Settled on the user’s delegation 2026-11-19: f is a field (own, or a public inherited one) or a method of no parameter list, with its type declared, read again at every use. A var field reassigned between calls sends each to the value it then holds; a method f runs at each use. Why: the export is part of the type’s surface, which other declarations (trait conformance, completion) need before any body is checked; a class parameter’s type is always written, so the common case costs nothing. Alternatives weighed: inferring an undeclared field’s type by checking the class body first, as a field read does (makes a declaration depend on a body); reading f once at construction (a var field’s export would go stale).

  • Settled on the user’s delegation 2026-11-19: an export presents public members only: never a private one, by name or by *, never a static one, never equals or hash (every value has its own); a member the field’s type exports in turn counts, so exports chain. Exports by name that lead round without reaching a member are an error at each export of the round, and wildcards that lead round present nothing (each search stops at a depth bounded by the program’s types).

  • Settled on the user’s delegation 2026-11-19: the type’s own members win; an export by name of a member the type has is an error. A wildcard silently leaves the type’s own members (and its superclasses’, traits’ and impls’) to them, the usual way to replace a few of a wrapped value’s members. An export by name of a member the type declares, a field of its own or inherited, or a superclass’s method is an error, since naming a member and declaring it says two things; so are two exports by name of one name (naming both), and a subclass member named like an export its superclass makes by name (a use through the superclass would reach the export and one through the subclass the member, with no override between them). An export by name comes before a wildcard, and two wildcards both reaching a name make a use of it an error naming both. Alternatives weighed: the type’s own member silently winning over an export by name too (hides a mistake); an export by name winning over the type’s own member (makes the member dead code). Review with the user: the conflict rule.

  • Settled on the user’s delegation 2026-11-19: a public export by name of a class implements the trait’s methods of its name that the class does not declare: the class gets a method with the trait’s signature whose body is self.f.m(params), standing as an override would (it replaces a default too), so a call through the trait reaches the member; every overload of the trait’s name is implemented. A wildcard implements nothing, a private export of a trait method’s name is an error, a trait method with type parameters of its own is reported at the export, and a data type’s export implements nothing (its trait impls write their methods). A member that cannot be called with the trait method’s parameters, or yields another type, is one error at the export naming the export, the trait’s method, both signatures and the mismatch, never the diagnostics of the method written for it. Why: delegation-based conformance is most of what forwarding is for; requiring the name keeps a class’s conformance readable from its declaration, and keeps it from depending on what a wrapped type happens to have. Alternatives weighed: forwards never counting toward a trait (every conformance written out by hand); a wildcard counting too (a trait met by a member the class never names). Review with the user: trait satisfaction, its restriction to exports by name and to classes, and methods with type parameters of their own.

  • Settled on the user’s delegation 2026-11-19: an export is reached through a value, x.m and self.m, never by a bare m inside the type nor by Type.m. Why: a wildcard adding bare names to the type’s code would hide top-level declarations whenever the wrapped type grows a member; inside the type the field itself is in scope. Alternative weighed: bare names reaching exports as members do.

  • Settled on the user’s delegation 2026-11-19: private export presents the members to the type’s own code (its class and companion, or a data type’s impls), as a private method is.

  • Settled on the user’s delegation 2026-11-19: the editor follows an export: completion after a dot offers the members a value’s exports present, under the names presented, and go-to-definition (and hover) on a use, an alias or the export line reaches the member’s declaration, the field read included.

  • Settled on the user’s delegation 2026-11-09 (built on branch regex-budget, for marshal grep): avin.regex‘s checked searches. A spent step budget becomes a failure the caller can handle, answering the review question left on the settled limits on matching:

    • A checked family beside the plain API: tryMatches, tryFindFirstIn, tryFindFirstMatchIn, tryFindPrefixOf, tryFindPrefixMatchOf, tryFindAllIn, tryFindAllMatchIn, tryReplaceAllIn (both forms), tryReplaceFirstIn, tryReplaceSomeIn, trySplit and Pattern.trySplit, each Result[T, MatchError] with T what the plain search answers. Why: a pattern written in the program that backtracks too far is a defect the trap explains, and every findFirstIn stays a plain Option; a program searching outside text or patterns (a grep) needs to go on, and says so by its choice of method. It mirrors Regex(p) beside Regex.compile(p) and Url(text) beside Url.parse. Alternatives: every search answering a Result (breaking, and makes every search fallible for what is almost always a defect); a regex-level mode (checked()) changing what the plain methods do on overflow (the result type cannot change with it, so it would need a sentinel); an error() query on the iterator after it stops (easy to forget, so a spent budget reads as “no more matches”).
    • The gathered forms of every-match searches: tryFindAllIn answers a Vector, not an iterator, and the error discards the matches found before it; a replacer has been called for those by then. Why: an iterator of Results, or one whose end might be an error, makes the common loop longer and is easy to read wrongly. Alternatives: an Iterator[Result[Match, MatchError]]; giving the matches found so far with the error.
    • MatchError(pattern, inputLength, budget), a plain data type with message() and Display, as PatternError is; inputLength counts characters. Alternatives: a RegexError with variants for both kinds of failure (compile would change type, breaking); a bare message string.
    • The plain searches still trap, the message now naming the budget and the checked alternative: … past its budget of N steps; make a repetition possessive or atomic, or search with a try method to handle it. The budget stays per regex (withStepLimit), its default unchanged. Alternatives: a per-call limit argument on the try methods (doubles every signature; withStepLimit is cheap to call per search).
    • The matcher learns of a spent budget by a flag every step checks, so a spent budget ends the whole search through every nested part; a lookaround’s or atomic group’s body answering no for it is never taken as the body failing.
  • Settled on the user’s delegation 2026-11-19 (built on branch regex-sendable, a gap the concurrent-program ports met): a compiled Regex, its Pattern and a Match are sendable, and each class declares : Sendable, so a change that makes one hold something mutable fails to compile in the library rather than in a program. A MatchIterator stays not sendable: it is a search in progress. How: a compiled program’s operations, a literal’s characters and a branch’s alternatives are ArraySeqs, filled once at compile time; a character class’s test is a @sendable (int) -> bool, so every closure that builds one is checked to capture only sendable values (a class’s table of the first 256 characters is copied into an ArraySeq); and a class’s answers for the characters below 128, an array of 128 bools, are two longs of bits, which is no slower and holds nothing mutable. Each search already kept its own state (the engine’s groups, locals and backtracking stack), so no search allocates more than before. A Match holds its group offsets as ArraySeqs, which costs one copy of two small arrays per Match made; split no longer makes a Match per piece at all. Why: a pattern compiled once at module level and used from every worker is the ordinary way to write a concurrent scanner, crawler or server, and an immutable value that cannot be shared reads as a defect. Alternatives: compiling a regex per thread (what the port had to do; wasteful and easy to miss); a @sendable field marker trusting the library (no check would keep it true); making the core library’s frozen array type reachable from avin.regex (saves one load per operation dispatched but widens what the core module shares; ArraySeq is the public form of the same thing). Review with the user: whether the one extra load per dispatched operation through ArraySeq is worth a library-internal way to name a frozen array outside the core module.

  • Settled on the user’s delegation 2026-11-09: Union types: the rules beyond the user’s five points (branch unions-design; union types).

    • Precedence: | binds tighter than -> and looser than everything else in a type, so (A) -> B | C returns a union and a union of functions parenthesizes each. Why: a function returning one of several results is far more common than a union with a function member, and -> is already the loosest type operator. Alternatives: | looser than -> (makes the common case need parentheses); refusing the unparenthesized form (noisy).
    • A union in a type pattern is parenthesized, x: (int | string) ->; a | in a pattern is always an alternative, and x: int | string is reported with the parenthesized form. Why: it keeps one meaning for | in patterns, as function types already need parentheses there. Alternatives: parsing a type after : greedily (makes _: A | _: B mean something else).
    • Normal form: flatten, order irrelevant, a member that converts to another member (by subtyping or boxing into a trait or Any) absorbed, Nothing absorbed, one member is that member. Written by hand, a duplicate, absorbed or Nothing member is an error naming the type to write; arising through an alias or type argument it is absorbed silently. Why: T | int at T = int and T | Animal at T = Dog must compile, while Dog | Animal written out is almost certainly a mistake. Absorbing by conversion rather than subtyping alone keeps every injection unambiguous (int | Display would otherwise leave an int two homes). Alternatives: keep subsumed members distinct (two homes for one value, an ambiguity on every injection); refuse at instantiation too (breaks generic code); silently absorb written duplicates (hides mistakes). Review with the user: whether written duplicates should be errors or warnings.
    • Inference carries a union it is given and never forms one: val u2 = u is the union; a union and its member join to the union; T in x: T | string takes the members the argument leaves over (orText(u) with u: int | bool | string gives T = int | bool); a member argument decides no T. Why: anything less makes unions unusable in generic code; forming one would be the inference the user ruled out. Alternatives: refusing to solve T against a union (forces explicit type arguments everywhere).
    • Injection at a single site, like boxing: a member’s own type first, else the one member it converts to, several an error naming them; a literal takes its default type where that is a member, else the one numeric member it fits; None/Ok(x)/an empty literal go to the one member that is an instance of their type. Why: mirrors how a value becomes an Any, and never guesses. Alternatives: choosing the first member written (order would then matter, contradicting the normal form).
    • Overloads: a member type is more specific than a union containing it; a union more specific than a type every member converts to; a union argument never chooses among member overloads (an error suggesting a match). Why: overloads are resolved statically (settled 2026-11-02). Alternatives: generating a dispatch match over member overloads (dynamic overloading, which the language does not have).
    • A named function is adapted where written to a function type whose parameters inject into its union parameters (val f: (int) -> string = describe); a function value already made is not. Why: the same single-site rule as @sendable references. Alternatives: always requiring a lambda (a contortion for the common case).
    • Representation: a union whose members are all types an Any holds without a box is laid out as an Any (one pointer, the header as the tag); one with a scalar member is a tag, a bits slot and, if any member is a reference, a separate pointer slot. Consequently variance through containers holds exactly where the layouts agree: List[Dog] <: List[Dog | Cat], Result[T, IoError] <: Result[T, IoError | ParseError], but not List[int] <: List[int | string]. Tag numbering follows the normal form, and the layout is decided before optimization, so -O0 and -O2 agree. Why: reference unions cost nothing over Any and keep ?‘s common case free; scalar unions avoid an allocation per value; the separate pointer slot keeps the collector’s roots exact. Alternatives: every union boxed as an Any (simplest, but int | long allocates); every union a tag-and-payload value (no variance through containers, a conversion for every Result of a wider error); one overlapping payload word (needs tag-aware root scanning). Review with the user: the variance consequence is visible to programs.
    • match: type patterns, supertypes and sub-unions cover members; any other pattern applies to the one member it can match (0 and n < 0 on an int | string reach the int), and one more than one member could match is an error; a type pattern naming no member is an error; in generic code the match is checked as written and, at an instance where members come together, the first arm in order wins. Why: lets literals and constructors reach their member without a nested match, without guessing. Alternatives: type patterns only, as on an Any (verbose).
    • is binds, it does not narrow: v keeps its union type after if v is _: string; the pattern binds a name. Why: the settled is scoping (2026-11-03) has no flow-sensitive typing, and unions should not introduce it. Alternatives: flow narrowing of the tested variable (a new, language-wide mechanism). Review with the user.
    • What a union can do: == and hashing as two Anys holding the values; === only where every member is a class or function type; a union conforms to a trait every member conforms to whose methods take Self only as receiver (Display, Debug, Hash, a library JsonEncoder), plus Eq and Sendable member-wise, never Ord; a member call is looked up on the members’ join and on those traits, ambiguity an error. Why: printing, hashing and calling a shared superclass method are what a union is used for; Ord would need an order between members that order-free unions cannot give. Alternatives: refusing every member call (forces a match just to call a method every member has); any method name every member has, structurally (breaks the nominal principle, and its result would be an inferred union). Review with the user.
    • ? with unions: (1) E converting to F (a member, a member’s subtype, a union of members) passes on unchanged; (2) for a union F, the one member implementing From[E] converts; (3) for a union E and a plain F, each member converts on its own; (4) otherwise F.from(e) as before. ? never adds a member. Why: unions replace hand-written wrapper error types without breaking the From rule existing code relies on. Alternatives: a union F consulting no From (loses the bridge from wrapper errors); inferring the error union from the ?s in the body (the inference the user ruled out).
    • Refused: impl or extension on a union; a union as a parent or as an upper bound (a lower bound is allowed); a union across @sysl/@c declarations and mirrors; a with { … } field path through a union field; casts, calls and construction of a union. Why: each needs a declared type or a C/Sysl layout a union does not have. Alternatives: shims that pass a tag and payload across a binding (no Sysl or C library takes one).
    • Chapter: a chapter of its own, spec/unions.md, linked from types, generics, errors and match. Alternatives: a section of types.md (too long for one section).
  • Settled on the user’s delegation 2026-11-09 (branch unions-core): Union types: the choices the core’s implementation made (union types).

    • Every union is laid out as an Any for now, a scalar member in a box. The chapter’s tag-and-payload layout for a union with a scalar member needs values of more than one machine word in the compiler’s intermediate code (parameters, results, fields, array elements, closure captures), which nothing else in the language has; the core ships without it. The type rules stay the chapter’s, so programs do not change when the layout lands: List[int] is still no List[int | string], and a union of references still nests in covariant containers. Why: one layout makes every part of the core correct now (exact roots, -O0 and -O2 alike, equality, hashing and rendering through the Any machinery), at the cost of a box per scalar injected. Alternatives: building the multi-word value first (holds every other part of the item); a single tagged word (cannot hold a long and a pointer apart, so roots would not be exact). Review with the user: the allocation per scalar injection until the layout lands.
    • A copy of generic code at a union type argument is a copy of its own, so a type pattern naming the parameter tests the union’s members, t: T at T = int | bool taking neither a string nor anything else. Through a method called by its table, the type argument is still taken as Any. Why: a function’s copies are keyed by their type arguments, and the union is one; a method’s table slot is shared by every receiver. Alternatives: erasing every union type argument to Any (a T arm would take every value).
    • Members that come together through a type argument are merged when they are the same type, and a member a subtype of another is kept, injection choosing the widest. T | int at T = int is int; T | Animal at T = Dog keeps both members in the type, and a Puppy given to it is the Animal. Why: substitution is done where the class table is not at hand; the two forms hold the same values and match the same way, and only a message names the difference. Alternatives: absorbing subtypes at every substitution (needs the declarations at each one).
    • x: int | string in a pattern is recognized as a type pattern followed by bare names that are no variants, and reported with the parenthesized form; any other alternatives are checked as written. Why: a bare name is a binding, which alternatives refuse anyway, so nothing legal is taken from the program. Alternatives: deciding it in the parser (cannot tell a variant from a type there).
    • A | after a type is a guard, not a union member, where the name after it is followed by an operator no type is followed by (a comparison, arithmetic, &&, ||, !, is), so f(n: int) -> int | n > 0 = n is still reported as a guard on a signature. Why: keeps the existing clause diagnostics. Alternatives: refusing | after a result type outside brackets.
    • Messages the chapter left open are those of what is refused and these: a pattern several members could match names them and suggests a type pattern; None, Ok(…), a collection literal or a lambda with several members of its kind names them and asks for the type meant; a literal several numeric members fit names them and suggests a conversion, as in byte(3); two arguments of one type parameter that agree on no type add that a type argument is never inferred as a union, with the union to write; a missing clause names the member, as in size(_: string). Why: each says what to write. Alternatives: the generic messages, which name no member.
  • Settled on the user’s delegation 2026-11-10: Union types: the operations’ choices the chapter left open (branch unions-ops; union types).

    • ? converts an error union member by member whatever the function’s error type is, not only where it is no union: an IoError | ParseError passed on from a function yielding ConfigError | Invalid, where ConfigError implements From at each, converts each member by rule 2. Why: rules 1 and 2 cannot reach this case (no member implements From at the union), so rule 3 as written would leave it an error with no way to say what to do but mapErr, while each member converts on its own; the extension only turns an error into the conversion a reader expects. Alternatives: keep rule 3 for a plain F only (refuses an obvious program); implement From at a union (a union has no impl).
    • A trait with type parameters counts for a union through the one instance every member holds: Vector[int] | List[int] has Seq[int]‘s methods, so u.size() and u.map(…) work although the two join on no type. Why: the chapter’s rule (“the traits the union conforms to”) names no restriction to traits without parameters, and the instance is unambiguous when the members agree on it. Alternatives: only traits without type parameters (refuses the common sequence case); every instance any member holds (ambiguous).
    • A member of the union found through a trait or the join is called, named as a value or read as a field with the union seen as that type, with no conversion, as an Any holding its member is seen: a field of the join class is read (p.called on Puppy | Kitten). Why: the union is laid out as an Any, which already is a value of every trait and class its member is; the field is the chapter’s “looked up where it would be on the members’ join”. Alternatives: methods only (a field of the shared superclass would need a match).
    • === between a union with a value member and an object of a class is accepted, answering false for a value member, as it is between an Any and an object; it is refused where neither side holds only objects (Dog | int against an Any). Why: the identity chapter’s rule for Any, which the union chapter says the union follows. Alternatives: refuse every === on a union with a value member (stricter than Any, with no added safety).
    • The diagnostics’ wording: a union argument to overloads of its members says the member is known only while running and suggests a match; a bound a union misses says why (no order; the member that does not conform; a trait taking Self other than as the receiver); a result with a scalar error union names mapErr(e -> e). Why: each names the fix. Alternatives: the general messages alone.
  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-sockets): a socket wait parks on one poller with a thread of its own, one readiness report per wait. Every socket avin.net makes is non-blocking; an operation that would have to wait registers the descriptor with the runtime’s single sysl.io.poll set as OneShot, under a token naming a slot that holds the waiter, and parks; the poller’s own operating system thread waits on the set and makes each reported waiter ready, and the operation is tried again. A slot is let go under one lock by whichever ends the wait, so a report arriving after a timeout finds its slot gone or taken again under a newer token and wakes nobody. Why: the monitor sleeps on a condition, which a kernel set cannot wake, and a thread blocked in the set’s wait needs nothing else; a one-shot registration per wait can never deliver a stale wake to a later wait on another thing. Alternatives: the monitor waiting on the poller with the soonest timer as its timeout (the timers then move under the poller, a larger change to settled code, which this choice does not preclude); workers polling the set between threads (no extra thread, but a worker with nothing ready then sleeps in the kernel instead of on its condition, and wakes need a second path); a level- or edge-triggered registration kept for the socket’s life (one system call less per wait, but a report for a wait that has ended can reach the next one, so every wait in the runtime would have to tolerate spurious wakes).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-sockets): a connection’s timeout bounds each wait, not the whole operation. A write that waits for room several times fails with TimedOut only where one wait outlasts the limit, as the kernel’s per-call socket timeouts did before; the limit is kept in the connection rather than in the socket, since a non-blocking socket ignores the kernel’s. Why: a large transfer to a slow but steady peer keeps going, and the meaning of setTimeout does not change. Alternatives: a deadline for the whole write or readAll (stops a slow transfer that is still making progress). Review with the user if a whole-operation deadline is wanted as well.

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-sockets): connect parks; a Unix connect does not. A TCP connection that cannot be made at once waits for the socket to become writable, then reads the socket’s pending error (SO_ERROR) for the outcome, since a second connect answers “already connected” even for a refused connection on macOS. A Unix connection is made at once by the kernel or refused, so it stays a plain call and the socket is made non-blocking after. Alternatives: a blocking connect that the monitor compensates for (holds a worker for a round trip to the peer).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-sockets): a connection or listener cannot be closed under a thread parked on it. It belongs to the parked thread, so another thread’s close() traps as any other use from there does, and the wait ends only by the peer, a timeout or readiness. Why: the ownership rule already decides it, and no wake path for a socket closed elsewhere is needed. Alternatives: a shared close that wakes the parked thread with an error (needs sockets shared between threads, which the ownership rule excludes; cancellation by scope is where an outside end of a wait belongs).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-ui): Other threads reach the interface through inboxes and post, run by the main thread from one queue (User interfaces). inbox(handle) is made on the main thread; its handler, which may capture State, stays there; the Inbox[T, R] is sendable, with send(m) -> Future[R] and ask(m) -> R. post(@sendable work) queues work with no answer. Every message and post waits in one queue, so one thread’s order holds across inboxes. Why: the interface’s state is not sendable and must not become so, so the code that touches it has to be made on the main thread and only a sendable message may cross; a future for the answer reuses what already parks a lightweight thread. Alternatives weighed: post alone (a sendable closure cannot reach a State, so it could not change the interface); a sendable State behind a lock (every build would lock, and a write from another thread would race the build); an actor for the interface (the frame loop owns the thread, so a mailbox would still need this queue); a queue for each inbox (loses one thread’s order between two inboxes).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-ui; moved to on_frame on branch binding-f32, which rests on the Proposed f32 entry): The frame loop runs the waiting work in syslui-sdl’s on_frame, at the start of every frame and before the loop decides whether to build the tree again, so work posted before a frame runs in that frame and what it writes is built in it; run runs what is left once more as it returns. The package’s binding of app is named (branch binding-defaults, see the Proposed named entry), so it passes on_frame and leaves on_event, font and size, which come before it, to syslui-sdl’s own defaults; until then it copied those defaults into Avin, since a binding passed its arguments by place. Why: on_frame is the hook syslui-sdl runs first in a frame for exactly this. Alternatives weighed: a wrapper of ground, which lwt-ui used while no real could cross into an f32 (run after the tree, so its work was built a frame late); tree (called only when something was written, so it would never notice a post); on_event (called only when there are events).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-ui): handlePosted runs only what was waiting when it was called. Work that sends or posts waits for the next call. Why: work that posts itself again, a common animation shape, would otherwise hold a frame for ever. Alternatives weighed: draining until the queue is empty (simpler, but unbounded).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-ui): An ask on the main thread stops the program; a send or post there is queued. Why: the main thread handles the message, so its own wait would never end; a trap names the mistake where a hang would not. Alternatives weighed: handling the queue up to the message at once (re-enters a handler that asks, and runs work out of frame order).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-ui): Making an inbox, handlePosted and run are the main thread’s alone, refused at compile time from code for another thread because they reach the package’s module-level state, and checked again at run time with isMainThread() (a new function of avin.threads, answered by the runtime from the calling context). run on another thread stops the program before any window is opened. Why: a window on a thread other than the process’s first never shows on macOS, and a handler made on another thread would run on the main thread with that thread’s values. Alternatives weighed: answering Err from run (a mistake in the program, not a condition it can handle); moving run to the main thread silently (the caller’s wait for its result would be the same hang).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-ui): An inbox lasts as long as the program, and work still waiting when main returns is dropped. Why: inboxes are made once, as a window’s state is, and the program ends when main returns whatever its threads are doing. Alternatives weighed: closing inboxes (needs a lifetime the interface does not have yet); running the queue at exit (runs interface code after the interface is gone).

  • Settled on the user’s delegation 2026-11-19 (built on branch main-lwt): Threads pinned to the main thread, on a main scheduler of its own (Threads, User interfaces). What was missing: code on the main thread could not wait for a future, a channel or an ask without blocking the frame loop, so a handler had no way to fetch something and then set a signal. spawnOnMain(body) (and a scope’s spawnOnMain) starts a lightweight thread that runs on the main thread only; it parks as any thread does, whatever wakes it puts it on the main scheduler’s ready queue, and it carries on on the main thread. Its body is not checked as sendable and runs as the main thread’s owner of Sysl handles, so it reaches the interface’s state; only the main thread starts one (a worker that tries stops the program). isMainThread() answers true in it; isPinnedToMain() tells it from the main thread’s own code, so an ask there parks rather than trapping, and run there traps.

    • How the loop drives it: once a frame, from handlePosted, which runs runMainThreads() after the messages and posted work; and the main thread’s own waits (lock, condition, join, channel, future, select, sleep) run pinned threads as they become ready, a ready one waking the blocked main thread. syslui-sdl’s loop polls every frame, so no wake source is needed.
    • With no window: the same, so a plain main joining a pinned thread runs it, and a loop of its own calls runMainThreads().
    • Order against posted work: posted work and messages first, in the order sent, then the pinned threads ready by then, each once, in the order they became ready. A pinned thread that posted work makes ready runs in the same call; one another pinned thread makes ready runs at the next, which bounds a call as handlePosted already is bounded.
    • Cancellation and deadlock: a scope’s spawnOnMain is cancelled with the scope, as its other threads are; the deadlock check counts a ready pinned thread as work, and its report marks each pinned thread pinned to the main thread.
    • A pinned thread parked when run ends stays parked and runs whenever the main thread next runs the main scheduler; when main returns it is dropped, as every thread is.

    Why: the interface’s state belongs to the main thread, so the code that waits and then touches it has to run there; a lightweight thread pinned to it reuses everything that already parks and wakes a thread, and the main thread stays the only one that ever touches the state. Alternatives weighed: await inside a handler, which runs on the main thread’s own stack (it would have to block the frame or re-enter the loop from inside the handler); running every posted piece of work and every message as a pinned thread, which would give one order for all of it and let any handler wait (a stack for every message, the common case paying for the rare one, and a handler’s answer coming frames later); a wake source the loop waits on, the runtime’s poller descriptor or a run-loop source on macOS (needed only by a loop that sleeps when idle, which syslui-sdl’s does not); letting runMainThreads from a pinned thread run the others (nested switching on the main thread’s stack for no gain); a body checked as sendable (could not reach a State, which is the point); time-slicing pinned threads (they share the main thread with the frames, which no slice makes fairer). Review with the user: the order of a pinned thread’s resumption against posted work (posted first, per frame, not one interleaved order) and the name spawnOnMain.

  • Settled on the user’s delegation 2026-11-10 (built on branch binding-f32): A real crosses into and out of any Sysl floating-point type that rounds: f32, f16, bf16 and real. A binding’s own real parameter, a mirror’s real field going into Sysl, and a callback’s real answer are rounded into the Sysl type to the nearest value it holds, a tie to the even one, as an IEEE conversion rounds: a value past its largest becomes an infinity of its sign, one below half its smallest subnormal a zero of its sign, a NaN stays a NaN, and nothing stops the program. A real result, a mirror’s field coming out, a callback’s parameter, and a real an Option, a Result, a tuple or a collection result holds are widened exactly. A real inside a parameter’s Option, tuple or collection is passed as real only, as an integer there is passed as its declared type. A binding’s own real is passed as it is first and rounded only where Sysl refuses a real there (the shim is built again), so a Sysl function overloaded at real and f32 (sysl.math.ulp) is called at real, unrounded, and a generic one takes the real itself. A real is not made from an f128 (its arithmetic is not sysl.math.Float; Sysl widens a parameter into one itself), nor from any non-floating type. Why: Avin has one floating type, and a graphics or audio library’s f32 (syslui-sdl’s size, a canvas’s coordinates) is what a binding meets; rounding is what every conversion between floating widths does and the only one that keeps every f32 value exact on the way back. It mirrors how an integer crosses into any Sysl integer. Alternatives weighed: an f32 type in Avin (a second floating type in every arithmetic rule, for the boundary’s sake); trapping where the value does not fit (a rounding is not an error, and an infinity is a legal f32); converting a real held inside a parameter’s option or collection too (integers are not converted there either, and the copy would be written element by element); rounding every real parameter at once (an overload at f32 would then be chosen over the one at real, losing precision silently). Review with the user whether a real into an f32 should trap on overflow to infinity rather than round to it.

  • Settled on the user’s delegation 2026-11-10 (built on branch binding-defaults): A binding marked named (@sysl("f", named)) passes every argument by its parameter’s name, so a parameter it leaves out takes the Sysl function’s own default. The Avin name is spelled as Sysl spells it, each uppercase letter an underscore and its lowercase, as a mirror’s fields are (onFrame is on_frame); the binding lists the parameters it passes in any order; the receiver of a handle’s method is never named; every parameter of a named binding has a name. A binding without named passes by position, as before. Sysl checks the names and reports a missing parameter without a default, or a name it does not declare, with its own message at the binding. Why: a binding that had to reach a parameter behind defaulted ones copied the Sysl defaults into Avin (the ui package copied syslui-sdl’s font and size and reached a private handle for on_event‘s default), and those copies go stale silently; with names, Sysl supplies and evaluates its own defaults at each call, a non-literal one included. One word on the annotation, decided per binding, changes no existing binding’s shim and needs no knowledge of the Sysl signature in the Avin compiler. Alternatives weighed: caller-side omission, where an argument an Avin caller leaves out of a binding’s call is left out of the Sysl call too (most general, but a binding would need a shim for each set of omitted arguments its callers use, and Avin’s own defaults on a binding would mean two things); a per-parameter mark such as @named or a = sysl default on a positional list (the binding still lists every parameter up to the last one it passes, and a mixed call needs the names anyway); naming every binding’s arguments always (would make every existing binding’s parameter names part of its contract with Sysl); copying the defaults (the stale copies this replaces). Review with the user: the surface word named, and whether a caller-side form should come later.

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-scope): Cancellation by a scope stops a thread and drops its frames (cancellation). s.cancel() cancels the scope’s threads, and those it starts afterwards (which run nothing); a cancelled thread stops at its next cancellation point with its frames dropped and ends with no result: Thread.result() -> Option[T] (new) answers None, and join traps. The cancellation points are every wait but a lock’s (sleep, join, condition, so channels, futures and promises, and a socket’s wait for its descriptor) and every safepoint poll. A socket’s wait is ended inside the runtime’s Sysl code, which may not drop its own frames (they hold the socket), so it fails the operation and the library stops the thread as soon as the operation has returned to it; no caller ever sees that failure. Why: Avin has no exceptions and a trap stops the program, so a cancellation that made each wait answer an Err would change the type of every wait in the library and leave a computing thread unreachable; the runtime already drops an actor’s frames on a trap, and a thread shares nothing mutable outside a lock, so dropping its frames loses nothing anyone else can see. Alternatives weighed: every wait answering an Err or Option (the direction first sketched; changes every signature, and a loop that never waits is never cancelled); a cooperative flag the thread polls (a thread that forgets to look is never cancelled, and parked threads still need waking); a trap at the next wait (stops the program). Review with the user: join trapping on a cancelled thread rather than answering an Option, which keeps every existing join unchanged.

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-scope): A thread is not stopped inside a region others may wait on: a lock held, a lazy val being initialized, an Avin function Sysl called (the regions a trap already treats as in doubt), and the library’s running of what waits for a future it completed. It finishes the region and stops at its next cancellation point after. A wait on a condition is a cancellation point when the lock it lets go is the only region the thread is in; the thread then stops without taking the lock again. Waiting for a lock is not a cancellation point. Why: a mutex is the only door to shared mutable state, so a thread stopped outside every lock leaves nothing half changed, and never leaves a lock held; a lock is held briefly, so making its wait a point would buy little and race the hand-over of the lock. Alternatives weighed: stopping anywhere and releasing the locks a thread holds (leaves the state they guard half changed); making the release of the last lock itself a cancellation point (cuts library code short after its release, as a future’s completion is).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-scope): Cancellation reaches down through scopes, and only scopes. A cancelled thread stops first at the innermost scope it runs, which cancels its own threads and waits for them, and the cancellation then goes on outward; a scope opened while its thread holds a lock sets no such stop, so its threads are not cancelled with the thread. Threads started with the plain spawn, and futures’ work, are not reached by any scope’s cancellation. Why: structured joins hold only if a scope never returns before its threads, cancelled or not; unstructured threads have no owner to be cancelled by. Alternatives weighed: cancelling the thread alone and leaving its inner scope’s threads running (breaks the scope’s promise); a Thread.cancel() on any thread (unstructured cancellation, which nothing here needs).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-scope): A failure does not cancel a scope by itself. A trap stops the program as before, so there is no failing thread to propagate; a thread reports a failure as a Result, and the scope’s body cancels and returns it. Scope gains cancel() and isCancelled() only, both used by the thread running the body while the scope is open. Why: the body already sees every thread’s result and decides what a failure means; a scope that inspected results would need to know their type is a Result. Alternatives weighed: a scopeTry whose threads return Result[T, E] and whose first Err cancels the rest (a second entry point for what a channel and a cancel express); a sendable canceller a thread could call (the body can already cancel on a message). Review with the user: whether a Result-aware scope is wanted for brevity.

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-scope): The scope hands back the Sysl handles a cancelled thread’s body reached, once it has waited for the thread, as a body that returns hands them back itself; they are then in transit, for the next code to use. Why: a connection given to a thread that was cancelled is otherwise unusable by anyone, and closing it is the scope’s thread’s job. Alternatives weighed: leaving them with the ended thread’s owner (every later use traps); handing them back on the cancelled thread as it stops (it runs no code of its own then).

  • Settled on the user’s delegation 2026-11-10: Actors’ turns on lightweight threads (branch lwt-actors, scheduling). An actor on the shared executor, the default, runs each turn as a lightweight thread of its own, started with a thread’s default stack (8 MiB reserved, committed as touched, reused from the scheduler’s spares) and handing nothing over, the turn making the actor the owner of its code; a turn that waits parks, and one that computes is time-sliced. An actor given an executor of its own keeps running its turns as tasks on that executor’s workers, so Executor.fixed(n) still bounds how many work at once and the 16-message fairness among its actors stays exact. To tell the two apart, Executor.shared() now gives back the same executor every time, compared with ===. Why: a turn as its own thread is what makes a sleeping or awaiting turn free its worker; the shared pool counts a worker that sleeps or receives from a channel as working, so its few workers could all be held by waiting turns. An explicit executor is a request for a bound, and keeping it keeps every program that asked for one behaving as it did. Alternatives: one long-lived lightweight thread per actor, parked on an empty mailbox (a committed stack page or more for every idle actor, and a parked thread for each of a hundred thousand actors); every turn a thread of its own whatever the executor (drops the bound Executor.fixed(n) asks for, and the actors_fairness/actors_waiting behaviour on one worker); spawn‘s executor as an Option[Executor] = None (breaks the positional spawn(b, Stop, ex)); a public Executor.isShared() (more surface for one library’s need). Review with the user: whether an explicit executor should still bound an actor once every turn could be a thread.

  • Settled on the user’s delegation 2026-11-10 (built on branch train-2): A scope’s cancellation does not reach actors (cancellation, scheduling). An actor started by a scope’s thread is a top-level actor and runs on when that thread is cancelled; an actor’s turn, a lightweight thread started as a plain thread is, is never cancelled by a scope, though the scopes it runs cancel their own threads. The waits a turn makes need nothing of their own: a turn waits only in the library’s waits (a future’s await, so an ask; a sleep, a channel, a condition, a socket), every one already a cancellation point for a thread that can be cancelled. An asker cancelled in an ask‘s await leaves its question in the actor’s mailbox, handled in its place among the messages told, and the reply completes a promise nobody awaits, which also takes the ask’s timer out. Why: cancellation reaches down through scopes and only scopes, and an actor is owned by its parent actor or by nobody, never by the thread that happened to start it, so tying its life to that thread’s scope would make where an actor is spawned decide when it ends; cancelling a turn would stop an actor halfway through a message, leaving its fields half changed with no lock to guard them, and break one turn at a time. Alternatives weighed: stopping the actors a cancelled thread started (structured actors, which the actor tree already provides through parent actors); taking a cancelled asker’s question back out of the mailbox (needs a mailbox that removes from its middle, and the actor may already be handling it); making a turn cancellable by the scope that told it a message (a message has no owning scope).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-server): the server library is in the standard library, as TcpServer in avin.net and http.serve in avin.net.http, not a package and not a module of its own. Why: the TCP connection and the HTTP client it builds on are there already, the server shares the client’s Response and token rules, and it is the first user of the runtime’s poller and, later, of scope cancellation, which tie it to the compiler’s release. Alternatives: a package dev.avinlang.http (versioned apart, but it would duplicate the client’s types or depend on the standard library’s privates); a module avin.net.server (one more import for the one type). Review with the user if a larger web framework is wanted later: that belongs in a package on top.

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-server): each connection is served in an actor’s first turn, supervised with Stop, rather than on a plain lightweight thread. Why: a trap in a thread stops the program, and an actor is the only place a trap is contained; a connection’s handler is the place a server most needs a bug to cost one connection. The actor’s first turn runs the whole connection and the actor stops after it; an onStopping given before the connection is served runs failed (which writes the 500) and closes it, since a stopping block is given only after the body has run. Alternatives: a lightweight thread per connection (a handler’s trap stops the server); an actor per request (a mailbox and a turn per request, for no gain).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-server): the connections’ actors run on an executor of the server’s own, Executor.fixed(maxConnections). Why: a connection’s turn parks on its socket for as long as the connection lives, and on the shared pool, about one worker per processor, those parked turns would keep every other connection waiting for a worker; the workers are lightweight threads, so a worker per connection costs a parked stack each. Once actors’ turns run on lightweight threads of their own (stage 14, item 5), the executor may go. Alternatives: the shared pool with each wait in blocking (a trap inside blocking leaves the worker counted as waiting for good).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-server): at the connection limit, the next connection waits unaccepted in the listener’s backlog until one ends, rather than being accepted and refused. Why: the client is served late instead of not at all, and the server spends nothing on it meanwhile. Alternatives: accept and close at once, or answer 503 (a burst turns into failures the client must retry).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-server, reworked on train-2): stop() cancels the acceptor’s parked accept, which waits on a thread of a scope the acceptor runs; the acceptor’s own thread then closes the listener. No connection is made to wake it. (lwt-server first woke it with a connection of its own to the listener, the one thing that could end a parked accept before scope could cancel a wait.) Why: a listener belongs to the thread parked on it, so no other thread may close it, and cancellation ends a wait where it is parked without a connection the server would accept and drop, a descriptor per stop, or a host to reach itself on (127.0.0.1 for 0.0.0.0). The API of stop, join and shutdown does not change. Alternatives: the waking connection (kept until cancellation landed); an accept with a timeout polled for the stop (a delay of up to the poll, and wake-ups for nothing); a listener closable from another thread (against the ownership rule).

  • Settled on the user’s delegation 2026-11-10 (built on branch train-2): a shutdown closes a connection idle between requests at once, unanswered, and a request read once the server is stopping is answered 503. The HTTP server waits for each request, its first included, through TcpServer.idle, so stopping cancels that wait; a request being read or answered finishes, its response saying Connection: close. (lwt-server let an idle connection run to its idle limit, answering 503 to a request arriving meanwhile, since nothing could end the wait from outside.) Why: an idle connection has nothing in flight, so closing it loses nothing, and join no longer waits up to idleTimeout, or for ever where it is zero. Alternatives: idle connections ending at their limit (a slow shutdown); serving requests on connections already open (a chatty client keeps the server up for ever).

  • Settled on the user’s delegation 2026-11-10 (built on branch train-2): a shutdown reaches a connection’s actor through TcpServer.idle, a scope the actor’s turn runs around each idle wait, not a scope around the turn. idle(wait) registers the wait with the server, runs wait on a thread of a scope opened by the calling thread, and parks that thread on a promise that the wait completes false once it answers and stop() completes true for every registered wait; on true the scope cancels the wait. Its result is Some of the wait’s answer, or None where the server stopped first, and None at once, wait not run, where it was already stopping. The acceptor’s accept goes through the same path, so what follows an accept (counting the connection, starting its actor) runs on a thread nothing cancels. Why: a scope’s cancellation does not reach actors, and an actor’s turn is never cancelled (settled for train-2 above), so the server cannot cancel a turn; it can only cancel a scope the turn runs, and cancel must be called by the thread running that scope’s body, which is why the turn parks on the promise and cancels itself. Only the wait is cancelled, so code answering a request, and a trap in it (which fails the connection’s actor alone), stay on the turn. A promise per wait and a registry keyed by number wake only the waits that exist, not every connection on every request. Costs: a scope and a lightweight thread per idle wait, and a Vector copy of each read the HTTP server makes there, since a wait’s result must be sendable; a trap in wait stops the program, as a trap in any thread does. Review with the user: it adds idle to TcpServer‘s public API, the one way a protocol on it tells the server which waits a shutdown may end. Alternatives: the connection’s whole serve on a scope’s thread with the turn watching it (a trap in serve would stop the program instead of failing the actor, and a request in flight would be cancelled with it); a server-wide condition notified when any wait ends (wakes every idle connection per request); shutting down the read side of idle sockets from the stopping thread (not cancellation, and a socket belongs to the thread that uses it); a per-connection server handle carrying an idle flag (the same cancellation, plus a race between the flag and the wait’s answer).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-server): HTTP limits and refusals. Timeouts bound each wait, as a connection’s do: readTimeout while a request is read (408 once one runs out mid-request, and a quiet close where a connection sent nothing), writeTimeout while a response is written, and idleTimeout between requests; maxHeaderBytes (16 KiB) bounds the request line (414) and the head and a chunked body’s trailers (431); maxBodyBytes (1 MiB) bounds a body by its length before it is read, or as chunks arrive (413). A request with both Content-Length and Transfer-Encoding, two lengths that differ, a coding list not ending in chunked or a header folded onto a second line is 400, and a coding besides chunked 501. Every refusal closes the connection after shutting its side and reading what the client still sends for half a second, so the answer is not lost to a reset. Why: RFC 9112’s choices where it gives the server one, and per-wait timeouts keep one meaning for “timeout” across the library. Alternatives: a deadline for the whole request (stops a slow upload still making progress; review with the user if wanted beside the per-wait limit); decoding gzip request bodies (a dependency for a rare case).

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-server): a Response is the client’s class, given makers (Response.text, bytes, empty, withHeader) and http.reasonPhrase; a handler is a plain @sendable (ServerRequest) -> Response; routes are a vector given to Router(routes), made by Route(method, pattern, handler) or Route.get and its siblings, and router.handle is the handler. Why: one response type for both sides; a vector literal spans lines, where a builder’s chain of .get(…) cannot, since a line starting with . does not continue the one above. The server writes Content-Length and Connection itself and refuses (traps on) a status outside 200 to 599. Responses are whole bodies; a streamed (chunked) response is later work. Alternatives: a builder Router().get(…) (a chain on one line, or a var reassigned); a response writer handed to the handler (streaming, but a handler that forgets to finish it). Whether a line that starts with . should continue the expression above, left for review here, is answered under Proposed: it does, so a builder’s chain may now span lines.

  • Settled on the user’s delegation 2026-11-10 (built on branch lwt-server): routing: segments matched one for one with the request’s decoded segments, :name binding a non-empty one, the first matching route winning; a GET route answers HEAD; 404 for a path no route matches and 405 with Allow for one matched for other methods. Why: the smallest router that covers a service’s paths, with escaped and raw Unicode routing alike and an escaped / staying inside its segment. Alternatives: wildcards for the rest of a path and patterns in a segment (later, if programs need them).

  • Settled on the user’s delegation 2026-11-11 (designed on branch incremental-design): Lowering is made cheaper before anything is cached: the build plan fixes tuple records (a tuple’s ancestors listed as the product of its parts’ traits, each with its own entries: 33,858 of marshal’s 71,646 functions) and lowering’s constant factors first. WHY: lowering is 75 to 80% of an edit’s rebuild and most of it is that defect; a cache built first would key and store tens of thousands of instances no program needs, and its measured win would be the defect’s. Alternatives: cache first and fix after (stores the waste and measures the wrong thing); fix only (an edit still lowers the whole program).

  • Settled on the user’s delegation 2026-11-11 (designed on branch incremental-design): The unit of reuse is the instance, grouped a file per source module; the front end stays whole-program and uncached. WHY: monomorphization makes the instance, not the module, the thing whose code exists, and closed-world passes decide per call site; checking marshal is about 4 s of a 65 s rebuild, and the checker numbers every symbol of the program by index, so caching its output per module is a rewrite, deferred until a measurement says the front end is the larger part. Alternatives: per-module object files with generic code emitted where it is used (duplicates instances across modules and loses closed-world devirtualization); a cache of the checked front end per module first (targets 6% of the time); whole-program LLVM text cached by the program’s hash (only helps an unchanged program, which the executable record already does).

  • Settled on the user’s delegation 2026-11-11 (designed on branch incremental-design): An instance’s key is its identity spelled by qualified names, its typed body printed canonically, the layouts and records it reads, and the world facts the whole-program passes used on it, beside the compiler’s stamp, level and kind. WHY: the printed typed tree carries every resolution and inference the checker made, so a change elsewhere that alters what the body means alters its key without a dependency graph of the source; world facts per call site let a new implementing class rerun the passes on its callers without lowering them again. Alternatives: the declaration’s source text plus the hashes of the modules it imports (misses inference changes through a callee’s result, and invalidates on every unrelated change to an imported module); one hash of the whole program’s world for the passes (any new class reruns every pass on every instance).

  • Settled on the user’s delegation 2026-11-11 (designed on branch incremental-design): Emitted names are stable: a string by its content’s hash, a descriptor or record by its type, a closure or trap site by its function and place, the module-level tables in a codegen unit of their own. WHY: today’s numbering by discovery order lets one new instance renumber the rest, which changes every unit’s text and defeats both caches. Alternatives: keep the numbering and patch indices at emission (every reused text rewritten anyway); number per module (still moves when a module gains a string).

  • Settled on the user’s delegation 2026-11-11 (designed on branch incremental-design): The instance cache lives in the program’s .avin/build/incremental/<kind><level>/, content-addressed, published by rename, with no lock; a missing, short or mismatched entry is a miss; a build trims what its manifest does not name and was not used in the last hour. WHY: the same scheme as the unit and shim caches, safe for two builds at once because a key’s bytes are the same whoever writes them. Alternatives: a lock per program directory (serializes run and test and the language server); the toolchain’s shared cache for everything (instances of a program’s own types are useless to any other program; sharing library-only instances can come later, since the keys already allow it). Review with the user: whether library-only instances should later go to the toolchain’s cache, shared across programs.

  • Settled on the user’s delegation 2026-11-11 (designed on branch incremental-design): An incremental build is tested against a clean one: every edit in the compiler’s tests checks that the incremental build’s LLVM text equals a build with no cache, and the counts in AVIN_BUILD_LOG that only the affected instances were lowered; AVIN_INCREMENTAL=verify compares every reused instance with a fresh lowering. WHY: a key missing a dependency is the one way this design fails, and it fails silently; the clean build is an oracle that needs no list of what each edit should touch. Alternatives: count-only tests (prove reuse, not correctness); trusting the key (no defence against a missed dependency).

  • Settled on the user’s delegation 2026-11-11 (built on branch option-nested): Option[Nothing] takes the form of the options it is seen as inside other values. Its one value, None, is null as a pointer and the constant None object as an object, so the program-wide plan keeps it a pointer when every view of it inside another value (a Vector[Option[Nothing]] as a Vector[Option[Dog]], a Result, a function’s result, an option, a tuple, a data field, a map value) sees it as an option kept as a pointer, and an object when every such view sees it as one kept as an object (Option[int], Option[Option[Dog]]); a bare Option[Nothing] written as an option of the other form is converted where it is written, as before. Why: options of classes and strings stay pointers in the common program that builds a collection of Nones, at no cost in any other. Left as full objects (correct, slower): a program that sees it inside other values both ways, since one vector of it could flow to both and no single form serves; and one that sees it as an option of a type parameter (Vector[Option[Nothing]] as Vector[Option[T]] in generic code), since the view is recorded once for every instance. Alternatives: (a) None null in every option, objects included, removing the conflict but adding a null test to every match, method call and table entry on an object option; (b) copying the containing value at the view, which a view by definition does not do and which breaks identity of mutable containers; (c) keeping Option[Nothing] always an object, the old rule, which stores every option of the program as an object as soon as one nested view to a pointer option exists. With it, an Option[Nothing] written as another option is always that option’s own None (the null, or that option’s constant object, where an object option used to receive the Option[Nothing] object itself), so as an Any it has the option’s type and equals that type’s other Nones, as the equality chapter’s rule by run-time type says; one seen inside a vector as an Option[Dog] and then boxed is an Option[Dog] too. A view inside an object-form value still leaves the Option[Nothing] object there, as any view leaves a value as it was made.

  • Settled on the user’s delegation 2026-11-11 (built on branch https): TLS’s API (system library). A module of its own, avin.net.tls: TlsStream.connect(host, port, settings), and TlsStream.client(tcp, host, settings) / TlsStream.server(tcp, settings) over a TcpStream the caller made; TlsClient (the authorities it adds) and TlsServer(certificate, key) (PEM text, checked by TlsServer.of) as immutable sendable values. In avin.net.http an https URL just works (port 443 by default), Request.withTls(client) choosing the settings, kept across redirects; http.serve(…, tls = Some(server)) serves HTTPS. A trait ByteStream, which TcpStream, UnixStream and TlsStream implement, lets the HTTP code run over either, and ReadAhead became public so the TLS module shares the line reading. Why: the URL decides TLS, as a reader expects; settings are values, so a request, a thread and an actor carry them freely; the stream over a caller’s TcpStream keeps that connection’s timeout and cancellation without a second set. Alternatives: TlsStream in avin.net itself (every TCP program would then build OpenSSL, since a module’s bindings come with it); a TlsClient holding one OpenSSL context for many connections (a context’s reference count is not atomic, so it could not be shared between threads; a context is made per connection instead, which reads the machine’s store each time, a few milliseconds); a trust(pem) that checks the PEM at once (it would need a context; a PEM that is not one is Credentials at the connection instead).

  • Settled on the user’s delegation 2026-11-11 (built on branch https): the trust model. A client trusts the machine’s store, through OpenSSL’s default paths, plus what TlsClient.trust(pem) adds; it always checks the host name (a name or an address), sends it for SNI, and speaks TLS 1.2 at the least, none of which can be turned off, as the Sysl package openssl decides. Why: trust that only grows cannot be misused to accept a bad certificate; a private, corporate or test authority is one case. Alternatives: a switch to skip verification (refused: it is how bad certificates get accepted); a bundled set of roots (it goes stale). Gap: on macOS the store is the cert.pem of Homebrew’s OpenSSL, not the Keychain, so a root added only to the Keychain is not trusted; the sysl session would queue reading the Keychain in the openssl package on request. Review with the user whether Keychain roots are wanted.

  • Settled on the user’s delegation 2026-11-11 (built on branch https): TLS errors. TlsError is Transport(IoError), Certificate(text), Handshake(text) and Credentials(text); an HttpError gains Tls(TlsError), a Transport failure staying Io as for http. After the handshake a TLS failure in a read or write is IoError.Other("TLS: …"), so a TlsStream is a ByteStream. openssl 0.2.2 reports a refused certificate as one error, so Certificate covers an untrusted, self-signed or expired certificate and one for another host alike; the mapping is the one function handshakeError in library/avin/net/tls/tls.avin, and openssl 0.2.3’s Error.refusal() (HostMismatch, Expired, Untrusted, Other) lets it split Certificate into those kinds there alone. Alternatives: one Tls(text) error (a program could not tell a refused certificate from a broken connection); typed errors for every read and write (every ByteStream user would need a second error type).

  • Settled on the user’s delegation 2026-11-11 (built on branch https): a connection’s end and timeouts over TLS. The end of the stream is the peer’s close_notify or the TCP connection closing, both read as the end, since many servers close without a close_notify and HTTP frames its bodies; a body read to the connection’s end can therefore be cut short undetected, as over TCP. Every wait, the handshake’s included, is a wait of the TCP connection beneath, under its setTimeout limit and cancellable by a scope; http sets the request’s timeout before the handshake, and http.serve bounds the handshake by readTimeout. A handler that traps on a TLS connection has it closed unanswered. Alternatives: an error for an end without close_notify (it would refuse ordinary servers); a handshake timeout of its own (one more limit to set). Review with the user whether a body read to the connection’s end should require close_notify.

  • Settled on the user’s delegation 2026-11-11 (built on branch https): the standard library’s Sysl packages. The library names the Sysl packages its own bindings reach in library/library.hocon, a manifest whose sysl-dependencies block is read as a package’s is. One joins a program’s shims only where a binding or handle the program compiles names a Sysl item inside it, the package’s name being a segment of the item’s name before its last (sh.sysl.openssl.client); a program naming the same package keeps its own, unless both are releases of one repository and the library’s is later. So only programs that reach avin.net.tls (avin.net.http among them) need OpenSSL installed, and the Homebrew formula depends on openssl@3. Why: a dependency written as a package’s, without making the library a package (an avin.hocon there would make library/tests a package’s tests). Alternatives: always adding the library’s packages (every program with a binding would fetch and link OpenSSL); the runtime depending on openssl (every program would link it); a table from module to package in the compiler (a second place to keep in step).

  • Settled on the user’s delegation 2026-11-11 (built on branch c-view-fields): Views lent by a field and to a callback:

    • A field accessor lending a view says view, length: and perhaps writable, as a binding does, and nothing else; length: is a C expression in self and the indices, evaluated after the field is read, whether or not it is null. Why: the words a binding lending its result already uses, so a reader learns one form. Alternatives: a separate buffer: word for fields; evaluating the length only for a non-null pointer, which would let a length: that dereferences the struct run only sometimes.
    • The C unit, not the checker, refuses a writable view of a const field, by glue that assigns through the pointer, since the field’s type is the header’s and the checker never sees it. Why: a binding’s prototype says const in Avin’s source, a field’s does not. Alternative: making the accessor spell the field’s C type, which repeats the header.
    • A view lent a callback may be an Option, null with any length None, and otherwise null follows a binding’s rule: an empty view for a length of zero, a stop for any other ( C lent the function given to `f` null); a negative length and one past the greatest int stop the program at the binding’s call. Why: one rule for every view. Alternative: refusing an Option in a callback, which would make a C library that passes null for an empty chunk stop the program.
    • A view lent a callback has no lender and belongs to the code the callback runs in: another thread’s use stops the program, a thread the callback starts among them, since the view is not handed over with a body that captures it as a handle’s view is with its lender. Why: C frees the memory when the callback returns, so it must not be read anywhere the closing cannot order before the free. Alternative: handing it over like a block, which lets another thread read while the callback returns and C frees. Review with the user only if a library needs a thread to read a chunk in place.
    • A callback view’s length is converted through long before the view’s own checks, so an unsigned 64-bit length past a long‘s range stops the program as that conversion does, and any smaller one past the greatest int as more bytes than a view holds. Why: the conversions a callback’s integer arguments already use. Alternative: a dedicated 64-bit unsigned comparison, which only changes the message.
    • The trap texts name the binding: the `ByteView` lent to the function given to `f` was closed when it returned and … belongs to another thread; a field’s view is a handle’s view and says the `ByteView` of `Face` was closed when `Face` was used again.

Settled on the user’s delegation 2026-11-11 (built on branch json-derive): JSON derivation.

  • One JsonError for parsing and decoding, the path its last field with a default: JsonError(message, line, column, offset, path: List[PathStep] = []), inField/atIndex putting a step in front, pathText() writing items[2].name, and Display putting that text and a colon before the message where the path is not empty. Why: a program handles one error type from the package, and every existing JsonError(message, line, column, offset) keeps compiling. Alternatives: the derivation chapter’s JsonError(path, message, line, column), which drops the offset and breaks every existing construction; a separate DecodeError.

  • JsonReader reads text in memory, JsonReader(text, maxDepth = 512), with beginObject, nextKey, beginArray, nextElement, takeNull, readString, readBool, readInt, readLong, readReal, readJson, skipValue, end and error(message), the last naming the start of the last token read. Why: the derivations need exactly these, and the tokenizer is the parser’s own, so its messages are parse‘s. Alternatives: reading a byte stream now, which is the streaming reader’s item; these methods are the seam it plugs into. A JsonWriter(out: Writer) writes compact text only, writeNull() for null. (The streaming reader has since taken this reader’s place: see the Proposed entry one JsonReader below.)

  • Numbers: an int or a long reads any whole number in range, 3.0 and 1e3 included, as Json.asInt/asLong do; a fraction or a number out of range is an error naming it. A NaN or an infinity is written null (as render writes it) and null does not read as a real. Alternatives: integer literals only; null reading back as NaN, which would make every real field silently nullable.

  • Option[Option[A]]: Some(None) and None both write null and read back as None. Why: JSON has one null. Alternatives: refusing to derive for nested options.

  • Maps are HashMap[K, A] and TreeMap[K, A] with K: JsonMapKey, a trait the package implements for string, int and long (the digits, read back only from what toLongOption reads); a key written twice keeps its last value. Why: an impl of a trait is for a data type or a class, not for the Map trait, and must take its type’s parameters in order, so Map[string, A] cannot be named. Alternatives: string keys only. Review with the user: a field typed as the Map trait (what a map literal is typed as) cannot derive the JSON traits; covering it needs the language to let a library trait be implemented for a trait type.

  • Unknown keys are skipped and a field written twice is an error (as the chapter says); a second discriminator key after the first is an unknown key. A missing field’s error is at the object’s closing brace, with the object’s path. The nesting limit counts a skipped value’s containers too.

  • Entry points json.encode(value) -> string and json.decode[A](text, maxDepth = 512), the second refusing anything but white space after the value. Alternatives: only the traits’ methods, leaving every program to make a writer and a reader.

  • Settled on the user’s delegation 2026-11-11 (built on branch time-calendar): startOfYear(), startOfMonth() and startOfWeek() on a DateTime answer midnight of that day, while endOfMonth() keeps the time of day, as the chapter says. Why: a start is the first moment of its span, as startOfDay is; keeping the time would make r.startOfMonth mean “the same time on the 1st”, which r.withDay(1) already says. Alternatives: keep the time of day for all four (symmetric with endOfMonth, but two spellings of withDay(1)); make endOfMonth the last microsecond of the month too (a start/end pair, but the chapter decided “at the same time of day”). Review with the user whether endOfMonth on a reading should rather be its month’s last microsecond.

  • Settled on the user’s delegation 2026-11-11 (built on branch time-calendar): a calendar answer outside Date.Min to Date.Max traps with a message naming the date (the date +5881580-07-31 is outside Date.Min to Date.Max), or, where the answer is a count of days with no year to write (a weekday search, startOfWeek, DateTime ± Duration), the date N days from 1970-01-01 is outside Date.Min to Date.Max; the maker date(y, m, d) traps the same way, and a year far beyond the dates (withYear(long.MaxValue)) is checked before any arithmetic, so it never overflows on the way. daysUntil and DateTime - DateTime, whose answers are an int and a Duration, trap as an integer overflow does. Why: the chapter says leaving a type’s range traps “as an integer overflow does”; a message naming the date says more than integer overflow where there is a date to name. Alternatives: a bare integer overflow trap everywhere (shorter code, a less useful message); clamping to the bounds (silently wrong).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-calendar): withYear takes a long, the type year() answers, so d.withYear(d.year + 1) needs no conversion; the other with… take an int. Alternatives: int like the makers (a conversion at every use of year()), or changing year() to int (every year of a Date fits, but a change to step 1’s fields).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-calendar): with… and startOf… on Zoned wait for step 3, which builds Resolution and the zone’s handling of a skipped or repeated reading they rely on; step 2 gives Zoned only isoWeek() and isoWeekYear(), which need no resolution.

  • Settled on the user’s delegation 2026-11-11 (built on branch generic-variant-inference): A shared variant name takes the type its siblings decide: a bare or called variant name several data types share, passed for a generic function’s type argument, is decided by what the call’s other arguments decide of that type argument: assertEq(p.segments(0), MoveTo(10.0, 20.0)) takes T = Segment from the first argument, so MoveTo is Segment‘s. It is checked after the arguments that are not such names, wherever it is written, so same(MoveTo(1.0, 2.0), segment) resolves too, and named arguments go the same way. The elements of a collection literal and the two branches of an if agree the same way: [Close, segment], if c then Close else segment. Only the data type is taken from the others; its type arguments are left for the variant’s own fields to decide, so a later argument may still widen them, as any argument’s may. Where every argument for the type argument is such a name, or the others decide a type that is none of the name’s owners, the use is refused with the usual message. Why: the name’s type is fixed by the call before it is chosen, exactly as with a parameter of the data type itself, and checking the shared names last makes the result independent of argument order, which a reader expects of assertEq(a, b) and assertEq(b, a). Alternatives: left to right only, so same(MoveTo(…), segment) is refused (order-dependent, and the expected value usually comes second); taking the decided type with its type arguments fixed too (refuses a later argument that widens them); a second checking pass over the whole call (the same answers here, with each argument checked twice).

  • Settled on the user’s delegation 2026-11-11 (built on branch c-binding-gaps): An array C fills, its length known before the call: an out T * parameter (one star, against out T ** for an array C allocates) named with array:, its length: a C expression over the parameters evaluated in the glue before the call; the glue mallocs that many elements (at least one), C fills them, and they are copied into an Array and freed with free. A negative length or one past the greatest int calls nothing (the glue answers a zeroed result) and the length stops the program when it is read; length checks now come before the null check for every array C answers. It is never in an Option and takes no free:. Why: Cairo’s cairo_get_dash writes cairo_get_dash_count doubles, a length no parameter carries; the words array:/length: are the ones an array C answers already uses, the number of stars says who allocates, and the answer is the same Array in the result. Alternatives: an Avin Array passed in, checked by the glue to be at least length: long (the library would make and size it, and a precondition the binding cannot see becomes the program’s); a capacity: word on an in-array; the array allocated in the collected heap (a moving or concurrent collection, and a blocking call, would need it pinned).

  • Settled on the user’s delegation 2026-11-11 (built on branch c-binding-gaps): Several arrays in one call: array:/bytes: take a list, length: and free: then lists of the same length in the same order, "" in free: freeing nothing; the glue writes each length through its own pointer and has a free function per array (avin_c_array_free_<symbol>_<j>). Why: the existing words, with the list shape keeps: already has; one array keeps its single-string form. Alternatives: repeating array:/length:/free: groups in order (order-dependent pairing nobody can see); marking the count in the prototype (length(glyphs) out int *num_glyphs), which would drop the count from the result and reuse a marker that means something else for inout; a free: keyed by name (no map literal in an annotation).

  • Settled on the user’s delegation 2026-11-11 (built on branch c-binding-gaps): null in a prototype passes null: a word before a pointer parameter’s type; the parameter is no Avin parameter and no out value, and a function whose caller chooses (Cairo’s clusters, wanted or not) is bound twice, once with out and once with null. Why: what is passed is fixed per binding, so the result’s type stays fixed; the prototype is where the other per-parameter words (out, inout, userdata, length) already live. Alternatives: an Avin bool or Option parameter choosing at run time (the result’s shape would depend on a value); a skip: list on the annotation (a second place saying what one parameter is). Review with the user: whether null should also let an Avin Option parameter decide.

  • Settled on the user’s delegation 2026-11-11 (built on branch c-binding-gaps): A field accessor reads and writes an enum mirror: the C unit checks the field is of an integer type (any, not only the mirrored enum) and measures it; a read value no variant holds stops the program as an enum result does ( the field `f` of `H` held a value no variant of `M` holds), a write stores the enumerator’s value, and an Option of a mirror is refused. Why: a struct mirror’s field already crosses this way, and Cairo’s path header is a union member; accepting any integer type lets an int field holding an enum’s values be mirrored. Alternatives: requiring the field to be exactly the mirrored enum (the field’s type is the header’s, which the checker never sees, so the C unit would compare type names); reading it as an int and converting in Avin (the workaround cairo used).

  • Settled on the user’s delegation 2026-11-11 (built on branch c-binding-gaps): attach: failing answers Err where the binding answers Result[H, E]: a binding whose C result is a handle of a class with attach:, which keeps something and answers no out values, may answer Result[H, E], E an integer type or an enum mirror; when attach: answers non-zero, the record is undone, the handle given back (its kept list cleared) and Err of the answer returned, converted as a status code is. Without the Result the trap stays. Why: Cairo’s cairo_surface_set_user_data on a surface in error answers the surface’s own status, so the attach: answer is exactly the error the program wants, and no new word is needed; the Result is the existing status shape. Alternatives: a class-level status: C expression evaluated on every new handle (a new word, and a check on bindings that keep nothing); answering None for a refused attach (loses the reason); keeping the trap and the library’s pre-checks (what cairo had to write).

  • Settled on the user’s delegation 2026-11-11 (built on branch array-refmaps): An array’s descriptor carries a per-element reference map (the runtime half of the union tag-and-payload layout, under Settled → unions → Representation). An array of elements k words wide names one of three tracers: every element one reference (avin_rt_trace_array, as before), no reference word (the ordinary tracer with no offsets, as before), or a mapped element (avin_rt_trace_array_map), whose descriptor lists the byte offset within an element of each reference word, in the same trailing offset list an object’s descriptor uses for its fields; the tracer reads exactly those words of every element and never a scalar word, so a union’s bits word holding something that looks like a heap address keeps nothing alive. The compiler builds every array descriptor through array_descriptor(…, words), which picks the fast path whenever the map fits one; a one-word element is never mapped. Handing a value over to another thread reads the same words through the same scanners (scan_object). The two fast paths compile to the same machine code as before. Why: the offset list already exists, is what the emitter writes for objects, and costs nothing for the arrays every program has today; elements of a union are at most three words, so a short list per element is cheap. Alternatives: a bit mask word per descriptor (one word, but a second format beside the offset list, and a bit scan per element); a tracer per element shape generated by the compiler (fastest, but code per instance and a new symbol per shape); keeping union elements boxed in arrays (no runtime change, an allocation per element).

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): avin.io.Reader, a trait of one method, read(max) -> Result[Array[byte], IoError], an empty array at the end, which fs.File, net.TcpStream and net.UnixStream implement with the read each already had. Why: the streaming JSON reader reads “a byte stream”, and the three byte sources had the same method with no common type, so a function could take only one of them. Alternatives: a read function (int) -> Result[Array[byte], IoError] passed to the JSON reader (no library change, but every caller writes the lambda and other byte readers gain nothing); a ByteSource trait private to the json package (each source wrapped by hand). Standard input and a command’s output are not readers yet; making them so is later work when a program needs it.

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): the streaming JSON reader’s interface, JsonReader with the pull events of JsonEvent (next, peek, depth) beside the calls the derivation chapter’s decoder makes (beginArray, nextElement, beginObject, nextKey, readString, takeNull, skipValue, error), completed with readBool, readLong, readInt, readReal, readValue, readDocument and finish; made by fromReader, fromString and fromBytes. Why: one type serves both a program walking a large document and a derived decoder, and the events are the smallest set that names every token; a decoder’s calls are each a step or two over them. Alternatives: callbacks pushed per event (a decoder cannot pull a field’s value at its type); an iterator of events (no Result per step, so a fault would have to trap); a reader of several values in a row (JSON lines), later if a program needs it, as parse takes one value too. Review with the user: the variant names (StartObject … EndOfText), chosen to stay apart from Json‘s own variants in the same module.

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): a stream gives parse‘s faults at parse‘s places, and a failure to read is a JsonError (the text could not be read: <the IoError's message>) at the place reading stopped, rather than a separate error type. Bytes that are not UTF-8 are found as they are read, so a grammar fault earlier in the text is reported first, where parse of bytes, which checks the whole text first, reports the UTF-8 fault. Why: one error type for the decoder to carry, and a stream cannot look ahead to the end. Alternatives: Either[IoError, JsonError] per call (every decoder’s signature grows); trapping on a read failure.

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): JsonError‘s line, column and offset are longs (they were ints). Why: a stream larger than memory runs past two gibibytes, and a minified one is on a single line, so an int column or offset would trap on overflow. Alternatives: ints that saturate (a wrong place, silently); a long offset only (a column of a long line still overflows).

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): a parent after : may be named through its module, class Body: shapes.Base("b"), io.Reader, resolved as a type written m.T is. Why: it was refused with “expected a superclass” though the same name is a type everywhere else; found when fs.File was made an io.Reader. Alternatives: none weighed; the bare name through an import stays the common form.

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): one JsonReader, the streaming one, which the derived decoders read through. The in-memory reader of the derivation item is gone and so are the token methods it added to parse‘s private reader; json.decode[A](text) reads through JsonReader.fromString. Where the two readers named a call differently the streaming names stay: readValue (not readJson) and finish (not end). Why: one reader means one grammar and one set of places for a fault, whether the text is in hand or arriving; readValue pairs with skipValue and readDocument, and finish cannot be read as the end of an object or array, as end can; the streaming names had the more users (its tests, the chapter’s example, three corpus programs) against one test and one decoder line. A text reader is made by JsonReader.fromString(text), since the class’s constructor takes a source; the derivation entry’s JsonReader(text, maxDepth) no longer compiles (its only users were the package’s own test and json.decode). Alternatives: keeping both readers behind a trait the decoders take (two grammars to keep in step, and a decoder call through a trait for every token); keeping both names of each call (two words for one thing in the chapter’s table); a second constructor JsonReader(text) (the language gives a class one constructor).

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): where the two readers worded an error differently, the settled derivation wording stays: expected a boolean (not expected true or false), found a boolean for true and false alike (not found false), and the number N is not a whole number within an int's range / a long's range (not does not fit an int / within a long), readInt naming the number as written, a fraction included. A fault in the text itself is the stream’s, worded as parse words it: tru read as a bool is unexpected word 'tru' where a value was expected, no longer expected a boolean, found 't', and text ending where a string was wanted is unexpected end of text where a value was expected, since the stream tokenizes before the decoder asks for a kind. A fault met while an array looks for its next element ([ and the end, [1 2]) carries the array’s path, not an element’s ([ decoded as a Vector[int] has an empty path where it had [0]), since no element has begun. Why: the derivation’s messages were settled and name kinds throughout (a number, a string), and a stream cannot answer “what character is next” without reading a token. Alternatives: the stream’s wordings throughout; the derivation’s character-level messages, which would make the stream peek bytes outside its tokenizer. Review with the user: the [0] path a fault at the next element used to carry.

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): json.decode[A](source: Reader, maxDepth = 512), an overload of decode reading a value of a derived type as its text arrives, from a file, a connection or any Reader, refusing anything but white space after it. Why: the streaming reader exists so that a document need not be held whole, and a program decoding its own type should not have to build the reader and call finish itself. Alternatives: JsonReader.fromReader and A.decode(r) by hand; a decode taking a JsonReader (which leaves the end of the text unchecked or checks it where a caller wanted to read on).

  • Settled on the user’s delegation 2026-11-11 (built on branch json-stream): net.ByteStream is an io.Reader (trait ByteStream: Sendable, Reader, its read the trait’s), so TcpStream, UnixStream and TlsStream are all readers and JSON reads from a TLS connection as from a plain one. Why: both sides arrived at once, the stream item making TcpStream and UnixStream readers by name and the TLS item giving the three a common ByteStream; declaring it on the trait covers every connection, the TLS one included, with one line. Alternatives: naming io.Reader beside ByteStream on each class (TLS left out unless named a third time).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-period): a.monthsUntil(b) counts a month whole when b‘s day of the month has reached a‘s (the month difference, less one where b‘s day is smaller, or plus one going backward where it is larger), and a.until(b) is those months and the days from a + months(n) to b. Why: it is the chapter’s “as a person counts them” (2026-01-31 to 2026-02-28 is 0, to 2026-03-01 is 1), it makes b.monthsUntil(a) == -a.monthsUntil(b) always, and with months-first addition a + a.until(b) == b holds in both directions (a sweep of 21,228 pairs tests it). b - a.until(b) == a and b.until(a) == -a.until(b) fail for some pairs near month ends (2026-01-30 and 2026-03-01), and the chapter now says so. Alternatives: the largest n with a + months(n) <= b (answers 1 for 2026-01-31 to 2026-02-28, against the chapter); counting backward periods from b so the reverse is the negation (breaks a + a.until(b) == b for a > b).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-period): p.toIsoString writes a period in ISO 8601’s form, P1Y2M3D, the months split into years as the display splits them, P0D for the empty period, and a negative part with its own sign (P-1Y-2M, P1M-3D). Why: the display 1y 2mo 3d is for people; exchange formats want ISO’s, and a period’s parts may differ in sign, which a single leading - cannot write. Alternatives: a leading - when every part is negative and per-part signs only otherwise (two rules for one value); no ISO text until step 5’s parsing (a writer without a reader for a while). Review with the user whether the step 5 parser should read it (parsePeriod), which the chapter does not list.

  • Settled on the user’s delegation 2026-11-11 (built on branch time-period): toYearsPart() and toMonthsPart() carry the months’ sign (months(-14) is -1 year and -2 months), as Duration‘s parts do, and the display and ISO text write each part with that sign (-1y -2mo). p.isZero() asks for the empty period, as Duration.isZero() does. Alternatives: floor division (-2 years and 10 months, which reads as something else); no isZero (p == Period.Zero says the same, less directly).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-period): calendar steps count in a long: Date ± Period, plusYears(n) (12 * n months) and plusWeeks(n) (7 * n days) never overflow on the way, so an answer past the dates traps naming the date (the date +5881580-08-11 is outside Date.Min to Date.Max), or the count of days where only a day step overflows, as step 2’s traps do; the makers years(n) and Period * n, whose answers are periods, trap as an integer overflow. plusYears, plusMonths, plusWeeks and plusDays take an int, as the makers do.

  • Settled on the user’s delegation 2026-11-11 (built on branch time-period): Zoned ± Period and Zoned‘s plus… wait for step 3, whose Resolution decides a period landing in a gap or an overlap.

  • Settled on the user’s delegation 2026-11-11 (built on branch time-period): the formatter breaks a long one-line if only after its last then, elif or else, keeping its tests, its earlier branches and any operators before it on one line. Why: a line after an if‘s test is its block, so a break there changes the program (the formatter refused library/avin/time/period.avin); a break in an earlier branch would put the next elif or else inside a continuation line. Alternatives: wrapping the if in brackets to break inside it (adds tokens, which the formatter never does); leaving any line holding an if long (also loses the safe break in the last branch).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-parse): BadShape names what was expected: BadShape(text, at, expected), its message cannot read "2026/03/08": expected '-' at byte 4, and Trailing‘s expected the end at byte 10, in place of the chapter’s earlier not the expected shape at byte 4. Why: a reader fixing the text needs to know what would have been accepted there, and the parser knows it at the point it stops. Alternatives: BadShape(text, at) with one fixed message (says where but not what); a separate expected method computing it again from the text (a second parser).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-parse): a parse reads the whole shape first, then checks the fields in the order they are written, so 2026-02-30T24:00 is refused for its day and 2026-02-30T24:00 for its trailing space; a zone name is looked up last. The fields an OutOfRange names are year, month, day, date (past Date.Min/Date.Max inside their own years), hour, minute, second, fraction, offset, instant (past Instant.Min/Instant.Max), months and days. Why: one rule for which error a text with several faults gets, and a shape error never hides behind a range error further left. Alternatives: failing at the first fault left to right (a range error could then mask a shape error after it, and the answer would depend on how far the reader had got).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-parse): a year of four digits has no sign, and a signed year has four digits or more, even inside 0 to 9999 (+2026, -0000 read); an unsigned fifth digit is a shape error at byte 4. A seventh digit of fraction is OutOfRange(text, "fraction") even when it is 0. t, z, a comma as the decimal sign, − (U+2212) and a bare ±hh offset are refused. Why: the display never writes them, and each accepted alternative is one more form every other reader of the text would have to accept. Alternatives: ISO 8601’s lowercase and comma variants (wider, and nothing here writes them).

  • Settled on the user’s delegation 2026-11-11 (built on branch time-parse): parseZoned with a zone name checks the offset against the zone: the reading minus the offset is the instant, and the zone’s clocks must show that offset then, or the text is OutOfRange(text, "offset"); so both readings of an autumn overlap read and a reading in a spring gap is refused. Any ZoneError from looking the name up (unknown, not a name, an undecodable file) is UnknownZone(text, name). A fixed zone’s name in brackets (+05:30[+05:30], Z[UTC]) reads as the fixed zone. Built over zone(name), which is on dev ahead of the rest of step 3. Why: the offset makes the instant unambiguous, and a text whose offset the zone never shows names no reading of that zone. Alternatives: trusting the zone and re-reading the instant from the reading alone (needs step 3’s Resolution for gaps and overlaps, and drops the offset the text gave); trusting the offset and ignoring the zone’s (keeps a Zoned whose offset its zone contradicts). Review with the user whether a mismatch deserves a variant of its own rather than OutOfRange‘s offset.

  • Settled on the user’s delegation 2026-11-11 (built on branch time-parse): parsePeriod(text), named as the chapter’s other readers are, reads P, then a number of years Y, of months M and of days D in that order, at least one, each with its own - where negative, so every toIsoString() reads back equal. Forms toIsoString() does not write but whose numbers are plain also read (P12M as P1Y, P0Y, P007D, P-0D); a total of months or days beyond an int is out of range. +, W, a T time part, a fraction and lower-case letters are refused. Why: a reader for the writer, settled as the step 5 follow-up to the toIsoString() entry above. Alternatives: Period.parse on the companion (unlike the chapter’s other readers); accepting only the canonical form (refuses P12M, which means one exact period); ISO’s weeks (P2W, fourteen days, which toIsoString never writes).

  • Settled on the user’s delegation 2026-11-11 (built on branch tls-refusal): why a certificate was refused. TlsError.Certificate gains a second field, why: TlsRefusal, and TlsError.refusal() -> Option[TlsRefusal] answers it (None for the other errors). TlsRefusal is HostMismatch, Expired, NotYetValid, Untrusted and Other(code: long), and its message() and the error’s say the reason in words. Amended 2026-11-11 (branch openssl-024): the mapping to the five kinds comes from the package openssl 0.2.4, whose Error.refusal() groups the X509 verdicts (62 and 64, a certificate for another name or another IP address, host; 10 expired; 9 not yet valid; 2, 18, 19, 20, 21 untrusted; any other Other(code)). TlsRefusal mirrors openssl‘s Refusal and the private TlsFailure binds refusal() as a mirror’s bound method, so Avin keeps no table of its own; a failure with no verdict is Other(0). Why: a program can tell a wrong name from an untrusted issuer, which read identically before; the reason is a value, so it is matched, not parsed out of text. The field is not an Option, since a refused certificate always has a verdict and Other carries the unusual ones. The field is why because a variant field named refusal would clash with the method. Alternatives: an Option field (a None that cannot happen); one variant per kind, HostMismatch and the like as TlsError variants (every existing Certificate(_) pattern would stop matching and a program that only cares that a certificate was refused would need four arms); keeping Certificate(text) and adding a separate query (the reason would have to be stored somewhere anyway). Breaking: Certificate(_) patterns become Certificate(_, _). Review with the user whether the Certificate arity change is wanted over a variant per kind.

  • Settled on the user’s delegation 2026-11-11 (built on branch c-binding-gaps-2): A field accessor reads and writes a struct mirror whole: the C unit checks the field is the struct the mirror mirrors (any member path, through pointers and array elements); the reader’s glue copies the field into memory Avin allocates, read into a new value as a filled out mirror is, the memory then freed; the writer lays the value out as C’s struct and the glue assigns it. A mirror holding a string, directly or in a mirror it holds, is refused as a writer’s value, and an Option of a mirror is refused either way. Why: FreeType’s face->bbox and face->size->metrics are structs read whole, and one accessor per member (the package’s workaround, eight accessors and a tuple) loses the type; the mirror’s layout is already checked and measured, so the copy is the struct passed by value’s own conversion. Writing a string would leave C holding a copy no one frees, the rule for string fields; a field is never null. Alternatives: read only, no writer (writing is the scalar rule extended and costs one glue function); a writer that leaks or keeps the string copies (C would own Avin’s allocation); answering a handle on the struct inside the owner (lifetime tied to the owner, and every member a call). Review with the user: a mirror holding a string is read-only.

  • Settled on the user’s delegation 2026-11-11 (built on branch c-binding-gaps-2): One pointer to a typedef of char is a string: where a string crosses (parameter, result, out value, callback parameter), a C type written as one pointer to a typedef (const FT_String *, FT_String const *, T *const) is checked by the C unit as a typedef of the whole pointer: char * or const char * as a result, const char * as a parameter, so a typedef chain and a typedef const char T both work. A pointer to a typedef of unsigned char or signed char is refused by a check of its own whose message says those are bytes rather than text, for results, parameters, fields and struct mirrors’ fields. Why: only the headers know what FT_String is, and the existing typedef rule already defers the string check to the C unit; fields already resolved typedefs, since their type comes from the header. Alternatives: rewriting the prototype’s spelling to char (loses the header check’s typedef names); a new C type kind in the parser for a pointer to a typedef (every handle cairo_t * is one, so each position would have to tell the two apart).

  • Settled on the user’s delegation 2026-11-11 (built on branch c-binding-gaps-2): The c-bindings chapter’s FreeType library is released with FT_Done_Library, not FT_Done_FreeType: the latter frees the library’s memory manager whatever the reference count, so a face kept past the library’s handle would allocate through freed memory. The chapter’s prose and both examples say so. Why: a release must give back exactly one reference when the class declares retain. Alternatives: none that keeps keeps: sound; the manager’s small record is not given back, as the freetype package notes.

  • Settled on the user’s delegation 2026-11-11 (built on branch openssl-024): a mirror’s methods may be bound to Sysl (methods of a mirror). A method without a body in an impl of a @sysl data type that names no trait is bound to the Sysl method of its name’s words in snake_case, or the one its own @sysl("name") names, with blocking and named as on a handle’s method; it may be overloaded by parameter types; its parameters and result cross as a binding’s do. Each call converts the receiver into the Sysl value, puts it in a counted box of its own and calls the method on that, so a Sysl method taking self, &self or *self is bound alike, and what a *self method writes is lost with the box: the mirror is a value. A method without a body on a plain data type, or in an impl of a trait, still needs one; a method with a body takes no @sysl. Why: openssl‘s Error.refusal() is a method of a struct Avin mirrors, and a mirror had no way to reach it, so Avin copied its table. The impl form, because a data type’s body holds its variants, and a handle’s body form would need a second kind of body member for data. The box, because the shim cannot see which receiver the Sysl method takes and &self needs a counted reference; the cost is one allocation per call. Alternatives: methods in the data’s own body after its variants (a new body grammar for data); a top-level binding whose first parameter is the mirror, @sysl("sh.sysl.openssl.Error.refusal") (a path that names a method rather than a function, read differently from every other binding’s); passing the value on the stack and refusing &self methods (most Sysl readers take &self); a *self method’s write copied back (a mirror is immutable in Avin). Also chosen here: TlsRefusal itself mirrors openssl‘s Refusal rather than a private mirror mapped to it, since a second data type with the same variant names cannot share the module, and the two would be the same five cases. Review with the user whether a public library type mirroring a package’s enum is wanted: a variant openssl adds must be added to TlsRefusal, which Sysl reports as not matching until it is.

  • Settled on the user’s delegation 2026-11-11 (built on branch stable-names): Each emitted table is named @"avin.<kind>:<name>", the name spelled by qualified names in full, with no hash suffix: a type as avin.Option[int], class geo.Box[], object geo.Box[], (int, string); a descriptor by its type, a variant after its type’s (avin.Option[int].Some); a record by its type; a constant closure by its function; a module-level value by its qualified name (object before an object’s). WHY: readable in the emitted text and in a profile, injective by construction (two types of one module never share a name but an object and its companion, which the prefixes tell apart), and short enough: marshal’s longest symbol is 319 bytes, 275 of its 111,642 symbols are over 200, and every one is local to the program, so no linker or object format limit is near. The emitted text grew 11% (126 MB to 140 MB for marshal). Alternatives: a hash of the spelling (shorter, unreadable, and a collision is silent until the assembler reports it); the spelling cut at a length with a hash of the rest (not needed at these lengths). Emission stops with the name where two of one kind would share one, rather than the assembler reporting a redefinition.

  • Settled on the user’s delegation 2026-11-11 (built on branch stable-names): A string constant is named by the first 16 hexadecimal digits of the SHA-256 of its bytes, a later string sharing them by its index after a dot. WHY: the same string has the same name in every program and every build; 64 bits make a shared prefix within one program improbable past any program’s size. Alternatives: the whole digest (32 more bytes on each of thousands of strings); the text itself (unbounded, and escaping in a symbol).

  • Settled on the user’s delegation 2026-11-11 (built on branch stable-names): A trap site is named by the innermost top-level function or method declared around it, the byte offset from that declaration’s start, and 12 hexadecimal digits of the SHA-256 of its reason; a site in code the compiler wrote (an empty span) by the instance being lowered; one in a declaration the checker copies (a derived Display and its siblings, one method name on several types sharing a declaration) or outside every function by its file and offset. Trap sites are never copied into the units that reach them at -O2. WHY: lines added above a function move its sites’ lines, which only the tables’ unit holds, and leave every function’s text as it was; a copy of a site, which no code reads, would carry its line into the units that reach it. Alternatives: the instance and its sites in order (a site is shared by every instance of a generic function, so its name would depend on which instance was lowered first); file and line (moves with every line added above). Review with the user: a site in a library template is named by file and offset, which an edit to that library file moves.

  • Settled on the user’s delegation 2026-11-11 (built on branch stable-names): A local function or lambda is numbered among its top-level function’s local functions of its name, from 1 in declaration order (<program>.pick.lambda#2). WHY: two blocks may each declare a local function of one name, and the number counts only within the function, which an edit elsewhere never changes. Alternatives: the checker’s symbol index (moves with every symbol declared before it); the byte offset within the function (moves with an edit above the lambda inside the function, which changes the function’s text anyway, and is longer).

  • Settled on the user’s delegation 2026-11-11 (built on branch stable-names): A shared constant object is named by a hash of what it holds, an unshared one (a vector literal’s) by its module-level value and its place among that value’s objects; a C trampoline by its binding and place. WHY: equal shared objects are one object already, so their content is their identity; an unshared object’s identity is its value’s.

  • Settled on the user’s delegation 2026-11-11 (built on branch stable-names): A module-level value that holds a reference keeps its slot in the roots frame, and its name is a private alias of that slot; code names the alias. WHY: the slot’s position moves when a value is added before it, and the alias keeps that position in the tables’ unit alone; the runtime’s view of the frame is unchanged. Alternatives: a global per value and a frame of addresses (a runtime change for the same effect).

  • Settled on the user’s delegation 2026-11-11 (built on branch stable-names): The module-level tables are the last codegen unit of n, the functions spread over the other n - 1, and a unit holds its pieces in the order of their names. WHY: a new string, type or trap site then changes the tables’ unit and its user’s alone, and a unit whose own pieces are unchanged is the same text whatever order lowering found them in. Alternatives: tables in the first unit that names them (a new early user moves them, changing two units); one unit per kind of table (more units for no fewer recompilations). Left as it was: a function called from one function alone still lives in its caller’s unit, so a second caller in another unit moves it; and a small function copied into its callers’ units at -O2 makes an edit to it recompile those units too.

  • Settled on the user’s delegation 2026-11-11 (built on branch manifest-avin-version): a package names the least Avin it builds with (the manifest, the Avin a package needs). avin = "0.0.18" in the package block, a version, met by that Avin and every later one, compared number by number (0.0.9 before 0.0.18). A minimum only: no ranges, no upper bound, no pre-release suffixes. Every package of the resolved graph is held to it, the root and each dependency at any depth, fetched or by path, by every command that reads manifests (build, run, test, check, add, tidy, vendor); a package needing a later Avin is refused at its avin value, naming the package, its requirement and the running version and saying to upgrade, before anything else wrong in that manifest. A malformed value is an error at the value. avin new writes the running Avin’s version. avin lsp reports it on avin.hocon when the editor opens one, and on the manifest of the package a file being edited belongs to. Why: cairo needed 0.0.18 and could only say so in its README, and a package that needs a feature should fail with the upgrade named rather than with an unknown key or a type error. The key’s spelling follows sysl.hocon, which names the Sysl a package needs as sysl = "0.10.0" in its package block. A minimum, because Avin’s versions only add: a later Avin that breaks a package is a bug or a deliberate break in a release, which a range written in advance cannot foresee, and an upper bound would refuse every upgrade until each package re-releases. Checked when each manifest is read, so every path that reads one is held to it without a second walk of the graph; told first, because a manifest written for a later Avin may hold a key this one does not know. Alternatives: a range (>=0.0.18, <0.1), refused for the reasons above; a top-level avin key or a requires { avin = … } block (Sysl puts its own in package); a warning rather than an error (the build would then fail later and less clearly); checking only the root package (a dependency’s need is the common case, as with cairo). Review with the user whether avin new should write the running version (it ties a new package to the Avin that made it, which may be later than the package needs).

  • Settled on the user’s delegation 2026-11-19 (branch min-avin; completes the entry above, which had left the question in § Open): the minimum stays the whole design, the running version is the stamped Version, and a missing library module points at the upgrade. The key (package.avin), its checking of every package of the graph, avin check and avin new were settled and built 2026-11-11; this adds only the hint: the “the standard library has no module” error ends with “if the program was written for a later Avin than this one (X), upgrade Avin, and let its package say which it needs with avin = "…"“. It names no manifest state, because every declared minimum has already been met by the time a module is looked up, so the error means either a typo or a package that does not say what it needs. Dev builds: the version compared is the number scripts/release.sh stamps into const Version, three numbers with no pre-release suffix, so a tree between releases is the last release; a package naming a release not yet cut is refused by it with the usual message. Why no exemption: a version has meaning only once a release stamps it, and a pre-release rule would add a suffix to a version syntax that is three numbers. avin tidy warning on a dependency’s minimum above the root’s: not added; the root’s avin is what its author tests with, and a dependency above the running Avin is already refused. Alternatives: a hint only where the manifest has no avin (the driver does not see manifests, and the hint is harmless where one is declared); an AVIN_VERSION override for dev trees. Review with the user: the key’s name (avin, after sysl in sysl.hocon) and whether ranges are wanted (refused above, because Avin’s versions only add).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-keys): An instance key is a content hash in two parts: a lowered part (identity, body fingerprint, interfaces read) and the world facts the whole-program steps decided for it, both made on every build after lowering (the instance key). The facts are recorded where they are decided, as each step runs: the slots of methods with type parameters of their own, each devirtualization decision at a call through a table (not the whole set of descriptors a receiver type admits), and each summary scalar replacement read, with the finished key of every function it inlined (never one that may recur, so the inlined keys form no cycle). WHY: a decision is exactly what a step’s rewriting of a function depends on, so a new implementing class changes the keys of only the calls whose decision it changes, and a callee’s body edit reaches a caller only through a changed summary or an inlining; and the cache (item 6) can reuse a lowered form on the first part and rerun only the passes on the second. Alternatives: the callee’s key for every summarized callee, as the pipeline first wrote it (every leaf edit would reach every transitive caller); the admitted descriptors rather than the decision (a class added past the guard limit would change keys for no change).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-keys): The body fingerprint is per function, with its family’s captures, not per family. A local function or lambda and its top-level function share one table of locals; each fingerprint holds its own tree, the locals it owns or captures, and what every function of the family captures (with each captured local’s type and mutability), which decides what is kept in a box. WHY: a lambda’s body edit then changes the lambda and its closure entry and not the function around it, unless its captures change. Alternatives: one fingerprint for the whole family (every edit in it changes every member; simpler, and what the first build did).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-keys): Places in the fingerprint follow trap-site naming: a node inside its declaration counts from the declaration’s start; a node outside it (a constant default argument copied into a call keeps its place in its own file) is named as trap_name would name a trap there; a derived impl’s shared template counts from the start of its file; the compiler’s own code (an empty span) is named by the instance. A constant’s place is left out: no trap is named by it. WHY: a trap site’s name is the only place a function’s text holds, so this is the least that keeps the key sound; lines added between declarations change no key. A comment inside a function changes its key whether or not a trap site follows it. Alternatives: only the places of nodes that can trap (needs lowering’s knowledge of which do, duplicated); no places at all (unsound: an edit moving a trap site changes the text).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-keys): What a key reads of types is conservative where the text rarely depends on it: every type argument’s supertypes and method table (they choose the method a call on a bound runs), and a class’s or data type’s whole layout for any read of a field (its field types in order, never the names). So a new impl for a type changes the instances at that type that never call through a bound, and a field appended to a class changes the readers of its earlier fields; both cost a rebuild, never a stale instance. Review with the user if the cache’s hit rate after edits like these matters: narrowing needs the bound calls and the fields read recorded during lowering, as the other facts are. Alternatives: record during lowering exactly which table entries and fields each instance used (precise, more state threaded through lowering).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-keys): The key names the compiler by its version and its executable’s path and modification time, not the level. WHY: lowering does not depend on the level, and the pipeline keeps one instance directory per level. Alternatives: the level in the key as well (redundant with the directory), the executable’s hash (reads 8 MB per build).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-cache): A lowered entry is the instance’s requests and its code by name, replayed; not a record of lowering’s state (the instance cache). Every request lowering an instance makes of the whole program goes through one function of lowering (seventeen of them: a layout, a record, an object’s record, a box, a value box, a type tested, a string, a trap site, an instance, a generated function, a slot, a slot of a method with type parameters of its own, a closure’s shape, a constant closure, a constant object, a call through a table, a call of a function value), which records it while the instance is lowered for the cache; the outermost request alone is recorded. The code names what it counts by its stable name. WHY: replaying a request runs the same code a fresh lowering runs, so the instances, tables and records grow exactly as they would, in the same order, and an incomplete record fails to read back (an unknown name) rather than silently differing. A binding, a C callback and a C binding’s body mark the instance as one no entry holds. Alternatives: the difference in lowering’s state before and after each instance (state is keyed by the checker’s indices, which an edit moves); a module’s whole lowered program (a change anywhere in the module loses all of it).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-cache): Only the program’s functions with bodies get lowered entries. Closure entries, bindings and the functions lowering makes (equality, hashing, rendering, adapters, C callbacks) are lowered every build; every function gets a text entry. WHY: they are small and many of them depend on the whole set of types; on marshal they are about 17,000 of 41,583 instances and a fraction of lowering’s time. Alternatives: entries for every kind (each kind’s requests would need recording; generated functions read tables the worklist is still filling).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-cache): A text entry is keyed by the finished key and the facts emission reads of the whole program: for each call, the callee’s symbol and signature, whether it may collect and whether the call may close a cycle of the call graph, and a shim’s extensions. WHY: these decide the frame, the polls and the calling convention of a function’s text and are not in its finished key, which covers its code. Alternatives: emission facts in the finished key itself (the keys would depend on emission’s call graph); a hash of the finished code (costs an encoding of every function each build).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-cache): The passes still run over every instance on every build; devirtualization’s fixed point runs over per-function summaries (the set of objects a receiver or a result may be) and rewrites only functions that call through a table, and the dispatch sites are found once per position and class or trait. Both give byte-identical text. WHY: measured on marshal, the passes are not where lowering an unchanged instance costs most, and running them only where facts changed needs every function’s post-pass code, scalar summary and fence fact cached under a key over its callees’ (a key over a cone of the call graph, with dispatch targets as edges); that is a design of its own. Review with the user: it is what stands between the cache and a lowering phase proportional to an edit. Alternatives: build the cone keys now.

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-cache): The cache is opt-in in this step: AVIN_INCREMENTAL (on, verify, off) for avin build and avin emit-llvm, in .avin/build/incremental/<kind><level>/. WHY: item 7 of the plan makes build, run, test and the language server use it by default once the corpus has run warm. Alternatives: on by default now. Superseded by the Proposed default for every command that builds (branch incremental-default).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-cache): The store is a file per module named by a hash of its module and keys, with a length and CRC-32 header, a manifest written last, and no lock; a file is kept only if the build read it whole, and files neither named nor used in the last hour are trimmed, with no size limit. WHY: a name from the keys costs nothing to compute (a content hash would hash about 190 MB per build on marshal), the CRC catches truncation and damage, and two builds write the same bytes for the same keys. Alternatives: an entry per file (41,000 files per build); a SHA-256 per file; a size limit as the unit cache has (the unit cache’s hour rule already keeps it to what recent builds used).

  • Settled on the user’s delegation 2026-11-11 (built on branch instance-cache): verify compares the whole text and names the first function that differs, in the clean build’s order, or the first line where no function does. WHY: the function’s symbol says which key missed a dependency; its key adds nothing a reader can act on. Alternatives: compare instance by instance before emission (needs the clean build’s instances matched to the cached build’s).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-string): String character-wise and parsing methods. Choices the spec did not settle, in types.md:

    • toBool is exact. Only "true" and "false"; toBool traps with the number-parse message (For input string: "…") on anything else, toBoolOption answers None. Why: a parse that accepts "True", "1" or "yes" hides data errors, and the exact form is the one every program can state. Alternatives: case-insensitive; also "1"/"0".
    • A radix outside 2 to 36 traps, in the Option forms too. Why: a bad radix is the caller’s bug, not bad input, so None would hide it. Alternative: None from the Option forms.
    • Radix digits are ASCII 0–9 and a–z, either case, with the optional +/- sign of the decimal forms, and no prefix ("0x10".toInt(16) is not a number). Alternatives: accept a 0x/0b prefix where it matches the radix.
    • split(sep, limit): limit is the most pieces; the last holds the remaining text. A limit of 0 or less means no limit, 1 returns the whole string as one piece. Why: the reading that needs no special negative case beyond “no limit”. Alternatives: a limit of 0 dropping trailing empty pieces; a negative limit trapping.
    • stripLineEnd removes one terminator, \n or \r\n, never a lone \r, agreeing with lines(), which does not end a line at a \r either. Alternative: also a lone \r.
    • compareIgnoreCase compares the two after toLower, as equalsIgnoreCase equates them, so its sign is compare of the lower-cased strings. Alternative: comparing character by character after upper-casing.
    • charIterator() is a lazy Iterator[char] reading the string by offset, with next() on an exhausted one trapping like every iterator. map/flatMap/filter on a string answer a string, not an iterator, and tail/init trap on the empty string as Seq‘s do. Review with the user: whether toBool should be this strict, and whether the Option forms should answer None rather than trap for a radix outside 2 to 36.
  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-ordering): clamp(x, lo, hi) is a free function, and Vector has no Ord yet. A method x.clamp(lo, hi) on every Ord type needs impl[T: Ord] T, which the checker refuses (an impl adds to a type parameter only where it is bounded by Integer alone), so clamp is a free function beside max and min, which are free functions too; it traps where hi < lo. Why: it reads like max/min and needs no language change. Alternatives weighed: widening the blanket impl rule (a language change with a wide reach); a method on Integer only (leaves strings, chars and reals without). impl[T: Ord] Ord for Vector[T] is refused because Vector is an abstract covariant class, whose added methods are variance positions, and compare(other: Vector[T]) takes T in; ArraySeq is a final class and has its Ord. Seq[T] gets no compare method. Review with the user: how Vector should be Ord. The recommendation is that a method a trait impl adds, and no subclass overrides, is called through the static type rather than the method table, which would make compare on a covariant abstract class sound; that is a language change, so it waits for the user.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-ordering): Reverse, compareBy, reverseOrder and thenBy are in avin as plain names. Reverse is a data type with Ord reversed and equality as T‘s; descending sorts are written with it rather than a sortedDescending(). Why: it composes inside tuple keys, which a descending method cannot. Alternatives weighed: sortedDescending/sortByDescending on Seq (do not combine with a second key).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-seq): Seq search, slices and combinatorics, collections:

    • search answers the first of equal elements. Found(i) is the lowest index holding an element equal to the one searched for, found by a lower-bound halving, so the answer is deterministic. Why: a binary search that stops at the first hit returns whichever duplicate the midpoints reach, which no caller can rely on and a test cannot pin; the lower bound costs the same O(log n) comparisons and makes Found(i) and InsertionPoint(i) one index (i is where the element is or would go, the insertion point of an equal element being its first). Alternatives: any equal element, unspecified (cheaper by at most one comparison, not testable); the last one.
    • search(x, from, until) holds its window to the sequence (until to 0 .. n, then from to 0 .. until) rather than trapping, as counts are held (take, drop) and unlike slice, which traps. Why: the window is a bound on where to look, not an index range to read, and an empty or out-of-range one has the clear answer InsertionPoint of its edge. Alternative: trap as slice does. searchBy(key, wanted) is included (the plan marked it optional); it takes the key function first, as sortBy‘s sibling distinctBy does, and K: Ord.
    • combinations and permutations are distinct by equals and ordered by first appearance. The classes of equal elements are found with a hash map on the elements (as distinct does), so equals and hash must agree, and the vectors come in dictionary order of the classes’ first appearance. Why: the dictionary order is stepped with O(k) or O(n) work and no memory beyond the class counts, and needs no Ord. Alternatives: the order of a recursive generation, which differs for a multiset; positions rather than values (every permutation of equal elements, n! of them). k < 0 or k > n gives an empty iterator, k == 0 and the empty sequence’s permutations one empty vector.
    • indexOfSlice and lastIndexOfSlice find the empty slice where the edges allow: at max(from, 0) while that is no further than the length, and at min(end, n) while end >= 0; lastIndexOfSlice(slice) is the form with end the length, written as an overload as lastIndexOf is. patch holds from to 0 .. n and a replaced below 0 to 0 rather than trapping, and takes other as an Iterable[W] with W >: T, widening as ++ does. reduceRightOption accompanies reduceRight as reduceOption accompanies reduce. Alternative for all: trap on an out-of-range count, as slice does for indices.
    • inits() and tails() copy the elements into a vector once and slice it per step, so each step is O(log n) and the n + 1 vectors share structure; they are lazy iterators, not a vector of vectors. transpose() of rows of different lengths traps (the plan’s decision), and answers an empty vector, not a vector of empty ones, for no rows; for rows that are all empty it answers empty too.
  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-math): the integer methods are an inherent impl over Integer, not members of the trait. abs, sign, pow, gcd, lcm, floorDiv, floorMod, bitCount, leadingZeros, trailingZeros, isPowerOfTwo and toRadix are written once in library/avin/integer.avin as impl[T: Integer] T, which the core library may declare. Why: it gives every width the methods with no new trait and no change to the closed bound. The cost: a type parameter bounded by Integer sees only the trait’s members, so generic code cannot write x.abs(). Alternatives weighed: putting the methods in Integer as required members (every width implements them, but “no type implements it” then has an exception, and the arithmetic traits would grow by a dozen); leaving them to free functions (math.abs(x), unlike x.compare(y)). Review with the user: whether generic code should reach these methods, which means making them members of Integer.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-math): the bitwise and shift operators work on a type parameter bounded by Integer. x & y, |, ^, << and >> on a T: Integer are the machine’s operators at each instance’s width, with both operands T (x >> T(1)); the checker had treated every operator on a type parameter as a call of a method of that name, so Integer code had no bit operations at all. Why: the bound is documented as having every integer operation, and the integer methods need them. Alternatives weighed: methods bitAnd, shiftLeft on Integer (a second spelling of what the operators already say); doing the bit work by division and remainder (slower, and unreadable). A T with another bound still has them only as methods.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-math): choices inside the integer methods. pow(n: int) takes an int exponent at every width and traps on a negative one (a fraction is not an integer); x.pow(0) is 1 for every x, 0.pow(0) included. gcd is never negative and traps only when its value is MinValue‘s magnitude; lcm is 0 when either side is, otherwise positive. sign is an int, as are bitCount, leadingZeros and trailingZeros, which count at the width ((-1).bitCount is 32, zero has width leading and trailing zeros). toRadix writes lower case, a - and the magnitude, as f"%x" does, with no prefix, and takes int from 2 to 36 and traps outside it. Why: each is the usual meaning, the least surprising for a program moving between widths. Alternatives weighed: a long exponent (never needed; an int is enough for squaring by halves); a gcd that keeps a negative sign (an unsigned-looking result is what callers want).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-math): avin.math additions. round(x) returns a long, a tie going away from zero, and converts as long(x) does for NaN and out-of-range values; trunc(x) returns a real, as floor and ceil do, keeping a negative zero’s sign; ulp at the greatest finite value is the gap below it (a finite answer rather than infinity); nextUp and nextDown leave NaN and the infinity they move towards alone. Why: round is the one the program usually wants as an integer and rint is already the real form; the others follow the platform’s functions. Alternatives weighed: round returning real (no saturation story to tell, but the common use then needs long(round(x))); trunc returning long (loses negative zero and the large values). Review with the user: the round and trunc result types differ, which is unusual to read.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-iterator): The eager methods added to every Iterable answer vectors. scanLeft is a Vector[B], tapEach and concat a Vector[T] (Vector[W] for concat[W >: T]), span and partitionMap pairs of vectors, and flatten() of a collection of collections a Vector[T]; grouped and sliding answer the Iterator[Vector[T]] a sequence’s do, by delegating to the iterator’s forms. WHY: one predictable kind, the one partition, span and scanLeft on a sequence already answer, with no higher-kinded types to name the receiver’s own. Alternatives: Iterable[B] as the Iterable transformations answer (hides that it is a vector), or each collection keeping a same-kind form (a long tail of overrides). Review with the user: whether tapEach on a list should answer a list.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-iterator): An iterator’s new lazy forms are added by impl[T] Iterator[T], not declared in the trait. So padTo(total, element: T) and zipAll(other, thisElement: T, thatElement) take the element type in a parameter of the covariant Iterator, and the forms are found before the eager ones every Iterable has. An iterator whose static type is only Iterable gets the eager forms, as with map. Alternatives: trait members with lower-bounded parameters (padTo[W >: A]), which a program’s own iterator could override, at the cost of a widened result everywhere.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-iterator): it ++ other takes other as an ordinary Iterable and asks for its iterator() only once it is used up; concat on an iterator is the same lazy join. WHY: a strict argument reads like every other call, and the iterator taken late is what keeps a mutable other read as it is when reached. Alternative: a by-name other, which would delay even evaluating the expression.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-iterator): Iterator.from is two overloads over T: Integer, from(start) and from(start, step), not one with step = 1, since the default would have to be T(1) of the caller’s type. An element is computed when it is read, so from(int.MaxValue) gives int.MaxValue and overflow traps only when the element past it is read. Alternatives: a default parameter written T(1); int and long overloads only.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-iterator): The companion iterators compute when read. fill and continually evaluate their by-name element at each next(), tabulate calls f at each next(), iterate calls f before each element after the first, and unfold calls f when hasNext() is asked and holds the element it gave. WHY: an iterator does no work for an element that is not read. Alternative: fill and tabulate building a vector and iterating it, as the sequence companions do (eager, and fill‘s element evaluated before any is read).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-iterator): grouped and sliding on an iterator give the windows a sequence’s give, reading the next window when hasNext() is asked, holding no element beyond the current window, and trapping on a size or step below 1 at the call, with the messages a sequence’s use. BufferedIterator[A] is a public class with peek() (trapping with “peek on an exhausted iterator”) and peekOption(); buffered() on one wraps it again. flatten() is also on an iterator of collections, lazily, beside the eager one on every collection of collections. Alternatives: windows read at next() only (no lookahead, but hasNext() could not answer for a step that skips past the end); buffered() answering a buffered iterator itself.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-predef): an impl without for adds methods to tuple and function types built from its parameters (impl[A, B] (A, B), impl[A, B] (A) -> B), as the impl chapter already allowed for any type built from parameters and for traits, which function types are. The checker refused both (“an impl adds to a data type, a class, an object or a built-in type”; “an impl for every tuple of an arity implements a trait”); that was a bug against the design and is fixed. The choices the chapter did not settle: a function type’s methods reach the types that are subtypes of it (a data type or class naming it, sequences, sets, maps, partial functions), as a trait’s added methods reach its implementers, and the type’s own method of the same parameter types is found first, as for a trait; a tuple pattern stays exact, as other non-trait patterns do. A @sendable function type in the pattern matches only @sendable functions. Such an impl outside the core library is an extension, since the tuple and function types are the core library’s. Rationale: these follow the existing rules for traits and for patterns, with no new rule. Alternatives weighed: matching only receivers whose static type is a function type (a Vector would then lack andThen, though it is passed wherever an (int) -> T is); treating a @sendable pattern as plain (its methods would reach functions that may not run on another thread, against what the impl names).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-predef): an impl naming a tuple or function type has at least one type parameter. impl (int, int) with none begins a function named impl, since impl is a keyword only before a type and impl(…) declares a function; impl() -> int followed by a body reads either way, so no rule on the tokens can tell them apart. A part may be written out (impl[A] (A, int)). Alternatives weighed: allowing impl[] (an empty list says nothing and the parser refuses it for every impl); making impl a full keyword (breaks a function of that name). Review with the user: whether an impl for one concrete tuple or function type is wanted enough to reserve impl (.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-predef): require(condition, message) takes the message by name, so it is built only when the requirement fails, while assert(condition, message) takes a plain string. Rationale: require sits at the top of ordinary functions, called on every call, and its message usually interpolates the arguments; building it every time would cost the common path. Alternatives weighed: a plain string, as assert (cost on every call); changing assert to by-name as well (out of this item’s scope; it would be a separate change to a settled API). todo(message) takes a plain string, since it always traps. ensuring is not provided: it needs an impl for every type (impl[T] T), which only the integer family has; a postcondition is written with require/assert on the result.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-inplace): in-place operations on Buffer, Deque and Array, and StringWriter length and clear. Choices the spec did not settle: (1) remove(i, n) is an overload of remove(i), and its count parameter is named n, so it never shadows the buffer’s own count. A range not within the collection traps (n greater than length() - i included, tested without overflow); n = 0 at length() is allowed. (2) subtractOne(x) answers a bool (whether one was taken out) rather than the collection, and is declared in an impl[T: Eq] block, so it exists only where elements compare; it takes the first match, from the front. Alternatives: returning self for chaining (hides a miss), and a -= operator (a bool-valued compound assignment reads badly). (3) filterInPlace and mapInPlace trap when the predicate or function changed the length, instead of leaving the outcome unspecified or silently working on a snapshot: the check is one comparison per element and turns a corrupted result into a trap at the caller’s line. Alternatives: iterate a snapshot (hides the bug and costs a copy), or leave it undefined. (4) mapInPlace takes (T) -> T, since the element type cannot change in place. (5) patchInPlace(from, other, replaced) reads other first and traps for a from or replaced outside the collection, where a clamping rule would hide a wrong index. (6) fillInPlace is a separate name from the companion’s Array.fill, as fill there makes a new array; it shares the one value as fill does. (7) Array.copyTo(dest, at, from = 0, count = length() - from) gives count a default that is a function of from, which the declaration rules allow; it is overlap-safe in both directions (the copy runs backwards when dest is the same array and at > from). All ranges are checked before the first element moves. (8) StringWriter.length() is an int count of bytes, as every offset into a string is, and clear() drops the stored text so a text already taken is unaffected. A write(x: Display) overload on Writer is not added: it would sit beside write(text: string) (a string is Display) and make every call a resolution by specificity for no gain, writeDisplayed already writing any Display value. Revisit if a user wants out.write(42). Review with the user: the length-change trap in (3), and leaving out write(x: Display) in (8).

  • Settled on the user’s delegation 2026-11-11 (built on branch neg-nan-sign): Unary minus on a real flips the sign bit of every value, NaN included (the machine’s negation, not -0.0 - x, which leaves a NaN’s sign as it was), and math.signBit(x: real) -> bool answers whether the sign bit is set, so the sign of a NaN or a zero can be observed. WHY: negation is the sign flip for every value in IEEE 754, and without signBit a program could tell a NaN’s sign by no means (hash makes every NaN one value and both print as NaN). Alternatives: reading the sign through copySign(1.0, x) only (works, but reads as a trick).

  • Settled on the user’s delegation 2026-11-11 (built on branch union-mir-words): Values of more than one machine word in the intermediate code (the first part of the union tag-and-payload layout, under Settled → unions → Representation).

    • Each word is a value of its own (scalar replacement): as parameters a multi-word value is one parameter per word, in a local one slot per word, in an object or a closure one field per word, and a merge at a join is one slot per word. Only a result needs new forms: a signature’s rest lists the types of the words after the first; a call defines the first word as its value and each later one with CallWord, a return gives the first as its value and each later one with ReturnWord; LLVM returns the words as one structure, in registers. Why: every word is an ordinary typed value, so the frame plan roots exactly the words of reference type, wherever each is live across a collection point, and never a scalar word, with no change to how roots are found. Alternatives: an LLVM structure value carried whole (the root plan would have to look inside it); returning the later words through slots of the caller passed by address (a slot whose address is passed is no root the plan follows); returning them through the thread’s context (a store and a load per word, and a window where a reference is in no frame).
    • Proven on tuples taken apart from calls: val (a, b) = f(x), where f is one of the program’s functions with a body (not a constructor, a trait’s method or a binding) and the tuple has at least two parts with runtime values, calls a copy of f, f#words, that answers with the tuple’s parts, one word each; every return reads the parts out of the tuple, which is then made and read in one function and kept as its parts, and a call in tail position of a function yielding a tuple of the same words passes its words straight on. So a recursive or large function answering with a tuple no longer allocates it for a caller that takes it apart; a caller that keeps the tuple calls f itself, which still makes it. Why: a real path the existing programs run, with references beside scalars in every combination, and with no change to any type’s representation or to what a program sees. Alternatives: a compiler-internal pair type no program could reach (exercised only by tests); every function yielding a tuple answering with words and callers that keep it making it again (a made-again tuple’s type record could differ from the one the function made, which a type pattern on an Any would see).
    • A small function answering with words is inlined where it is called, each later word through a slot of its own, so val (q, r) = divmod(a, b) still makes no call and no tuple. Guarded calls through a method table meet in one value, so devirtualization leaves a call of several words through the table rather than guarding it. A call in tail position whose every word the block returns at its own place is a tail call, its whole result returned, so functions answering with words call each other in constant stack as functions yielding tuples do. Alternatives: never inlining such functions (a call where there was none at -O0); no tail calls of several words (deep mutual recursion through val (a, b) = f(x) would overflow the stack).
  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-priority-queue): PriorityQueue gives the greatest element first (branch stdlib-priority-queue), collections. PriorityQueue[T]() orders by T‘s Ord, and PriorityQueue.withOrdering(compare) by a comparison; the element compare finds greatest comes out first. Why: it matches max, which every Ord type already answers, and dequeue then takes the same element max() would; a least-first queue is one Reverse or reverseOrder away either way. Alternative: least first (the order of a sorted sequence read from the front, the usual choice for shortest-path searches); it makes PriorityQueue[int]() the odd one out against max. Review with the user: it is the default every caller will meet.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-priority-queue): A queue’s iterator() and toVector() are in heap order, and toSortedVector() is the sorted form (branch stdlib-priority-queue). Heap order starts with the greatest element and is otherwise unspecified; the iterator is a snapshot taken when it is made, so enqueuing or dequeuing while iterating neither traps nor changes what it gives. Why: heap order costs nothing, a sorted iteration costs O(n log n) and a copy, and Iterable conformance wants the cheap one; a snapshot makes mutation during iteration defined. Alternatives: iterating in dequeue order; an iterator over the live heap (cheaper, but what it gives after a change is arbitrary).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-priority-queue): Equal elements come out in no promised order (branch stdlib-priority-queue): a binary heap is not stable. Alternative: a sequence number breaking ties first-in-first-out, at the cost of a word per element and a wider comparison; a caller wanting it orders by thenBy on its own counter.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-ordered-map): Insertion-ordered maps and sets: names, update order, equality (branch stdlib-ordered-map). The concrete types are OrderedMap[K, +V] and OrderedSet[A], conforming to the traits SeqMap[K, +V] and SeqSet[A]. Why: the concrete names say what the collection does, as HashMap says how it finds and TreeMap how it sorts, and no implementation (a vector of keys) leaks into them; the trait names follow the sequence-like “in the order added” meaning of Seq. Alternatives: VectorMap/VectorSet (names the layout, not the behaviour), InsertionOrderedMap, LinkedHashMap-style names, and OrderedMap as the trait with the concrete type named for its layout. Update order: updating a key already present keeps its place and replaces its value; removing and re-adding moves it to the end. Why: an update is not a new arrival, so a map used as a record keeps its field order. Alternative: an update moves the key to the end. Equality: two maps are equal when they hold the same keys bound to equal values, and two sets when they hold the same elements, whatever the order, and equal ones hash alike, so an OrderedMap equals a HashMap of the same entries as every kind of Map does. Why: the existing rule makes map equality independent of the kind, and an order-sensitive == on one kind would break transitivity through the traits. Alternative: an order-sensitive == between two ordered maps (reached by comparing iterator()s). Layout: a hash trie from key to slot and a vector of slots, removal leaving a gap, compacted when gaps exceed both eight and the entries. map, collect and flatMap through the trait answer hash-based collections, as for TreeMap through Map. A {k: v} or {a, b} literal builds one where SeqMap, OrderedMap, SeqSet or OrderedSet is expected. Review with the user: the names.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-ordered-map): A call through a method table or a bound reaches only methods of types that conform (branch stdlib-ordered-map; a fix, recorded because it changes what the polymorphic-recursion check reports). The type arguments of a method’s own type parameters flowed into every method of the same name and arity of any type, so a generic method that called a sequence’s updated with a type built from its own parameter was reported as recursing into itself. They now flow only into methods of types that have the called method’s class or trait among their ancestors. Alternative: keep the name-only approximation and rename the method (rejected: updated is the name every map has).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-linked-map): avin.collections.mutable.LinkedMap[K, V] and LinkedSet[A], the insertion-ordered mutable map and set. The choices:

    1. Re-binding a present key keeps its place; putLast(k, v) and moveToEnd(k) (and a set’s addLast and moveToEnd) make it the newest, and a key removed and bound again is new. Why: m(k) = v is a plain update everywhere else, and an insertion-ordered map whose update reorders it would make m(k) += 1 shuffle the iteration; an LRU cache that wants the move says so with moveToEnd. Alternatives: every put moves to the end (access order for caches, but surprising for a plain map); a constructor flag selecting access order (one type with two behaviours).
    2. Equality and hash ignore order: two linked maps (or sets) are equal when they hold the same entries, as two mutable maps are; a LinkedMap is not comparable with a Map of the other kind (they are different classes). Why: == on maps is about contents, and the order is observable through iteration anyway. Alternative: order-sensitive equality, which makes {a: 1, b: 2} differ from {b: 2, a: 1}, unlike every other map.
    3. The oldest and newest ends: headOption() and lastOption() answer the ends in constant time (overriding Iterable‘s, so head() and last() trap when empty), and removeFirst() and removeLast() answer the removed (key, value) (a set’s, the element) and trap when empty. Why: removeFirst is the eviction step of an LRU cache. Alternatives: removeFirst answering an Option (an empty map is then silently ignored by a cache that expected an entry); pollFirst-style names.
    4. Mutation during iteration: replacing values and removing entries are defined (a removed entry the iterator has not reached is skipped); binding new keys never traps but whether the iterator visits them is not defined. Why: the entries sit in a buffer, a removal leaves a gap the iterator skips, and the buffer is squeezed only by an insertion, which hands the map a new buffer and leaves an iterator in progress stepping through the old one. Alternative: trapping on a structural change (a version counter), which the other mutable maps do not do either.
    5. Representation: a Map[K, int] from each key to its position, and a Buffer of entries in insertion order with gaps for removed ones, squeezed when gaps are half of at least 32 positions; every operation is amortized constant time. Alternative: open addressing with order links threaded through the table, one structure instead of two but a second copy of the table’s removal logic; it can replace this without changing the API.
  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-queue): Queue[+T] (immutable, two lists), built by the stdlib-queue branch.

    • Choice: Queue is an abstract covariant class with a private two-list implementation, so its constructor cannot be called with a state that breaks the invariant (the front is empty only when the back is). It has Queue(xs*), Queue.empty[T]() and Queue.newBuilder, but no tabulate or fill, no ++, and no literal form. dequeue() answers (T, Queue[T]); front() is the name of the head read; apply(i) is O(i) and map/filter answer queues.
    • Why: the abstract class keeps the invariant that gives constant-time front() and amortized constant dequeue; a pair return keeps the type immutable; Seq conformance gives equality, hashing and the sequence methods for free, so a queue equals a vector of its elements.
    • Alternatives weighed: a data type with public Cons-like variants (exposes the lists and the invariant); a banker’s queue with lazy rebalancing (worst-case bounds, but heavier and no better for the usual single-threaded use); dequeue answering Option only (loses the trap that every other removeHead has); head/tail names only (they remain, from Seq, with tail answering a Vector).
  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-bitset): BitSet (immutable and mutable): representation and negatives (branch stdlib-bitset). Proposed: the immutable BitSet is a class over a Vector[long] of words, kept without empty words at the end, so an update copies one path and toBitMask() is the words; the mutable one is over a Buffer[long]. A negative element is not in any bit set: contains and excl/remove treat it as absent (false, set unchanged), and everything that would add one traps (incl, ++, apply, the builder, add, +=, ++=, addAll); the ordered queries and slices take any int. Why: a query about a number that cannot be present has the honest answer “no”, which keeps generic code over Set[int] from trapping on s(x), while storing a number the set cannot hold must not silently succeed. Alternatives weighed: trapping in contains/remove too (strict, but breaks Set[int] code that probes with arbitrary ints); ignoring negatives in incl (silently drops an element, so s.incl(x).contains(x) can be false); offsetting by a minimum (a different set type). Review with the user if bit sets of negatives (a signed range) are wanted.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-bitset): BitSet method names beyond the Set ones (branch stdlib-bitset). Proposed: the immutable set adds symmetricDiff and toBitMask, with BitSet.fromBitMask; the mutable one adds unionInPlace, intersectInPlace, diffInPlace, symmetricDiffInPlace (taking a mutable bit set), the non-mutating union, intersect, diff and symmetricDiff over mutable bit sets, copy() and toSet() (the immutable one), beside the mutable Set‘s add, remove, addAll, +=, -=, ++=, --= and filterInPlace. Why: the …InPlace suffix names the in-place form of a method the set already has (as filterInPlace and sortInPlace do) and spells out what the symbol forms |= and &= would, which are free method names but carry no word for a reader. Alternatives: |=, &=, -= as the in-place algebra (-= is taken by removing an element); unionWith and so on (suggests a combining function); addAll(other) for the union (already means adding elements of any Iterable). symmetricDiff is xor in some libraries; the longer name reads without knowing bit-twiddling. The mutable bit set’s union/intersect/diff take a mutable bit set only rather than any Set[int], the mutable Set not being a Set trait member either.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-bitset): A mutable BitSet iterates over a snapshot, and its ordered queries copy it (branch stdlib-bitset). Proposed: iterator(), headOption(), lastOption(), minAfter and maxBefore of a mutable bit set read an immutable copy of its words, so changing the set during a for is safe and visits the elements it had when the loop began. Why: it makes the iterator the same code as the immutable one, and a mutable hash set’s iterator has no defined behaviour under change at all, so a stable one is the safer promise. Cost: one pass over the words per call, so a loop calling minAfter repeatedly on a large sparse set is quadratic in the words. Alternative: a live iterator that reads the words as it goes (no copy, but sees its own changes); revisit if minAfter is used as a scan.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-mutable-tree): A mutable tree map or set holds an immutable one and replaces it; iterating it while updating it is legal and sees the collection as it was. avin.collections.mutable.TreeMap and TreeSet keep a private immutable TreeMap or TreeSet and assign a new one at each update. Why: the persistent tree is already balanced and tested, its SortedTree is private to module avin (so a second module could not share it without widening it), every ordered query comes for free, and toTreeMap()/toTreeSet() become O(1) snapshots. Consequence: an iterator made before an update visits the entries as they were, so a loop that removes or adds entries cannot skip, repeat or fault, unlike the hash-based mutable collections, whose iteration while updating is unspecified. Alternatives weighed: a mutable balanced tree with in-place rotations (faster constants, no allocation per update, but a second tree implementation, and iterators would need invalidation rules); a skip list (same objection). Updates allocate O(log n) nodes, which a mutable tree would not; revisit if a profile shows it. Review with the user: the snapshot-iteration guarantee is a promise a later in-place tree would have to keep.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-mutable-tree): Two types are named TreeMap (and TreeSet), one in avin and one in avin.collections.mutable. As Map and Set already are. Inside the mutable module the bare name is the mutable one and the immutable one is imported under an alias; a program importing the mutable one unaliased while also using the prelude’s gets the mutable one for the bare name, and reaches the immutable one through an aliased import (both forms are tested). Alternatives: distinct names (MutableTreeMap) which would break the parallel with Map/Set.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-mutable-tree): removeFirst()/removeLast() trap on an empty collection; removeFirstOption()/removeLastOption() answer None. The immutable sorted collections pair head() (trapping) with headOption(); the removal operations follow the same split, the plain name being the trapping form. Alternatives: answering an Option from the plain name (as remove(key) does), or a pollFirst name.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-mutable-tree): The range* forms of a mutable tree collection answer a new mutable collection, not a view. As filter and copy() do on the hash-based mutable collections; a write to the slice does not reach the original. Sharing the tree makes the slice O(log n) to make. Alternative: live views, which would need the mutable tree to be in place.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-mutable-tree): A mutable tree set’s union, intersect, diff and subsetOf take a mutable tree set, as the mutable hash set’s take a mutable hash set; the keySet() of a mutable tree map is an immutable TreeSet snapshot, as a mutable Map‘s is an immutable Set.

  • Settled on the user’s delegation 2026-11-11 (built on branch tuple-result-override): an override’s or an implementation’s result may be any type seen as the declared result with no conversion (declarations), the covariant position generics already names: -> (Dog, Dog) overrides -> (Animal, Animal), -> (HashMap[K, V], HashMap[K, V]) implements -> (Map[K, V], Map[K, V]), -> Option[Dog] overrides -> Option[Animal], -> () -> Dog overrides -> () -> Animal, and -> string overrides -> Any. A result that would need a box (-> int for -> Any, -> (int, int) for -> (Any, int)) or that differs at an invariant argument (Array[Dog] for Array[Animal]) is still refused. Rationale: the chapter said “for a class, a subclass”, which refused exactly the shapes the variance rules call subtypes with one representation, so a value returned through the base needs no conversion; the checker now asks the same no-conversion question an element of a covariant collection does. Alternatives weighed: keeping results to classes only (tuples and covariant instances then need a differently named method, as own-kind partition met); also boxing a scalar result, which would make an override’s call site convert behind a virtual call.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-lazy-list): LazyList[+T] is a class whose cell is a private lazy val, and the expression that computes the cell is dropped once it has run. The cell is Option[(T, LazyList[T])]; the class holds a function that reads the real expression out of a captured variable and empties it, so an evaluated cell keeps nothing the expression captured. WHY: a covariant class may hold no var of its element type, and a lazy val is the one immutable field that is computed once and kept, with its trap on a read during its own evaluation. Keeping the expression would hold everything it captured for as long as the cell lives (a filter cell would hold every source cell it skipped). ALTERNATIVES: an invariant node class with vars (the list could then not be covariant); a var of type Any cast back on each read (no type checking of the cell); keeping the expression (simpler, a space leak).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-lazy-list): LazyList.cons(head, tail) takes the head strictly and the tail by name, and the tail is evaluated when the list’s second cell is first read, not when the first is: xs.head never evaluates the tail expression. WHY: the first cell is then exactly the head, and a function building a list recursively runs one step per cell read. ALTERNATIVES: a by-name head too (a cell would then be one more function for a value usually at hand); evaluating the tail with the first cell (one list fewer per cell, but head() runs the next step).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-lazy-list, replaced on branch lazy-cons-operator): x +: xs prepends to a lazy list already made, and LazyList.cons(x, tail) is the delayed form. The user then decided (2026-11-11): “yes, a lazy head #:: tail operator would be good to include.” The operator is the entry below; +: stays strict.

  • Settled on the user’s delegation 2026-11-11 (built on branch lazy-cons-operator): A companion object may declare an operator ending in : with its right operand by name, and x op: r calls it where r‘s type is the companion’s type. object LazyList declares #::[T](head: T, tail: -> LazyList[T]), so 0 #:: 1 #:: fibs.zip(fibs.tail).map((a, b) -> a + b) evaluates its tail only when the cell after the head is first read. The right operand’s type decides which op: is called, and that type is known only once the operand is checked, so wherever some companion declares op: this way, the right operand of every x op: r is checked as a delayed expression; a type whose op: is its own strict method evaluates it once at the call, after x, as before. A type with its own op: whose companion also declares one makes the call an error naming both. Where the call is expected to give a type whose companion declares the operator, the right operand is checked against that type (val xs: LazyList[long] = 1 #:: 2 #:: LazyList.empty() takes long literals). WHY: it reuses two rules the language already has, a companion holding what belongs to a type and by-name parameters with all their restrictions, and adds no declaration syntax; the operator reads as the list it builds, and nothing changes for operators no companion declares so (+:, ::, :+). ALTERNATIVES: a by-name receiver for a method (self a delayed expression: no value to dispatch on, a new declaration form, and every bare member read in the body would evaluate it again); a lazy modifier on a method (reads as a memoized result); :: building a lazy list where one is expected (overloads the language’s own List operator on the expected type); a special case for LazyList in the checker (not available to other types). Review with the user: the cost of the rule is that a return, break or continue inside the right operand of #:: is an error on every type, since LazyList declares #:: for the whole program.

  • Settled on the user’s delegation 2026-11-11 (built on branch lazy-cons-operator): # is an operator character, and a leading # is passed over when a symbol name’s level is decided: #:: binds as ::, #+ as +, a name of # alone (##) binds tightest, and a single # is no operator. WHY: #:: must bind more loosely than arithmetic (n + 1 #:: rest), and a # prefix marks a variant of an operator without changing how it reads. # was unused in code before, so no program changes meaning. ALTERNATIVES: # at the tightest level as other unclaimed characters are (then n + 1 #:: rest would be n + (1 #:: rest)); # its own level. This replaces the earlier note that # is no operator character, which kept avin.process from spelling #|; those combinators keep their word names.

  • Settled on the user’s delegation 2026-11-11 (built on branch lazy-cons-operator): There is no head #:: tail pattern. A pattern names an extractor by a word (Name(p1, p2)), and the only operator written between a pattern’s parts is List‘s ::, so an infix extractor pattern would be a further language change. A lazy list is taken apart with headOption() and tail(). Review with the user if infix extractor patterns are wanted.

  • Settled on the user’s delegation 2026-11-11 (built on branch lazy-cons-operator): A lazy list’s cell read while it is being evaluated traps with a LazyList cell is read while it is being evaluated, checked by a flag the list’s progress record holds while its cell’s expression runs, rather than the lazy val‘s own message, which named the private field cell. ALTERNATIVES: keeping the lazy val‘s message (names an implementation detail).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-lazy-list): LazyList is an Iterable, not a Seq. WHY: a Seq answers length(), apply, lift, isEmpty, == and its hash through length(), which never returns on an endless list, and every eager method a Seq adds would build a Vector from it; sequence patterns over it would call length() too. As an Iterable it keeps the forcing methods every collection has, its own lazy forms found first. ALTERNATIVES: a Seq overriding the methods that would not return (most of them), or a Seq whose length() simply does not return on an endless list.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-lazy-list): A lazy list’s Display and Debug show the evaluated prefix and …, evaluating nothing: [0, 1, 4], [0, 1, …], […], with a field width padding the whole. WHY: displaying an endless list must return, and a display that evaluated cells would run a program’s functions while printing. ALTERNATIVES: forcing every cell (does not return on an endless list); a fixed prefix forced (side effects while printing); <not computed> text (longer, and not a form the other collections use). No Eq, Hash or Ord, which could not answer for two equal endless lists.

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-lazy-list): A lazy list is not sendable, so each belongs to the thread that made it; the cells’ lazy val evaluation would be safe between threads, but the expressions not yet evaluated are functions that may capture anything. ALTERNATIVES: sendable when every expression is a @sendable function (every lazy method would need a sendable form).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-lazy-list): zip takes another LazyList and stays lazy; flatMap takes (T) -> Iterable[U], reading each collection through its iterator as cells are read; ++ takes its right operand by name, evaluated only when the cell after the left’s last is read (the iterator’s ++ takes a strict Iterable, since an iterator is read once anyway); toLazyList() on every Iterable converts, since from is the integer counter’s name as on Iterator. Also added beyond the item: filterNot, zipWithIndex, fill, tabulate, lift, force() and isEvaluated().

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-map-extras): Map defaults, own-kind partition and Set.subsets (branch stdlib-map-extras). Proposed: withDefault(f) and withDefaultValue(v) on every map answer a DefaultMap, a wrapper whose apply of an absent key answers the default and whose every other read (get, contains, getOrElse, size, iteration, keySet) sees only the real entries; the default is never stored. updated, removed, ++, --, updatedWith and filter keep the wrapper and its default; transform and mapValues answer the wrapped map’s own kind, because a default of the old value type cannot be carried across the function. The wrapper equals, and hashes as, the map it wraps and every map of the same entries, ignoring the default. A default of a supertype widens the map, as updated does. Why: get answering Option is how a program asks whether a key is there, and a counter wants apply alone to be total. Alternatives weighed: get also answering the default (hides absence, makes contains and get disagree); the default taking part in equality (two maps of the same entries would differ by a closure that cannot be compared); the wrapper mapping its default through mapValues (needs the value function to be applied to a default on every miss, a surprise at each read). partition of a hash, tree or ordered map and of a hash, tree, ordered or bit set is a method of the concrete type answering that type, p called once per element; it is not on Map, Set, SortedMap, SeqMap, SortedSet or SeqSet, so through a trait a set’s partition is Iterable‘s and answers vectors, as the settled Iterable decision says, and a map’s partition of a pair function answers the own kind only where the type is known. Why: a tuple of two collections is not a subtype of a tuple of two supertypes in an override’s result, and a set’s partition over the trait cannot change Iterable‘s result type. Amended on the user’s delegation 2026-11-11 (built on branch partition-override): with an override’s result free to narrow, Map, SortedMap and SeqMap declare partition(p: (K, V) -> bool) answering maps of their own trait (Map carries a default built on removed, so a user class implementing Map needs no change), and each concrete map overrides it with its own kind, so a call through Map answers maps of the receiver’s kind. Sets keep Iterable‘s (Vector, Vector) through Set, since a set is not a vector and Set cannot narrow it; the own-kind set partition stays on the concrete types. Alternatives weighed: a Set.partition answering (Set, Set) (conflicts with Iterable‘s result, which is not a supertype of it). Alternatives weighed originally: trait methods answering (Map, Map) (the concrete type then could not narrow the result); two filter calls (calls p twice, which a predicate with an effect shows). subsets() and subsets(k) are iterators on Set that read the elements into a vector and generate combinations by size, so the order is by size then by position and nothing is made ahead; every subset is a set of the receiver’s kind. Why by size: the empty set first and the set last, the same order for every kind, and no 2^n counter to overflow for a set of more than 62 elements. Alternatives weighed: bitmask order (overflows past 62 elements, and puts the subsets in an order a reader cannot predict from the sizes).

  • Settled on the user’s delegation 2026-11-11 (built on branch stdlib-from): Companion from, Vector.iterate, unfold and the sorted conversions (branch stdlib-from). Proposed: from(xs: Iterable[T]) on every immutable collection companion and on the mutable ones (Buffer, Map, Set, TreeMap, TreeSet, LinkedMap, LinkedSet, BitSet, PriorityQueue), a map’s taking Iterable[(K, V)]; for a duplicate key the later pair’s value wins (an ordered map keeping the key’s first place), the rule apply and the builders already follow. Vector.iterate(start, length, f) takes the length as its second parameter and calls f length - 1 times; Vector.unfold and List.unfold are the eager forms of Iterator.unfold. toSortedSet() and toSortedMap() are impl blocks on Iterable bounded by Ord, like toSet() and toMap(). Why: one spelling that works for every source and target, where the collection-specific conversions need a method per pair. Alternatives weighed: a to(factory) conversion (needs higher-kinded types); a universal into(builder) (not added: builder.addAll(xs) already reads as well, and from covers the target-first reading); List.iterate/ArraySeq.iterate (not added; Vector.iterate(...).toList is one call); Array.from (left out as arrays are not in the item). Iterator.from(start) is the unrelated counting iterator and keeps its name.

  • Settled on the user’s delegation 2026-11-11 (built on branch union-tag-payload): The words of a union with a scalar member, and where they live (the second part of Settled → unions → Representation, built on the multi-word values above).

    • Three words: a 32-bit tag, 64 bits for a scalar member and, where a member is a reference, the reference. Tag 0 says the union holds a reference, whose header names its type; tag i + 1 says it holds scalar member i, the scalar members ordered by their type keys, so the order written never changes the layout. A scalar is kept in the bits as its value: an integer sign-extended, a byte and a char zero-extended, a bool as 0 or 1, a real‘s bits unchanged (so a NaN’s payload and a zero’s sign survive), unit as nothing. A union of scalars alone has two words. Why: the reference word is the only one the frame plan can root, and a separate 64-bit word holds every scalar unchanged. Alternatives: one word for the tag and the bits together (a long member needs all 64 bits); a word per scalar member (more words for nothing); numbering by the order written (int | string and string | int would differ).
    • In lowering, the union is a reference to its cell, an object of those words that is made once and only read; a function takes and gives each union as its words (MCell in a signature, replaced by the words before anything else reads the program), and makes a cell of the words it receives. So scalar replacement keeps every cell of a local, a parameter or a result as its fields in slots, and none of them allocates; a call in tail position passes its callee’s words straight on. Why: every operation on a union (injection, a match, ==, the hash, rendering) is written once, on the cell, and the existing scalar replacement makes it words everywhere a value stays in its function. Alternatives: lowering carrying several operands for one value through every expression form (a much larger change to every join, local and call path, for the same code after scalar replacement).
    • Where a union is stored (a field, an element, a capture, a module-level value, a generic type’s storage at a union argument), its cell stays an object, traced through its reference word, until those places lay a union out as its words too: storing a union allocates its cell as boxing a scalar did, a string member included. Why: one representation per type everywhere, so generic code at a union type argument needs no conversion where it meets its storage. Alternatives: converting to an Any at every such boundary (a box only for a scalar member, but a conversion at every generic call and field access, each a place to get wrong). Superseded by the next entry (branch union-words-storage): storage now holds the words.
    • Converting to an Any or a trait boxes a scalar member there and passes a reference member as it is; a member call through a trait every member has converts the union the same way, except display, debug and toString, which call the member’s own implementation by the tag with no box. === with an object compares the union as an Any, so a scalar member, a new box, is never identical to it. == and the hash are decided by the tag: two values of one member compare and hash as that member, and a reference as an Any, so a union and the same value as an Any are equal and hash alike. Review with the user: storing a union with a string member now allocates its cell where an Any did not, until fields and collections take the words.
  • Settled on the user’s delegation 2026-11-11 (built on branch union-tag-payload): Tuple type patterns by their parts’ layouts. Any are equal and hash alike. (The review flag this entry carried, a stored union with a string member allocating its cell, is closed by the next entry.)

  • Settled on the user’s delegation 2026-11-11 (built on branch union-words-storage): A union with a scalar member is stored as its words (the storage half of the entry above).

    • Every storage place holds the words: a field of a data value, a class or a tuple, an array element (so a Vector, a Buffer and a map), a closure’s capture, a captured var‘s box and a module-level value lay the union out as its tag (in an 8-byte slot), its bits and, with a reference member, its reference, 24 bytes or 16, and only the reference word is traced (a descriptor’s reference offsets, an array’s element map). Storing reads the words out of the value’s cell; loading makes a cell of the words read, which scalar replacement removes, so storing and reading allocate nothing for any member. Why: it removes the allocation the entry above flagged, and every place reuses one pair of helpers. Alternatives: the cell kept as an object in storage (an allocation per store, a string member included); converting to an Any there (a box for each scalar member, and type tests on read).
    • Generic code at a union type argument stores the words in each instance (Vector[int | string] holds 24-byte elements), never boxing at a generic boundary. Why: generic code is compiled per instance already, so the instance’s storage is the union’s own; nothing converts at a call. Alternatives: boxing a union to an Any where it enters generic code (an allocation per element and a type test per read, for no gain).
    • A module-level union keeps its tag and bits in its own 16 bytes and its reference word in a module-level reference of its own, named <value>#reference, after every value and lazy val state word. Why: the program’s roots are a frame of references, so the reference word has to be one of them; the rest is plain data. Alternatives: the cell kept on the heap for module-level values (an allocation per assignment of a var); teaching the root frame a word map (a runtime change for one case).
    • Atomic keeps a reference to a cell: its value is one word that load, store, swap and the hardware compare-and-set access indivisibly, so an Atomic[int | string] allocates the cell on each store. Why: three words cannot be swapped atomically without a lock. Alternatives: a lock for Atomics of unions (as for integers wider than 64 bits; slower for every operation).
    • A load from storage reads a tag of 0 (a reference) only beside a non-null reference word, and any other zero tag as the first scalar member’s. A racing read may combine a tag and a reference from two writes, as it may an i128‘s words, and an array element not yet filled is all zero; either way the value read is one of a member, never a null taken for a reference. Why: the promise that a race never breaks memory safety; it costs two compares and two selects per load. Alternatives: no check (a racing read could dereference null); a lock per union field (a cost on every access for a race the program should not have). Review with the user: a racing read of a union may now combine two writes, an exception the threads chapter states beside wide integers.
    • An integer member wider than 64 bits is kept boxed in the reference word under tag 0, its type told by its box’s record, so i128 | int has a reference word and injecting an i128 allocates its box. This fixes the layout above, which kept such a member in the 64 bits and lost its high bits. Why: the bits slot stays 64 bits for every union, and a wide integer, rare in a union, costs a box as it does in an Any. Alternatives: a bits slot as wide as the widest member (a layout per union type, and every helper and the call words taking a width); refusing integers wider than 64 bits as members (a gap in the language).
    • A tuple with a union part is not answered as words by val (a, b) = f(x): the call makes the tuple, and the parts are read from it. Why: a result’s words do not nest a union’s words yet. Alternatives: flattening the union’s words into the result’s (a later optimization).
  • Settled on the user’s delegation 2026-11-15 (built on branch union-tag-payload): Tuple type patterns by their parts’ layouts. A tuple type pattern matches a tuple whose type as made is seen as the target with no conversion, part by part: a part that is an object (a string, a tuple, a data value, an object of a class, a function, or a union of references) is seen as an Any part, so a (string, string) and a (Dog, string) are (Any, string)s; a scalar part, or a union with a scalar member, is only that very part, so an (int, string) is no (Any, string) and an (int, bool) no (int | string, bool); a part naming a union of references takes any object there and then tests that object’s own type against the members, so (Dog | Cat, int) matches a tuple made as (Dog, int), as (Dog | Cat, int) or as (Any, int) holding a Cat, and not one holding a Bird or a boxed number. A pattern on a tuple of known type that could never match by this rule is the error any such pattern is (a value of type (int, bool) is never a (int | string, bool), so this type pattern never matches). Why: the chapter’s rule that a tuple converts only where each part keeps its layout decides which tuples a pattern can take as its type; a union of references is laid out as an Any, so a tuple made with one records an Any there and only the object can say which member it is. Alternatives: matching only a tuple made with exactly the pattern’s type (what was built: ("a", "b") was no (Any, string)); testing every part by the value it holds (rebuilding the tuple at the pattern’s layout where a scalar part would need a box, an allocation hidden in a match). Review with the user: a union-of-references part tests the object, while a class part tests the type the tuple was made with.

  • Settled on the user’s delegation 2026-11-11 (built on branch incremental-default): The instance cache is on by default for every command that builds: avin build, run, test and emit-llvm. AVIN_INCREMENTAL=off turns it off, verify stays, and on, unset or empty are the default; any other value is an error for the commands that build, while avin check (even with --bindings) neither reads the variable nor keeps a cache. The language server only checks, so it has no build to cache. WHY: the whole corpus built warm under verify matched its clean builds, the commands’ tests hold every command to a clean build after an edit, and the cache needs no care (another compiler’s entries are misses and trimmed after an hour; damage is a miss). Alternatives: on for run and test only, build staying clean for release builds (a release build has the same oracle and gains as much); an --incremental flag rather than a variable (a flag every command would carry for a setting nobody changes per build). Review with the user: the disk it takes, about the size of the program’s text per kind and level (185 MB for marshal at -O2).

  • Settled on the user’s delegation 2026-11-11 (built on branch incremental-default): A program of one file names its cache directories after itself, .avin/build/incremental/<stem>-<kind><level>, while a directory or package keeps <kind><level>. WHY: every file of a directory shares that directory’s .avin/build, as their executables already do (named by stem); with one directory per kind and level, two programs built in turn would overwrite each other’s manifest and an hour later trim each other’s entries. The suffix is one of four fixed words, so no stem makes two programs’ names meet. Alternatives: a subdirectory per file (incremental/<stem>/program-O2, which a file named tests-O0.avin would make collide with a directory program’s); one shared directory (correct, since entries are content-addressed, but each program would lose its reuse in turn).

  • Settled on the user’s delegation 2026-11-11 (built on branch incremental-default): A manifest names only module files of its own directory: a name that is not hexadecimal digits and .mod is passed over as damaged and never read. WHY: a damaged manifest could otherwise send the reader to ../ paths outside the cache; nothing a build writes has another form. Alternatives: trusting the manifest (only the checksum would stand between a stray path and its contents being read as entries).

  • Settled on the user’s delegation 2026-11-11 (built on branch incremental-default): Code that calls the C unit’s glue is never taken from the cache’s lowered entries, and the glue it calls is part of its text’s key; a C callback’s body is keyed by its binding and its trampoline’s name. The warm corpus run found three stale texts: the glue (avin_c_call_<n>, avin_c_field_get_<n>, avin_c_retain_<n> and the rest) is named by the checker’s indices, which a declaration added earlier renumbers, and no key held those numbers; and every callback body had one key, so one binding’s callback took another’s text. WHY: the functions that call glue directly are the bindings’ own bodies, fields and handles, which are small and already mostly lowered every build, and covering the names in the text key also covers the copies inlining makes of them. Alternatives: name the glue by what it glues, as the stable names do for everything else (the right end state, but it changes the C unit and every place lowering calls into it); a digest of every C declaration’s number in every key (a declaration added anywhere would re-lower a C program whole). Review with the user: stable C glue names would let these functions be reused too.

  • Settled on the user’s delegation 2026-11-11 (built on branch incremental-default): The warm corpus run is chosen by AVIN_INCREMENTAL=verify in the environment of sysl test compiler: each corpus program is built cold with an empty cache, edited by adding a function nothing calls at the end of its first non-literate file, and built again from the cache in verify mode, which also builds it clean; the warm build is the one run. Unset, the gate builds each program once with no cache. WHY: the warm run builds every program three times, so it belongs before a release or after a change to the cache, not in every gate; the edit changes the source and the executable’s key but no line any program prints or traps at, so the corpus’s expectations still hold. Alternatives: the warm run in every gate (triples the corpus’s compile time); an edit inside a function (moves trap lines the .err files record, or changes what a program does).

  • Settled on the user’s delegation 2026-11-11 (built on branch site-prime-sieve): A program the website shows is run-checked from the page itself. In docs/content/**/*.md, a fence whose info string carries the word run after its language (```text run) holds a complete program, and the next fence, carrying output (```text output), holds exactly what it prints, with prose allowed between them. The corpus test builds every marked program at -O0 and -O2, runs it as an example is run, and fails naming the page and line when it does not compile, ends other than with exit 0, or prints anything but its output fence; a run fence with no output fence after it, an output fence with no run fence and a marked fence never closed fail the same way. Unmarked fences stay illustrations. WHY: the page is the one copy of the program, so what the reader sees is exactly what was built; the words after the language leave the rendered page as it was (the site renders the fence by its language alone); the run reuses the examples’ check, so a shown program meets the same standard as examples/. ALTERNATIVES: keep each program as a file under examples/ and check that the page’s fence is byte-identical to it (two copies to edit, and the output on the page would need a third check against the .out file); an HTML comment before the fence as the marker (invisible in the page but present in its source, and a second line to keep beside the fence); a literate .lavin page (the site renders indented code differently from fences).

  • Settled by the user 2026-11-12 (built on branch parameterless-methods): a method declared with no parameter list is called with no parentheses. head -> T = … in a class, trait, object or impl is called as xs.head; a method declared with () keeps them at the call, buf.clear(), iter.next(). account.deposit stays a method value, bound to its receiver, for a method with a parameter list. A parameterless method has no method value: the function that reads one is the lambda () -> xs.head, and there is no m _ form. REJECTED: omitting () at the call of any method of no parameters, since x.m would then be both a call and a method value, and the parentheses that mark a call with an effect would be gone.

  • Settled on the user’s delegation 2026-11-12 (built on branch parameterless-methods): parentheses after a parameterless method call what it yields. t.adder(4), where adder -> (int) -> int, calls the function adder yields, and t.items(2) indexes the sequence items yields; c.head, where head yields neither (or a sequence given no index), is an error naming the fix, “head takes no parameter list, so it is called without parentheses: write head, not head()“. The same holds inside the class by bare name and through super. WHY: x.m(a) must mean one thing, and the declaration says m takes no arguments, so the only call the parentheses can make is of the result; reporting x.head instead of reading it as a call keeps the rule visible at every wrong use. ALTERNATIVES: accepting x.head as a synonym of x.head (two spellings of one call, and it hides a callable result’s call); refusing parentheses after a parameterless method altogether (then t.adder(4) would need (t.adder)(4)).

  • Settled on the user’s delegation 2026-11-12 (built on branch parameterless-methods): the parameter-list shape is part of a signature. Overriding or implementing a parameterless method with a () one, or the reverse, is an error naming the shape to write; it applies to class overrides, trait implementations in classes and in a data type’s impls. WHY: a call site written against the trait must be valid against every implementation. ALTERNATIVE: letting the override’s shape win (a call through the trait and through the class would be written differently).

  • Settled on the user’s delegation 2026-11-12 (built on branch parameterless-methods): a public field implements an abstract parameterless method. A trait’s or an abstract class’s size -> int with no body is implemented by a method, or by a public val or var field of the name (a val class parameter included), or for a data type by a field of its one variant; the field’s type must be the method’s result. A private field does not, and is named in the error; a field still cannot share its name with a method that has a body (a default is not replaced by a field). The converse is unchanged: a trait’s abstract val is supplied only by a field. WHY: a parameterless method reads like a field at every call, so a class whose answer is stored should be able to store it; only an abstract one is implemented this way, so a default body is never silently replaced. ALTERNATIVES: methods only (a stored answer needs a method that returns the field); letting a field replace a default too (a field would override silently, without override). Reviewed with the user 2026-11-12 and kept: var fields are accepted, so a parameterless method may yield a different value at each read through the field.

  • Settled on the user’s delegation 2026-11-12 (built on branch parameterless-methods), then revised by the user the same day (next entry): only members are declared without a parameter list. A top-level function or a local function declared name -> T = … is an error naming name() -> … and val name = …. WHY: the smallest choice; a module value computed once is already a val, and the call-without-parentheses reading is what a member of a value needs. ALTERNATIVES: top-level parameterless functions called by bare name, recomputed at each read (a second kind of module-level name that reads like a val and is not one). Review with the user if module-level computed names are wanted. It was reviewed: the user chose the alternative, written with def.

  • Settled by the user 2026-11-12 (built on branch def): optional def; def permits a parameterless top-level/local function. def may begin any function or method declaration, members of a class, trait, object or impl, statics, top-level and local functions, with or without a parameter list and on functions defined by clauses, and means nothing more there: def f(x: int) -> int = … is f(x: int) -> int = …. At the top level and in a block, def now -> int = … declares a function with no parameter list, by the rules of a parameterless method: read by its bare name and run again at every read, parentheses after it calling what it yields (a function or a sequence given an index, and otherwise an error naming now), no function value (the lambda () -> now, named by the error where a function is wanted), no type parameters of its own, never assigned, the only function of its name in its scope and sharing that scope’s namespace with values. Written without def there, now -> int = … is an error naming def now -> … first, then val now = … and now() -> …. def is a keyword. Style: def is written only where it is required; the library and tests use it nowhere else, apart from the tests of the optional form. Also built on branch def: a method of a data type’s or a built-in type’s impl defined by clauses matches its arguments and not its receiver, as a class’s method’s clauses already did (they were refused for counting the receiver as an argument).

  • Settled on the user’s delegation 2026-11-12 (built on branch parameterless-methods): a parameterless method is the only method of its name in its type, inherited ones and the methods impls add included; and it takes no type parameters of its own, a parse error, since x.first[int] would read as indexing its result (its class’s type parameters it has). WHY: x.head calls the parameterless one, which leaves no call to choose another overload with. ALTERNATIVES: overloading resolved by whether parentheses follow (two methods behind one name with different call shapes); type parameters written x.first[int] (indexing and type application become ambiguous after a member).

  • Settled on the user’s delegation 2026-11-12 (built on branch parameterless-methods): naming a parameterless method where a function type is expected is an error naming the lambda, “head takes no parameter list, so it has no function value: naming it calls it; for a function, write a lambda, as in () -> x.head“, unless the method yields a function, which is then the value. super.name with no call reads a superclass’s parameterless method and is refused for one with a parameter list. WHY: the plain type mismatch (“expected () -> int, found int”) hides that the user meant a method value. ALTERNATIVE: the generic type-mismatch error.

  • Settled on the user’s delegation 2026-11-12 (built on branch parameterless-collections): the collections’ pure accessors are parameterless methods, on Iterable, Iterator, Seq, Set, Map, every immutable and mutable collection, Builder and their impls: head, last, headOption, lastOption, tail, init, size, length, knownSize, isEmpty, nonEmpty, min, max, minOption, maxOption, sum, product, reverse, distinct, indices, flatten, transpose, unzip, zipWithIndex, keys, values, keySet, toList, toVector, toArraySeq, toSet, toMap, toSortedSet and toSortedMap. Kept with (): iterator(), toArray() and toBuffer() (each a fresh mutable object), next(), hasNext(), buffered(), view(), peek() and every mutating method; the internal erasedSize()/erasedLength(). No accessor had an overload with parameters to give up: min/max with an ordering are minBy/maxBy, and the free min(a, b) and max(a, b) are functions, not methods. WHY: these answer from the collection without changing it, which is what a parameterless method says; one spelling across every collection, since the shape is part of the signature and generic code over Iterable[T] reads them the same way. Reviewed with the user 2026-11-12 and kept: an iterator is an Iterable, so it.head, it.size, it.toVector are parameterless too and read from it, against the rule that a method with an effect keeps its (). ALTERNATIVES weighed: keep these () on Iterable and convert only where the receiver is a collection (impossible while Iterator conforms to Iterable, the shape being part of the signature); split a Collection trait off Iterable for the accessors so an iterator keeps () (a library reshaping larger than this sweep); convert only head/size/isEmpty (a mixed spelling a reader has to memorise). Option, Either, Result, string and the numerics keep () for now (wave 2), since no trait they implement forced them.

  • Fixed 2026-11-12 (branch parameterless-collections): naming a parameterless method of a generic class or trait where a function is expected, val f: () -> int = xs.head on a Vector[int], now gives the lambda error: what the call yields is read at the receiver’s type arguments, where before the method’s own T hid it and the plain type mismatch was reported. The compiler’s own expansions (a for over an array or a range, a sequence pattern) read length and nonEmpty without a call.

  • Settled on the user’s delegation 2026-11-12 (built on branch def): def comes after the modifiers and the annotations, once: @tailrec on the line before, then private override static def f(…); def private f is an error naming private def f, def def f an error, and def before val, var or lazy val an error saying a value is declared without it. WHY: the modifiers describe the declaration and def begins it, so def sits next to the name it introduces, as val does in private val x; one place keeps declarations uniform to read and to search. ALTERNATIVES: def first and modifiers after it (def private f), or either order (two spellings of one declaration).

  • Settled on the user’s delegation 2026-11-12 (built on branch def): def name = body with no parameter list and no result type is a parameterless function or method whose result is inferred, at the top level, in a block and as a member (def perimeter = 2.0 * (w + h)). Without def a name followed by = is an assignment, so only def can say this. WHY: a parameter list’s absence is what def permits, and every other function may leave its result to inference; refusing it would make def require a written type for no reason of its own. ALTERNATIVE: requiring -> T after a parameterless def (one shape, more to write). An indented body after def name with neither = nor -> is refused, naming def name -> T = …, def name = … and name(), since a body run for its effect is declared with (). Review with the user: whether the inferred form is wanted at all.

  • Settled on the user’s delegation 2026-11-12 (built on branch def): def on a clause and on a field is refused: def belongs to a function’s signature, never to the clauses after it (a clause written with def is reported and then read as the clause it is), and def val x is an error rather than a field (then read as the val it is). WHY: one keyword per declaration, and a field already has its own. ALTERNATIVE: def accepted and ignored before a clause (two spellings of one clause).

  • Settled on the user’s delegation 2026-11-12 (built on branch def): override def and def on trait members change nothing about overriding: a parameterless def name -> T overrides or implements only a parameterless method, exactly as without def, and override is still required where it was. WHY: def adds no meaning to a member. ALTERNATIVE: def implying override (two spellings would mean different things).

  • Settled on the user’s delegation 2026-11-12 (built on branch def): the diagnostics for a parameterless function name it by its own name, also when it is reached through a module: val f: () -> int = clock.now reports “now takes no parameter list …, as in () -> now“. WHY: the checker sees the resolved function; the module-qualified spelling would need the source text. ALTERNATIVE: name the qualified spelling, () -> clock.now (more exact; a small later change).

  • Settled on the user’s delegation 2026-11-12 (built on branch grammar-tests): Settled on the user’s delegation 2026-11-12 (built on branch grammar-tests): the editor grammar tests run in the release flow, not in the compiler gate. sysl test editors/grammar-tests is a package of its own so the compiler gate does not need Oniguruma; it broke unnoticed on a Sysl upgrade because nothing ran it. scripts/release.sh runs it (step 03b-grammar, through the slot wrapper) before tagging, and the director runs it after any Sysl bump or grammar change. WHY: the grammar ships in the VS Code extension and the IntelliJ plugin, so a release must not carry a grammar whose tests cannot build; the run takes seconds. ALTERNATIVES: adding it to the compiler gate (couples the gate to a native Oniguruma build and to the highlighter package’s Sysl pin); a CI-only job (no CI runs here). Review with the user if the gate coupling is preferred.

  • Settled on the user’s delegation 2026-11-12 (built on branch runner-orphans): Every program a runner starts leads a process group of its own, and nothing in that group outlives it. avin test (each test and hook), the execution corpus and the documentation-programs check start each program with a new process group, so whatever it starts in turn is in the group too. Once the program has been waited for, whatever is left of its group is sent SIGTERM, given 200 ms to go (the same grace the system layer gives a program that outstays its limit), then sent SIGKILL: after every run, not only after a timeout, since a test that passed but left a server’s worker running orphans it just the same. A runner stopped by SIGINT, SIGTERM or now also SIGHUP (exiting 130, 143, 129) sends SIGKILL at once to every group still running, with no grace, because whoever stopped it is itself about to make it stop. WHY: the orphans found 2026-11-12 (a corpus program spinning for 8 h; two left idle for 30 h) were programs and grandchildren that the runner never reached once the timeout had killed only the leader, or once the runner itself was stopped. ALTERNATIVES weighed: enforcing the limit on the whole group at once (SIGTERM to the group at the deadline rather than to the leader first) needs a watchdog thread of the runner’s own in place of the system layer’s timeout, for a difference only in the order the grandchildren hear SIGTERM; a child-side check that its parent has gone (macOS has no parent-death signal, so every Avin program would poll); a longer grace (a test’s tidy-up has its whole limit already). Known limit: a runner killed with SIGKILL cannot act, and its programs, no longer in its group, are not reached by a signal sent to that group; marshal and sysl test both send SIGTERM first. A program that moves itself into another group or session is also beyond reach. avin run is unchanged: its program stays in the terminal’s group so that Ctrl-C and job control reach it.

  • Settled on the user’s delegation 2026-11-12 (built on branch field-shadow): A field may share its name with a trait’s method that takes a parameter list. x.name and a bare name read the field; x.name(args) and a bare name(args) call the method (a bare call is self.name(args), which already put methods first); through the trait or a type parameter it bounds only the method is seen. A method of no trait, or of no parameter list, still may not share a field’s name, and is reported at its own declaration; what a derived impl lacks is reported at the derives entry, never in the library’s template. WHY: display, debug, compare and the rest are ordinary field names (data Config(host: string, debug: bool)), and every data type derives Display and Debug without asking, so refusing the pair made such a type unprintable with an error inside format.avin; the read/call split is the rule member access and calls already followed, so no program changes meaning. A field holding a function under such a name is called by reading it first (val f = x.name). ALTERNATIVES: renaming the protocol methods to reserved spellings (breaks every hand-written impl and still leaves a name a field can take); having the library and templates call through a qualified trait form such as Display.display(x, …) (no such form exists, and it would fix only the library’s calls, not a program’s own impl); refusing the field with a better message (keeps debug: bool illegal). Review with the user: it widens what a type may declare.

  • Settled on the user’s delegation 2026-11-12 (built on branch main-result): main may answer with Result[unit, E] or Result[N, E] for any integer type N, and also with Result[Nothing, E]. An Err is written to standard error as error: followed by its Display, and the program exits with 1. The line is written before the exit hooks run. Ok(n) exits with n, as a plain integer main does. WHY: this lets a whole script use ?. The error: prefix matches the compiler’s own diagnostics and is what a command-line user expects. Status 1 is the ordinary failure status, and it is distinct from a trap, which ends the program with a signal. Allowing any integer type matches the plain main, which may yield any integer. Nothing covers main() = Err(…), whose Ok type is inferred as Nothing. ALTERNATIVES: allow only int in Ok (narrower than plain main for no reason); give each error type its own status (there is no agreed way to choose one, and a program that wants a particular status calls exit); trap on Err (a trap reports a source position and signals, which is wrong for an expected failure such as a missing file).

  • Settled on the user’s delegation 2026-11-12 (built on branch main-result): The error type of a Result-answering main must implement Display. There is no fallback to Debug. A union of errors needs Display on every member. WHY: the line is meant for the program’s user, and a Debug form, such as quoted strings or field names, reads as an accident. This is the same rule that applies to the error of a @test function answering Result[unit, E], so the two Result readers agree. Data types get Display automatically wherever their fields have it, so the requirement rarely costs anything. ALTERNATIVES: fall back to Debug when there is no Display (more programs compile, but some errors would be shown in a form nobody chose); show any value at all through the runtime renderer (same objection, and weaker). The user may want to revisit this if programs commonly hit errors that have only Debug.

  • Settled on the user’s delegation 2026-11-12 (built on branch parameterless-wave2): the rest of the standard library’s pure accessors are parameterless. The rule applied: a public method of no parameters is declared without a parameter list when it answers from its receiver (or, static, from its type), changes nothing, and hands out nothing to change or use up; the same rule wave 1 applied to collections, where reverse, distinct and the immutable conversions count as accessors. Converted: Option’s isDefined, isEmpty, nonEmpty, get, toList, toVector, toArraySeq, knownSize, flatten, unzip; Either’s isLeft, isRight, swap, toOption, toList, toVector, merge, joinLeft, joinRight; Result’s isOk, isErr, ok, err, toList, flatten; a pair’s swap; string’s byteLength, charCount, isEmpty, nonEmpty, isBlank, head, last, headOption, lastOption, tail, init, reverse, chars, bytes, lines, trim, strip, stripLeading, stripTrailing, stripLineEnd, capitalize, toUpper, toLower; char’s isDigit, isLetter, isLetterOrDigit, isSpaceChar, isWhitespace, isUpper, isLower, isControl, toUpper, toLower, asDigit; the integers’ abs, sign, bitCount, leadingZeros, trailingZeros, isPowerOfTwo; real’s isNaN, isInfinite, isFinite; Enumerable’s values (static), ordinal, name; StringWriter’s text, length, isEmpty; ByteView’s length; sorted, firstKey, lastKey, toTreeMap, toBitMask and a queue’s front, frontOption, dequeue, dequeueOption, toQueue, which wave 1 missed; regex’s pattern, regex, anchored, unanchored, groupCount, groupNames, matched, start, end, before, after, subgroups; time’s int and long micros … weeks, Duration’s toDays … toSecondsReal, isNegative, isZero, abs, Instant’s and Zoned’s epochSeconds/epochMillis/epochMicros, every Date, Time, DateTime and Zoned field reader (year, month, day, weekday, hour, startOfMonth, date, time, abbreviation, …), Period’s months/years and readers, Weekday’s isoNumber, Zone’s name and isFixed; every error type’s message; Url’s portOrDefault and queryParams, an HTTP response’s and request’s text, a request’s queryParams; ExitStatus’s isSuccess, Command’s clearEnv and inNewGroup; Weighted’s size; Json’s isNull, asBool … asMembers, keys, size, render, renderAscii. A trait’s static member declared without a parameter list is now read through a type parameter too, T.values (it was refused as “T is not defined”), and the infix-postfix diagnostic names both spellings, xs.size and xs.size(). Kept with (), the borderline calls: (1) string’s toInt(), toLong(), toIntOption(), toLongOption() have overloads taking a radix, and a parameterless method is the only one of its name, so they keep (), and toReal(), toRealOption(), toBool(), toBoolOption() keep them with them, one spelling for the family of parsers; stripMargin() likewise beside stripMargin(c). (2) The core traits’ members every type implements or derives — toString(), hash(), zero(), one(), negate(), shape(), Codec’s whenMissing() and jsonKey() — and so Duration’s and Period’s zero()/negate(), since changing these changes every program’s own impls and derives; review with the user, as a wave of its own. (3) Reads of shared or outside state: a Mutex‘s and a UI state’s get(), a signal’s read(), a future’s isCompleted()/value()/peek(), an executor’s isShutdown(), an actor mailbox’s isEmpty(), and every method of a file, socket, listener, child process or command’s handle (pid(), isAlive(), isClosed(), port()), whose answer can change under the reader. (4) Constructors and factories, Vector.empty[T](), BitSet.empty(), newBuilder(), copy(), Random(). (5) A UI view’s modifiers padded() and panel(), beside padding(n) and pad(…), one spelling for the modifier chain. (6) Private helpers and binding classes. Borderline converted: opt.get and s.head trap on None and on an empty string, as xs.head does; q.dequeue reads like an action but answers a new queue and changes nothing; a regex matcher’s matched, start and end read the current match of a cursor that findNext() moves, as a buffer’s size reads a buffer that push changes. WHY: one rule across the library, so a reader knows a call’s spelling from what it does; the families above stay uniform. ALTERNATIVES weighed: converting only the brief’s types (Option, Either, Result, string) and leaving char, integer, time and regex for later (two spellings for one kind of method, read side by side in the same expression, s.trim.toInt() beside c.isDigit()); renaming the radix overloads (toIntRadix(16)) so toInt could lose its () (a rename of a settled API for spelling alone); converting toString() and hash() now (every class’s impls change with them). A trap to know: opt.get() where opt: Option[() -> T] now calls the function the option holds; the library’s one such site was rewritten to opt.get.

  • Settled on the user’s delegation 2026-11-12 (built on branch bare-method-ref): a method declared with an empty parameter list, m(), named without a call is a function value only where a function type is expected. Anywhere else (println(xs.sorted), s"${s.isEmpty}", c.bump == 0, val v = c.bump with no type, an argument for a type parameter or Any), it is an error naming the call x.m() and the lambda () -> x.m(); among overloads with one of no parameters, a bare name with no expected function type gets the same error rather than “ambiguous”. Instance, static and trait methods alike; methods with parameters (account.deposit) are values wherever named, as settled. WHY: with parameterless and () methods side by side, a missing () is the commonest slip, and print takes Any, so it compiled and printed <function>; where a function type is expected the value is wanted and type-checks. ALTERNATIVES: refusing method values of () methods altogether (then spawn(worker.run) needs a lambda); a warning instead of an error (wrong output still ships); extending the rule to top-level functions of no parameters (they are always called with (), so the slip does not arise). Review with the user: val f = c.bump no longer infers a function.

  • Settled on the user’s delegation 2026-11-12 (built on branch bare-method-ref): a function value stays without Display, so interpolating one is an error, now with the hint “a function value is never shown: to show what it returns, call it”; print/println keep taking Any and show a function as <function>. WHY: the empty-list rule above already stops the missing-() slip at its source, and the remaining ways to print a function (a variable or lambda, a method value of a method with parameters) are deliberate; a special refusal inside print would make it unlike every other Any parameter, against its settled “one ordinary library function”. ALTERNATIVES: refusing a function-typed argument to print/println (a special case); refusing any conversion of a function to Any (breaks heterogeneous Any containers holding callbacks).

  • Settled on the user’s delegation 2026-11-12 (built on branch lazylist-perf): A lazy list’s cell is one object of three words, filled in place by the one function that evaluates it. LazyList[+T] holds pending (the evaluating function until it has run, a constant trapping function while it runs, then None), first and rest; an empty cell is one whose rest is itself, and a cell evaluated as another list’s first cell whose rest would be itself points at that other cell instead (the same element, then itself again), so a list that is its own tail still repeats. Making a cell allocates the cell and the function that evaluates it, and evaluating it allocates only the cells after it and the elements; a cell is read with a test of pending and no lock, since a lazy list is not sendable. To keep the element and the rest in a covariant class, the core library gains the intrinsic field_unset: private var x: T = fieldUnset() is a field the constructor leaves as the zero bytes the object was made with (not yet a value, as an array’s spare capacity is not), which the class’s own code writes before reading it; such a field must be a private var with its type written, is not a position for the class’s variance (it is written only with values computed for that instance), and the intrinsic is the core library’s alone; called anywhere but as a field’s initializer it traps (a field is read before it is set). Measured at -O2 (LazyList.from(0) and the stages named, then take(n), the cost per element; time under a loaded machine, user time): bytes kept per evaluated cell 256 → 48 (resident growth per held cell 304 → 96); bytes allocated per element of from, map, filter or take 304 in 7 objects → 96 in 2, and of #:: 544 in 13 → 192 in 4 (two cells, each with its function); time per element of from.take 0.118 → 0.035 µs, map 0.18 → 0.058, filter 0.24 → 0.079, #:: 0.18 → 0.065, the 4000th prime by the sieve 4.8 → 1.7 s; at -O0 from.take 0.16 → 0.06 µs. lazy_list_deep runs a million cells again. WHY: each cell was a LazyList object, a progress object, the closure of its lazy val, a box and a closure to drop the pending function, the function itself, and a tuple for the evaluated element and rest, with a lock-taking lazy val read on every access; the element and rest belong in the cell, which only a field left unset can hold, since a covariant class may not otherwise keep a var of its parameter and a field must otherwise be given a value when the object is made. The counts are pinned by lazy_list_cell_tests.sysl, which reads them from the code each maker compiles to; no runtime allocation counter was added, since the code is where an allocation is decided and the test holds however a run is timed. ALTERNATIVES: a cheaper lazy val (no closure per object) with the tuple kept (three objects per element, still a lock per read); Option[T] for the element (allocates a Some for every scalar element); a separate evaluated node per cell (two objects); an annotation exempting a field from variance, with an initial value supplied some other way (two mechanisms where one does); a runtime allocation counter exposed to programs (a hook in every allocation, for a check the code already answers). Review with the user: field_unset is a new escape from the variance and initialization rules, though only the core library may use it.

  • Settled on the user’s delegation 2026-11-12 (built on branch train-c-fix): Proposed (branch train-c-fix): an argument that cannot be checked before an overload is chosen is tried against each candidate. Where a lambda’s body, checked with its result left open (the rule map-flatmap added for flatMap‘s Iterable/Option overloads), reports an error, or a generic function named as a value cannot be checked without the parameter’s type, the argument is checked against each remaining candidate with nothing reported and nothing it settles kept; when exactly one candidate takes it, that one is chosen and the argument checked against it. Otherwise the argument is checked as before and reports what is wrong. A lambda whose body never returns (x -> fail(…)) fits every candidate, and the first declared is chosen (an option’s own flatMap on an option). WHY: with one flatMap, v.flatMap(n -> if … then aList else aVector) and xs.flatMap(identity) checked against its Iterable[U]; the second overload took that expected type away, so the branches no longer joined and identity could not be instantiated — a call that compiled stopped compiling because an overload was added. ALTERNATIVES: always prefer the Iterable overload (a rule naming library types, and wrong for [Some(1)].flatMap(identity)); report such calls as ambiguous and ask for a type (breaks code that worked); join the branches to their least common supertype without an expected type (changes if typing everywhere). A trial checks the argument once per candidate, which costs only where candidates disagree.

  • Settled on the user’s delegation 2026-11-12 (built on branch train-c-fix): Proposed (branch train-c-fix): a class with a field left unset by field_unset is made only by its own code and its companion’s. LazyList[int]() from a program made a cell whose function, element and rest were zero bytes, and reading it crashed the program. The constructor of such a class is refused anywhere else: `LazyList` keeps fields its own code fills in, so only the class and its companion make one. WHY: Avin has no private constructors, and the unset fields are safe only because the class’s own code writes them before reading. ALTERNATIVES: module-private constructors in general (a language feature, reviewed separately for Time/Zoned); a constructor parameter of a private type (an extra field in every cell). Review with the user: it is a special case of private constructors, which may want to be the general feature.

  • Settled on the user’s delegation 2026-11-12 (built on branch io-errors): an IoError carries its kind, operation and subject: data IoError(kind: ErrorKind, operation: string = "", subject: string = ""), the former variants becoming ErrorKind‘s, each with a description. It shows as cannot <operation> <subject>: <description> (cannot read nope.txt: no such file or directory), leaving out what is empty, and every error avin.fs, avin.process, avin.signal and avin.net make names both: a path (old to new for a rename), a program, process N, host:port, a socket’s path, a client of <address> for an accepted connection. A program tells kinds apart with Err(IoError(NotFound, _, _)), a guard on e.kind, or ==. Why: the error a program prints must say what failed and on what, and one type keeps Reader, ? and every signature as they were. Alternatives: a wrapper per module (FileError(path, kind)), which would split the one error every reader shares and change every signature; a subject field on each variant, which repeats it eleven times; keeping the variants and adding the path only to the message, which leaves the value unable to say what it was about. Review with the user: matching moved from Err(NotFound) to Err(IoError(NotFound, _, _)), longer at every site that tells kinds apart.

  • Settled on the user’s delegation 2026-11-12 (built on branch io-errors): CommandError.Failed(status, command) names the command’s programs (ls, ls | wc, make && ./app, a || b, a; b), and its message is false exited with status 1; an empty command leaves it out. Why: a failed status must say which command failed. Alternative: the command only in the message, not matchable.

  • Settled on the user’s delegation 2026-11-12 (built on branch io-errors): the core trait Error: Display, with parameterless message -> string and cause -> Option[Error] = None, and a default display that shows the message, then : and the cause as it shows, leaving out an empty message. Why parameterless: both read what the error holds, the parameterless rule’s case, and a data field named message then implements the first (the json package’s JsonError does). Why the cause’s display rather than its message: an error with a Display of its own (JsonError‘s place) keeps it inside a chain. Every standard-library error type implements it (IoError, CommandError, HttpError, UrlError, TlsError, TimeParseError, ZoneError, PatternError, MatchError, AskError, Utf8Error, JsonError), each message() becoming message, and TlsRefusal.message with them. A wrapper that only re-tags another error (CommandError.Io, HttpError.Io, TlsError.Transport) has that error’s message and no cause, so it shows once. Alternatives: message() with parentheses, as before (against the parameterless rule); a source chain printed separately rather than in the display (a program would have to walk it to print anything useful).

  • Settled on the user’s delegation 2026-11-12 (built on branch io-errors): a data type implementing a core trait that gives display (or debug) a body takes that method rather than the automatic one made from its fields, as it does where its own impl declares the method. Why: impl Error for ParseError must show the sentence, not ParseError(3). Only core-library traits are looked at, since the automatic derivation is decided before names resolve. Alternative: making each error type also write impl Display, which every program’s error type would have to repeat.

  • Settled on the user’s delegation 2026-11-12 (built on branch io-errors): Result[T, E].context(text: -> string) -> Result[T, ContextError], for E: Error, and data ContextError(message: string, inner: Error) in the prelude, whose cause is inner. It works on a union of Error types and a type parameter bounded by Error, and ? passes it, and every other error type, unchanged into Result[T, Error]. Why by name: the text is usually interpolated and is needed only for an Err. Alternatives: withContext(f: () -> string) beside an eager context (two names for one thing, which by-name already covers); a context method on Option too (not added: okOr makes the error first); keeping the wrapped error’s static type (ContextError[E]), which a chain of contexts would nest in its type.

  • Settled by the user 2026-11-13: JSON is the package dev.avinlang.json, in its own repository (github.com/avin-lang/json, version 0.0.1), not a module of the standard library; it supersedes the 2026-11-12 entry below. The library’s library/avin/json and its tests library/tests/jsontests moved to the package, which avin test runs; the tests of the README’s examples went with them. import avin.json (whole, a declaration, a group, or under another name) is an error naming the package: JSON is the package dev.avinlang.json; add it to your dependencies; so is import json in a program with no module or declaration json and no dependency on the package. The corpus programs that test the compiler or runtime with JSON (derivation’s diagnostics, the collector’s stress, traps, threads and sockets) became manifest programs in tests/programs/{run,reject}/json_* depending on the package by the path ../../../../../json, the sibling checkout ~/dev/avin-lang/json, as the compiler reaches ~/dev/sysl-lang/parsing. JSON derivation needed no compiler change: its templates are ordinary derive templates found in the module a file imports from. A single-file script that needs JSON declares the dependency in the script itself (a separate item, script-deps).

  • (Superseded by the user’s decision of 2026-11-13, JSON is the package dev.avinlang.json.) Settled on the user’s delegation 2026-11-12 (built on branch json-stdlib): JSON is avin.json in the standard library, moved from the package packages/json (module json); it supersedes the 2026-11-06 entry that made it a package, and the one that had the corpus gate packages/json‘s tests. Its tests are library/tests/json_*.avin, run with the core library’s own; its corpus programs are single files in tests/run/json_*.avin and tests/reject/json_*.avin with no manifest. An import that leaves out avin., import json or import fs.readText, is an error naming the import meant (it reads: there is no module json; the standard library’s is avin.json, imported as import avin.json), unless the program has a module or a top-level declaration of that name. Why: reading JSON is the first thing many scripts do, and a script of one file has no manifest to name a dependency in; marshal and most services need it; and the library is read only where imported, so a program that does not import it pays nothing. The hint is general rather than a list of package names because the one well-known package name a script reached for is now a library module, and a list in the compiler would go stale. Alternatives: a package the compiler makes available by default without a manifest (a second, implicit dependency mechanism with its own versioning); keeping the package and only improving the diagnostic (still no JSON for a lone script); the module name dev.avinlang.json for the package (the prefix packages take, but still a package). Programs outside this repository change import json to import avin.json and drop the json dependency from their manifests. Review with the user: it reverses a settled decision, and it widens what the standard library holds from “what talks to the operating system” to “the formats nearly every script reads”.

  • Settled on the user’s delegation 2026-11-12 (built on branch defer-use): resource cleanup is a block-scoped defer statement, and the library’s resources are each an io.Close (defer, Close).

    • defer stmt (or defer and an indented block) runs the statement when control leaves the block it is written in: at the block’s end, return, ?‘s failure arm, break and continue. The reached ones run last first; one not reached never runs; names are read when it runs, and a block’s, return‘s or break‘s value is computed before. No return, ?, or break/continue of an outer loop may leave a deferred statement. It is a statement of a block only: as a value, a one-line branch or in a class body it is refused. While one waits, nothing is in tail position, so @tailrec refuses a self-call there. defer becomes a keyword (one test function named defer was renamed).
    • A trap and process.exit run no deferred statement. There is no unwinding; files and connections left open are closed by the collector’s finalizers.
    • Settled on the user’s delegation 2026-11-15 (built on branch defer-on-cancel): a cancelled thread runs its deferred statements, innermost first, as at any other way out of their blocks, wherever its cancellation stops it (a wait, a safepoint poll), and then its frames are dropped as before. A thread running a scope stops first at that scope: the scope body’s deferred statements run, the scope cancels its threads and waits for them (each running its own), then the functions around the scope run theirs. A deferred statement runs to its end once begun: the thread’s cancellation does not stop it inside one (its own waits are not cancellation points while it runs, as while a lock is held), and one that comes meanwhile stops the thread at its next cancellation point after; one that traps stops the program, as any trap. A cancelled wait on a mutex’s condition stops the thread holding the lock again, so a with body’s deferred statements run under it and with‘s own defer lets it go; the library’s internal conditions still stop without the lock, as their code expects. Pool‘s putting back what a cancelled call held is now a defer. Why: cancellation stops a thread at a known point, a wait or a poll, in a consistent state, unlike a trap. Without it no library or package can clean up after a cancelled task: found writing a PostgreSQL client, where a cancelled query must send a CancelRequest, a cancelled transaction(f) must roll back, and a pool lease or a Mutex.with must be given back. Alternatives weighed: a public onCancel(cleanup)(body) in avin.threads (a second mechanism beside defer, and lambdas again, with the return/?/break problem defer was chosen to avoid); leaving it (no cleanup at all after a cancellation); running a deferred statement with cancellation live (a cleanup that waits could itself be cut off half done).
    • Each deferred statement is its closure, put on the thread’s list where the defer is reached (lower.sysl‘s Defer, runtime/avin/rt/defers.sysl): every way out of the block runs the block’s own from the list, newest first, and a cancellation runs every one reached since the cancellation point it returns to before it drops their frames; a trap in an actor’s turn drops the ones it passes unrun. A function that defers nothing never touches the list. The checker checks the statement as a lambda of no parameters that no jump may leave, so a var it reads is shared as a captured one is. Why: the cancellation unwinds by returning to the cancellation point past every frame between, so what those frames deferred must be reachable from the thread itself; a list costs a closure and two runtime calls per deferred statement and nothing anywhere else. Alternatives weighed: emitting each deferred statement inline at every exit, as before, and a landing pad per function that defers (a setjmp in every such call, with the locals it reads unreliable after the return); a frame-local record pointing at a compiled cleanup function (no allocation, but a new kind of stack object for the collector and the code generator). Review with the user: deferred statements now allocate a closure where they capture anything, a cost on the ordinary path (Mutex.with among them); a later pass could emit them inline again where no cancellation point can be reached between the defer and its block’s end.
    • trait io.Close { close() -> Result[unit, IoError] }, closing twice answering Ok: fs.File (unchanged), the new fs.TempDir from fs.tempDir(prefix) (close removes the tree), every net.ByteStream, TcpListener and UnixListener (their close now answers Ok(()) rather than unit; TlsStream‘s answers the failure to send its close notice), and process.Child (new close: kill if not seen to end, then wait; a detached child is let be). Mutex.with/update release their lock through defer.
    • Why: the paths that leak are early return, ? and break, and only a construct the compiler places at every exit covers them; a library use(r)(body) puts the body in a lambda, where a return, a ? of the enclosing function, a break or a continue cannot be written at all. Block scope (not function scope) gives back each loop turn’s resource before the next and needs no run-time state; reading names at the exit needs no storage. The syntax and the rules are Sysl’s own defer, so the two languages read alike. Close answers a Result because a flush, a removal and a wait can fail, and File.close already did.
    • Alternatives weighed: a library use(resource)(body) over a Close trait (cannot leave the enclosing function from the body; nests one lambda per resource); function-scoped defer evaluating its arguments where written (holds every turn’s resource until the function returns, needs a run-time list); try/finally (a second block structure for one need); running deferred statements on a trap (unwinding through a broken state); a Close whose close answers unit (would drop File.close‘s flush error and a TempDir‘s removal error); use x = e binding sugar over defer x.close() (left for later; defer covers it in one more line).
    • Review with the user: whether discarding a close‘s Result in defer deserves a warning; whether use x = e sugar is wanted.
  • Settled on the user’s delegation 2026-11-12 (built on branch numeric): Numeric, the numbers’ bound. A core trait Numeric: Add, Sub, Mul, Div, Rem, Neg, Ord, Display, Debug declaring toReal -> real; Integer now requires it (trait Integer: Numeric), so every width meets it through one impl[T: Integer] Numeric for T, and real has its own impl. Why: a mean, a clamp or a running total over int and real alike had no bound to name ([T: Add] cannot reach a real, and Integer excludes real); taking every operator the integers and real share (Div and Rem included, though their meaning differs: integer division truncates and traps on zero) gives the most generic code, and zero/one are already Add‘s and Mul‘s. Alternatives: only Add & Sub & Mul & Ord (the audit’s sketch), which leaves / out of generic numeric code; a Numeric that also offered fromInt/T(n) construction, left out since zero/one cover the identities and a conversion from integers is lossy at narrow widths; a separate Fractional for real, not needed while real is the one non-integer. Review with the user: whether Div and Rem belong in it.

  • Settled on the user’s delegation 2026-11-12 (built on branch numeric): Numeric is open. Unlike Integer, a program’s own type that implements the required traits and toReal is a number (a rational type is the example in the tests). Why: a library number type (a decimal, a rational, a fixed-point) should reach every [T: Numeric] function. Alternative: closed like Integer, which would keep toReal meaningful only for built-ins at the cost of every user number.

  • Settled on the user’s delegation 2026-11-12 (built on branch numeric): average totals as real and traps when empty. average on a collection of Numeric elements is a real mean summed through toReal, so integers whose sum overflows their type still average (beyond 2⁵³ the total rounds); average traps on an empty collection as max and min do, and averageOption answers None. Alternatives: summing in T and converting once (exact for small integers, but traps where the mean is representable); NaN for an empty collection (silent, unlike max); only averageOption. sum, product, min and max were already generic over Add, Mul and Ord and are left as they were rather than duplicated on Numeric.

  • Settled on the user’s delegation 2026-11-12 (built on branch numeric): real(x) on a Numeric parameter is refused, naming .toReal. A call converts only a type parameter bounded by Integer; a T: Numeric converts with its own method. Why: a conversion call on a type parameter is lowered per instance by the compiler for integers only, while toReal is an ordinary trait method a program’s own number implements. Alternative: lower real(x) to x.toReal for a Numeric parameter, more uniform with the integers’ real(x), at the cost of a second meaning for a conversion call.

  • Settled on the user’s delegation 2026-11-12 (built on branch http-verbs): the HTTP client has a function per common verb, each taking its headers. http.get, head and delete(url, headers = []); http.post, put and patch(url, body: string, contentType, headers = []), the content type sent first and the body as UTF-8. Headers are a Vector[(string, string)], as Request and Response already hold them. Why: one call for the everyday request, with the shape post already had; anything rarer (another method, a byte body, a timeout, TLS settings) stays send(Request(...)). Alternatives weighed: an options record per call (a second way to spell Request); a Map for headers (loses order and repeated names, which HTTP allows); byte-body overloads of post/put/patch (left to Request.withBody, to keep one overload per verb).

  • Settled on the user’s delegation 2026-11-12 (built on branch http-verbs): a Request‘s headers are checked as it is made, those given to its constructor too. The constructor traps on a header name that is not a token or a value holding a line break, as withHeader did; before, a header passed to the constructor was written unchecked, so a value holding \r\n could add a header of its own. Why: a verb’s headers reach the constructor, so this is where every path meets. Alternative weighed: checking as the head is written (as the server does for a Response), which would trap later, away from the code that built the request. withHeaders(more) adds several in order.

  • Settled on the user’s delegation 2026-11-12 (built on branch http-verbs): query parameters are added one at a time by Request.withQueryParam(name, value), each encoded by Url.encode (so a space is %20, not +), joined with ? or & and placed before any fragment, by text on the request’s URL, which is parsed only when sent. Why: the cheapest form that reads well in a chain and needs no parse that could fail at build time. Alternatives weighed: a query parameter on every verb (a fifth parameter on post/put/patch); a Url.withQueryParam (useful too, but not needed for a request); form encoding with + (only application/x-www-form-urlencoded bodies need it). Review with the user: whether the verbs should also take a query vector.

  • Settled on the user’s delegation 2026-11-12 (built on branch http-verbs): Response.json(status, text: string) takes JSON already written and sends it as application/json without checking it. Why: JSON lives in a package today (moving to the standard library as avin.json), and avin.net.http must not depend on a package; a text overload needs nothing. (JSON stays a package, dev.avinlang.json, by the user’s decision of 2026-11-13, so the text overload is the only one; a program passes value.render.) Alternatives weighed: leaving Response.json out until then (every JSON handler spells the content type by hand); charset=utf-8 in the type (RFC 8259 defines none for application/json). Review with the user: the Json overload once avin.json lands.

  • Settled on the user’s delegation 2026-11-12 (built on branch path-helpers): Paths are strings, and the path functions live in avin.fs (branch path-helpers, 2026-11-12). Proposed: no Path type; fs.join, fs.parent, fs.fileName, fs.extension, fs.stem, fs.normalize, fs.relativeTo, fs.components, fs.isAbsolute/isRelative take and answer string, bound to sysl.path, and sit in avin.fs beside the calls they feed. Why: every call of avin.fs, avin.process and the rest already takes a string, so a type would mean a conversion at every call or a second overload of each; every string method applies to a path as it is; the separators and dots the functions look at are ASCII, so working on UTF-8 text is exact for any name. Alternatives weighed: a Path class with / and methods (p.parent), which reads well but splits the library in two; a separate avin.path module, which a program’s own path variable shadows at once (fs.join cannot be shadowed by a local of that name). Review with the user: whether a Path type is wanted after all.

  • Settled on the user’s delegation 2026-11-12 (built on branch path-helpers): walk answers a sorted vector, with an unreadable directory as an entry (branch path-helpers). Proposed: fs.walk(root) -> Result[Vector[Entry], IoError], depth first, a directory before its contents, each directory’s names in code-point order (as listDir), the root itself left out; Entry(path, relative, depth, isDir, isLink, error). A link is listed and never followed (isDir false for it), the root is followed when it is a link, and a directory that cannot be listed is an entry whose error holds the reason, the walk going on past it; only a root that cannot be listed makes the whole walk an Err. Why: one ? at the call and an ordinary for over the answer, deterministic order for tests and tools, no entry silently lost and no permission problem deep in a tree spoiling the rest. Alternatives weighed: a lazy iterator of Result[Entry, IoError] with pruning (sysl’s shape: cheaper on a huge tree, but every item needs its own ? and the order is the file system’s); failing the whole walk at the first error; skipping unreadable directories silently; following links with cycle detection. Review with the user: whether a lazy walk with pruning is wanted for very large trees.

  • Settled on the user’s delegation 2026-11-12 (built on branch path-helpers): Pattern matching is by character, and glob ignores what it cannot read (branch path-helpers). Proposed: fs.matches(pattern, path) is written in Avin rather than bound to sysl.path.matches: ? and a class take one character, so ?.txt fits 文.txt. Pattern and path are compared component by component (doubled and trailing / do not matter, an absolute pattern fits only an absolute path); ** as a whole component is zero or more components; a name starting with . is fitted only by a component starting with a literal . (not ?, * or [.]), and ** does not pass through one; an unclosed [ is a literal [ and a trailing \ a literal \, so every pattern is valid and matches never fails. fs.glob(pattern) -> Vector[string] expands component by component, answers sorted and without repeats, follows a link named by a literal or wildcard component but not under **, and treats a directory it cannot read as empty. Why: Avin strings are characters, and a byte ? would match a third of 文; component-wise matching makes glob‘s answers fit matches by construction; the shell’s hidden-name rule keeps ** out of .git. Alternatives weighed: binding sysl’s byte matcher (one third of a character per ?); an Err for a malformed pattern (a Result on every matches call for a case a literal reading answers); glob answering Result (an error deep in a tree would lose the rest, as with walk, and a pattern has no single directory whose failure should be the answer). Review with the user: brace alternatives {a,b}, left out.

  • Settled on the user’s delegation 2026-11-12 (built on branch path-helpers): isDir and isFile ask stat (branch path-helpers). Proposed: fs.isDir was bound to sysl.fs.is_dir, which opens the path as a directory, so a directory the program may not read answered false and isFile (exists && !isDir) answered true for it; both now read the same stat as metadata. Why: the chapter says isDir is whether the path names a directory, and walk needs the kind of an unreadable directory to report it. Alternatives weighed: keeping the opening check (a permission answer dressed as a kind).

  • Settled on the user’s delegation 2026-11-12 (built on branch text-papercuts): sortedDescending on every Seq of Ord elements (a List‘s answering a List), and sortInPlaceDescending() on arrays, buffers and deques, beside Reverse, which stays the way to sort descending by a key. This amends the settled Reverse entry, which had chosen no sortedDescending. Why: the whole-element case is the common one (top scores, largest files), sortBy(x -> Reverse(x)) is a detour for it, and the obvious spelling a program reaches for instead, sorted.reverse, is quietly wrong for elements that compare equal but differ, since it turns their order round; a stable descending sort keeps it. No sortByDescending: a key turned round is Reverse(key), which also composes inside a tuple key, so a second spelling would add nothing. Alternatives weighed: keep Reverse alone (the settled choice; the gap audit’s programs did not find it); sortByDescending(key) as well (two ways to write one thing); a descending flag on sorted (a boolean argument reads poorly at the call). Review with the user: it reverses a settled choice.

  • Settled on the user’s delegation 2026-11-12 (built on branch text-papercuts): the , format flag groups a decimal integer’s digits in threes with commas, under %d and %i only; under every other conversion it is the “has no effect” error. The zeros of a precision are grouped with the digits (${5}%,.6d is 000,005), but the zeros of the 0 flag are not: they fill the width before the grouped digits, the commas and the sign counting in it, so the field is never wider than asked unless the number is (${1234}%0,8d is 0001,234, ${-1234}%0,8d is -001,234). FormatSpec gains grouping: bool = false as its last field, so code that builds one by position is unchanged. Why: a width is a column’s width, and a column that a comma can widen by one does not line up; precision zeros are digits of the number, fill zeros are padding. Alternatives weighed: grouping the fill zeros too, added until the field is full (0,001,234 for width 8: one wider than asked); _ or a locale’s separator (no locale exists; a comma is the common reading); allowing , under %f (a real’s grouping is a separate item, not asked for yet). Always a comma, never locale-dependent.

  • Settled on the user’s delegation 2026-11-12 (built on branch text-papercuts): string.utf8 answers a new Array[byte], a parameterless member as bytes is, the array the caller’s own on every call. Why: files, sockets and request bodies take an Array[byte], and s.bytes.toArray() built a vector only to copy it. Alternatives weighed: toUtf8() with parentheses (it is a pure conversion, so the parameterless rule writes it bare); answering a frozen, shared view (an Array is mutable, so sharing would let one caller change another’s bytes).

  • Settled on the user’s delegation 2026-11-12 (built on branch dot-chain): a line that starts with a member’s ., indented deeper than the line its expression began on, continues that expression, exactly as a line starting with a binary operator does: in the same places (a binding’s value, an assignment, a return value, an infix call’s argument, a match arm’s or a lambda’s body, a branch of a one-line if, an expression statement, a trailing lambda’s body), never in the header of a form whose body follows, with blank lines and comments between skipped, and ending at the first line back at the depth the expression began on. . and the binary operators may alternate line by line, and a call’s trailing block ending inside the chain lets the next . line go on after it. The line break means nothing to binding: . takes the operand right before it, so a + b then .toString is a + b.toString, as on one line. An indented line after a call that starts with . is a continuation, not the call’s trailing block. The error for a line inside a continuation that starts with neither now says “a binary operator or .“. Why: a pipeline of filter, map and a builder’s .get(…) calls reads one step per line, and wrapping it in parentheses to get there was the only way before (audit item C2; the lwt-server routing entry chose a vector over a builder for this reason). Reusing the operator continuation keeps one rule for where an expression may go on, and the line break meaning nothing keeps one rule for precedence. Alternatives: a . line binding to the whole expression above ((a + b).toString), which reads naturally for a chain after an operator but makes the line break change meaning, unlike every operator line; requiring a chain to start on its own line (val ys = then the receiver and the dots on deeper lines), which adds nothing the depth rule does not already say; a trailing . at the end of the line above, which hides the call being made. Review with the user whether . after an operator line should bind to the whole expression instead.

  • Settled on the user’s delegation 2026-11-13 (built on branch nothing-conversion): A function whose result is Nothing converts to one of another result where it is written, as a lambda calling it, and not inside another type (types; branch nothing-conversion). The subtyping rules already made (A) -> Nothing a subtype of every (A) -> R, but no function value of it was accepted where one was expected (only a lambda whose body never finishes, checked against the expected type), while an inferred type argument let one through with no conversion, and the call through the wider type then called code yielding no value as code yielding one. A call of a Nothing function yields no value at all, and one of an (A) -> R yields an R, so the two are laid out differently and one is not the other as it stands. The choice: at a declared type, an argument (after inference too), a result, a field, and the branches of an if/match or elements of a collection literal, the value is evaluated once into a local and made a lambda of the expected type calling it (a named function is called by name and nothing is captured, so it may be @sendable); nested results (() -> () -> Nothing) convert one level at a time. Parameters keep their variance; a Vector[(int) -> Nothing] is no Vector[(int) -> int], as a Vector[int] is no Vector[Any]. Why: it gives the subtyping rule its meaning with no change to how functions are called, and matches how a value of a value type becomes an Any or a trait (at the site, never inside a container). Alternatives weighed: a view with no conversion, the closure’s entry for a Nothing result answering every result’s layout (impossible in one entry: an int, a real, a reference and no value are returned differently); a dedicated adapter node in lowering (the same conversion, built by hand rather than as a checked lambda); refusing the conversion and keeping only lambdas (contradicts the subtyping rule, and the inferred case had to be closed anyway). Review with the user: whether a function held inside a collection should convert too, which needs a copy of the collection.

  • Settled on the user’s delegation 2026-11-13 (built on branch numeric-widths): numbers have toInt, toLong and toReal as parameterless members, each exactly the conversion call of its type. Every integer type has n.toInt and n.toLong (int(n), long(n): a narrowing one traps when the value does not fit, as the call does); real has x.toInt and x.toLong (int(x), long(x): truncation toward zero, saturation at the bounds, NaN to zero); toReal was already Numeric‘s. They are members of the integer family’s impl and of real‘s, not of Numeric, so a number type of a program’s own owes only toReal. WHY: string.toLong() and xs.sum.toReal put conversions where a reader reaches for them, and n.toLong answering int has no field `toLong` was the surprise; making the member the call, rather than a second semantics, keeps one rule for what a conversion does. A narrowing toInt traps, as string.toInt() traps on a number that does not fit and as int(n) does, so the trap/Option split stays where it is (toIntOption() is for text, whose failure is the input’s). ALTERNATIVES: no members, only a hint naming long(n) (leaves toReal the odd one out); a narrowing toInt answering Option[int] (differs from int(n) and from string.toInt()); no narrowing members at all, toLong only (an int from a long is as common as the reverse); members on byte too (a byte is not a number, and int(b) reads as what it is). Review with the user: whether real.toInt should trap on NaN and out-of-range values instead of saturating, as string.toInt() traps on text that is no number.

  • Settled on the user’s delegation 2026-11-13 (built on branch numeric-widths): mixed-width arithmetic stays an error, and its diagnostic names the conversion, pointing at the operand to convert: error: `*` needs two numbers of one type, not long and int; write `long(n)` , the operand quoted as written (or, when it is longer than 40 bytes or spans lines, convert the int with a call of `long` ). The narrower integer converts to the wider, an integer or a byte to real, a byte to an integer, an integer to a type parameter bounded by Integer (T(n)), and a value of a Numeric parameter to real by x.toReal. Comparisons (<, ==, …, each link of a chain) say the same. A compound assignment’s target keeps its type, so there the value converts to it, a narrowing call included (n -= total suggests int(total)). A char beside a number gets no conversion hint: it is no number, and '-' * 3 meant repeat. WHY: the spec settles that integers are never widened implicitly; the error was right and only lacked the fix. ALTERNATIVES: implicit widening (contrary to the settled rule); pointing at the whole operation (the hint names one operand, so the caret should too); suggesting a narrowing of the wider operand (loses values).

  • Settled on the user’s delegation 2026-11-13 (built on branch diag-spans-recovery): Parse recovery and the hints for Map(k -> v) and an argument’s type (branch diag-spans-recovery). A line of a block, class, actor or machine the parser cannot read to its end is skipped to the next line, and reported only when nothing in it was reported already; an argument list or parenthesized group meeting a token other than , or ) reports it once and skips to its ). -> there says “write a map as {"a": 1}“ when the callee’s name ends in Map and “-> does not pair two values: write a pair as (a, b), and a map as {"a": 1}“ otherwise; and “a lambda’s parameter with a type is written in parentheses” when : T -> follows a name. WHY: one mistake made five to ten errors, each naming a token rather than the mistake, and the token shows exactly which mistake it is. ALTERNATIVES: suppressing every error after the first in a statement (panic mode), which also hides a genuinely separate mistake on the same line; accepting k -> v as a pair (a second spelling of a tuple, and x -> body is a lambda). The hints this entry first gave for x: T in an argument or a group (“give the type argument instead”, “declare the value with it”) are gone: x: T there is now a type ascription (the user approved ascription 2026-11-13).

  • Settled on the user’s delegation 2026-11-13 (built on branch diag-spans-recovery): A member’s mistake is shown at the member (branch diag-spans-recovery). The checker reports a missing or private member, an argument-count mistake and () on a parameterless member at the member’s name and argument list; the call’s own span, used for a type mismatch and for traps, stays the whole expression. WHY: in a chain written over leading-. lines the whole span starts lines above the member at fault, and the rendering shows only its first line. ALTERNATIVES: narrowing the call’s span itself (a wrong-type value would then be shown at its last member only); storing the name’s span in the syntax tree (every Member match changes, for a span the source already determines).

  • Settled on the user’s delegation 2026-11-13 (built on branch argparse): avin.cli: a declared parser read by name (branch argparse). Proposed: the standard library’s argument parser is a Parser value built by chained declarations (flag, string, int, real, choice, positional, positionals, each with named short, help, default, required, repeated, value), and parse(args) answers Result[Args, ArgsError]; values are asked for by name and type (a.int("top"), a.strings("file")), and asking for an undeclared name or the wrong type traps. parseOrExit covers the usual main: help or version to standard output and status 0, a mistake to standard error with the usage line and status 2. Why: it needs no language feature, a program reads in the order its help does, and every mistake a user can make is a value with a sentence naming what they wrote. Alternatives weighed: deriving a parser from a data type’s fields (data Options(...) derives Args), which checks names at compile time but needs a derivation and a way to attach help, short letters and defaults to fields; a getopt-style loop the program drives, which is what wc hand-rolled; one getter returning Option for everything, which makes every read a match. Review with the user: whether a derived form is wanted on top of this one. The rules it settles, each the common command-line convention: --name=value and --name value alike; bundled letters (-lw, -n5, -lwn5); an option’s value is the next argument whatever it starts with (--top -1); - alone and the empty argument are positional; -- ends the options; options and arguments interleave; a single option given twice keeps the last (so an alias’s option can be overridden), a repeated one keeps all, and a flag is counted (-vvv). Every parser has --help/-h, and --version where it has a version, unless the program declares that name or letter itself; each acts where it stands, left to right. An option with no default reads as its type’s zero ("", 0, 0.0) and given(name) tells whether it was on the command line; the help shows a default only where it is not that zero, since a default parameter cannot tell an explicit zero from an omitted one. Every option has a long name (the name Args looks it up by); positional arguments are strings. The reasons read unknown option `--x` , `--count` needs an int, not `abc` and `--scale` needs a number, not `x` (a user of the program knows “number” better than “real”). Alternatives weighed: refusing an option given twice (catches typos, breaks overriding an alias); refusing a value that starts with - unless it is a number; typed positional arguments, left out until a program needs one; Option-typed defaults (default = Some(3)), exact but noisy at every declaration.

  • Settled on the user’s delegation 2026-11-19 (built on branch cli-subcommands): avin.cli commands are parsers of their own. Parser.command(sub) adds the command sub.name, whose options and arguments sub declares and whose help line is sub.about; a command may have commands (git remote add). The first positional argument names the command and every argument after it is the command’s, so the program’s options come before the command word and the command’s after it (todo --file t.txt add -p high milk); a parser with commands takes no positional arguments, and declaring both traps. Args.command is the command’s name (empty where the parser has none) and Args.commandArgs the command’s own Args. While a command reads its arguments its parser is named after the program and the command, so its usage line, help and messages say todo add. Every parser with commands has the command help (todo help add, todo help remote add) unless the program declares one of that name, as with --help; todo add --help is the command’s own. No command is missing command; the commands are `add`, …; an unknown one is unknown command `lst`; did you mean `list`?, the suggestion being the nearest name within two edits (fewer than the word’s characters), else the one name the word begins, else the list of commands. WHY: a sub-parser is the value a program already knows how to build, so a command needs no new kind of declaration, and nesting comes free; reading only the program’s options before the word is the convention every tool with commands follows, and keeps a command’s options free to reuse the program’s names. Alternatives weighed: command(name, help, sub) (repeats what sub already holds); a dispatch table of functions (command(sub, run)) that parse would call, which hides control flow and fixes a return type on every command; options of the program accepted after the command word too (ambiguous where both declare a name); a missing command printing the help instead of a mistake; matching commands by unique prefix outright (todo l running list), which turns a later command into a breaking change. Review with the user: whether a missing command should show the help (git’s way) rather than be a mistake. A mistake is reportable without ending the program. ArgsError.Invalid gains program (the name of the parser that found it, todo add) and hint (Run `todo add --help` for the options., Run `todo --help` for the commands., or help where --help is the program’s own, or empty), so Invalid(reason, usage, program, hint); ArgsError.report is the whole text parseOrExit writes, every line ending in a newline, and exitCode its status (0 for the help or the version, 2 for a mistake). A shell or script runner calls parse, writes e.report and reads the next line; message and the Display stay the reason alone, so an ArgsError passed on with ? still reads as one sentence. WHY: the error must carry the failing command’s name, since only it knows it; a parser method report(e) would name the top program for a command’s mistake. Alternatives weighed: keeping Invalid(reason, usage) and folding the name into usage (changes what the field means); making the Display the whole report (a multi-line display breaks error chaining). Review with the user: the two new fields change Invalid‘s shape, so a program matching Invalid(reason, usage) must add _, _.

  • Settled on the user’s delegation 2026-11-13 (built on branch small-papercuts): one family of case names, toUpper and toLower, for char and string alike. string.toUpperCase and toLowerCase are renamed to toUpper and toLower, the names char already had, across the library, its tests, the corpus, the scripts and the spec; "a".toUpperCase is refused with string has no field `toUpperCase`; a string maps its case with `toUpper` and `toLower`, as a `char` does. WHY: one name for one operation on both types, and the shorter one, which conflicts with nothing on either type. There is no deprecation mechanism to keep the old names as aliases, so the old names are gone and the error names the new ones. ALTERNATIVES: rename char‘s to toUpperCase (longer, and isUpper/isLower on char would then disagree with it); keep both names on string as plain aliases (two names for one method forever, with no way to retire one). Review with the user: it breaks source using the old names (marshal, tui and typing-practice use them), so their call sites change in the release that carries it.

  • Settled on the user’s delegation 2026-11-13 (built on branch small-papercuts): avin takes its options before or after the program. The program is the first argument that is neither an option nor an option’s value, wherever it stands before run‘s --; for avin test, only an existing path is the program and any other word is the filter, as before. avin run -O2 main.avin, avin run main.avin -O2, avin -O2 main.avin and avin build -o out -O0 main.avin are all accepted, and only what follows -- reaches the program. A first argument that is any option (not only -O0, -O2 or --) now means avin run, which checks the options itself. WHY: the audit’s avin run -O2 file.avin printed the whole usage; the order of avin’s own options carries no meaning, and -- already separates the program’s arguments. ALTERNATIVES: options after the program only, with an error saying so (keeps a rule nobody needs); treating words after the program as its arguments without -- (makes avin run main.avin -O2 pass -O2 to the program, which surprises in the other direction). One exception, from branch script-deps (below): avin <file> ..., with no command word, for a file whose first line begins #!, gives every argument after the file to the program, since that is how a #!/usr/bin/env avin line runs it as a command.

  • Settled on the user’s delegation 2026-11-13 (built on branch small-papercuts): Result.toOption beside ok, and StringWriter is Display. toOption answers exactly what ok does, under the name Either and the collections use; ok stays. StringWriter implements Display (its text, padded to a field’s width, as a string) and toString() returns its text. WHY: the names people reach for first, and a writer that interpolates as what it holds. ALTERNATIVES: renaming ok to toOption (breaks callers for no gain; ok/err read as a pair); a StringWriter with toString() only (it would still show as its type’s name in s"$w").

  • Settled on the user’s delegation 2026-11-13 (built on branch small-papercuts): t._1 on a tuple names the part to write. A member _ followed by decimal digits asked of a tuple adds ; a tuple's parts are numbered from 0, so write `.n-1` when 1 <= n <= its arity, and ; a tuple's parts are numbered from 0 and read as `.0` to `.k` otherwise (_0, a part beyond the arity, a number too large to read). WHY: the _1 spelling is what readers of other notations write first, and _n meaning part n - 1 is the likely intent. ALTERNATIVES: accepting _1 as a second spelling (two ways to write one thing).

  • Settled on the user’s delegation 2026-11-13 (built on branch build-dir): avin run and avin test build into the user’s cache directory, not into .avin/ beside the program. A program’s executables and its instance cache go to build/<name>-<key>/ in the toolchain’s cache (~/Library/Caches/avin/<version>/ on macOS, $XDG_CACHE_HOME/avin/<version>/ or ~/.cache/avin/<version>/ elsewhere, or AVIN_CACHE), where <name> is the program’s directory’s or file’s name and <key> twelve hex digits of a SHA-256 of its absolute, canonical path. .avin/build/ beside the program is used only on a machine with no cache directory (no AVIN_CACHE, HOME or XDG_CACHE_HOME; the runtime’s archives then go to the temporary directory, which is cleared under a long-lived cache). avin build and -o are unchanged. The new avin clean [<program>] removes the program’s directory and any .avin/build/ beside it (on the fallback, a program of one file’s entries only, and .avin/ once empty); avin clean --all removes the whole build/ of this version and nothing else of the cache, and on the fallback means the current program’s. avin new writes /<name> (the executable avin build leaves at the root) and .avin/ into an application’s .gitignore, .avin/ alone into a library’s. Why: a one-file script run from anywhere left an .avin/ next to it; Sysl keeps its builds and run cache in the machine cache directory keyed by version and target and uses a project’s .sysl/ only where there is none, and Avin already keeps its fetched packages, runtime archives and shims there, so a build cache beside the source was the one exception. Keying by path keeps two worktrees of one repository apart (each has its own sources), and the version in the path keeps one compiler’s entries from another’s. The executables and records are still published by rename and the instance cache is lock-free as before, so two builds of one program at once stay safe. Alternatives weighed: keep .avin/ beside projects and move only one-file programs (two rules to explain, and a repository still grows a directory to ignore); key by the program’s content rather than its path (every edit would start a new cache, and nothing would ever trim the old); --all removing the whole avin/<version> (it would also drop fetched packages, which a build then fetches again over the network); a lock around a program’s cache (the content-addressed, rename-published entries need none). Review with the user: whether a cache of a deleted project should ever be trimmed on its own (answered by the cache’s limit: least recently used first, see the Proposed entries of branch cache-trim).

  • Settled on the user’s delegation 2026-11-13 (built on branch variant-test-open): A variant with fields named alone in a pattern tests for the variant and binds none of its fields. o.status is Shipped, Shipped -> … in a match arm, Status.Shipped qualified, Some(Shipped) nested and f(Shipped) = … in a clause all mean Shipped(_, _), with the variant’s own number of _; coverage and unreachable arms treat it as that pattern. Shipped(), written with parentheses, is still matched against the fields by number and refused for a variant that has some. Why: the commonest test of a variant asks only which one it is, and counting _s to say so is noise that changes whenever a field is added; the previous error suggested Shipped(fields), which is not Avin, and the bare name could mean nothing else, since a variant in scope is never a binding. One rule for every place a pattern goes, because x is P takes exactly the patterns a match arm takes. Alternatives: only in is (two pattern languages, and a match arm refactored from an if … is would break); keeping the error and suggesting Shipped(_, _) with the right number of _ (valid, but the test still has to change with the fields). Review with the user: a reader may take Shipped for a variant without fields.

  • Settled on the user’s delegation 2026-11-13 (built on branch variant-test-open): open, abstract and override where they mean nothing are one error each, and the declaration then parses as written. Before a method: “a method takes no open: every public method of an open or abstract class, and every method of a trait, may be overridden already; remove open“, and for abstract that a method declared without a body is abstract already; before a field, that a field cannot be overridden or is abstract by having no value; before a top-level function, that it belongs to no class or overrides nothing; before trait, data and object, why each takes none; override class, that a class replaces nothing and extends with : Base. Why: the words were read as names, so open sound() -> string reported open and string as undefined and then every override of sound as overriding nothing. The spec settles that every public method of an open class may be overridden, so methods have no open to accept. Alternatives: accepting open on a method as a harmless no-op (two spellings of one meaning); a method-level open with classes’ methods final by default (a language change the settled rules do not ask for). open(…), open = … and a method named open keep their meaning: the word is a modifier only before a name or a declaration keyword.

  • Settled on the user’s delegation 2026-11-13 (built on branch bigint): BigInt is a class of the core module avin, written in Avin, its magnitude in limbs of nine decimal digits held in longs. It is visible with no import, as BitSet is; its limbs are a FrozenArray[long], a type no program can name, so its constructor cannot be called with a malformed magnitude from outside the library, and the value is immutable and sendable. Multiplication is schoolbook and division is long division with a normalized divisor, both quadratic. Why: base 10^9 makes decimal text, by far the commonest, a limb at a time in both directions, and keeps a limb product plus a carry inside a long with no wrapping arithmetic; living in avin lets it reuse the integer formatter’s private layout code, so %d and its flags behave exactly as for long. Alternatives: binding Sysl’s sysl.math.bigint through a handle (faster, but its behaviour, text forms and traps would be Sysl’s to change, and the library is meant to be Avin); base 2^32 limbs (cheaper bit operations, which BigInt does not have yet, but every decimal conversion becomes a division per nine digits and products need wrapping or 128-bit arithmetic); a module avin.math needing an import (keeps the core namespace smaller); Karatsuba multiplication (not needed at the sizes programs meet so far). Review with the user: whether BigInt should be in the core namespace, and whether it should gain the bitwise operators and shifts.

  • Settled on the user’s delegation 2026-11-13 (built on branch bigint): BigInt‘s API mirrors the integer methods: abs, sign, pow, gcd, lcm, floorDiv, floorMod, toRadix(r), plus isZero, divRem, toLong/toInt that trap and toLongOption/toIntOption that answer None. Made by BigInt(n) from any integer width (a non-generic apply(n: long) beside the generic one, so a literal as large as a long is accepted), BigInt(text)/BigInt(text, radix) that trap on bad text as toLong does (For input string: "…"), and BigInt.parse(text[, radix]) answering Option. A zero divisor traps with division by zero. Why: one vocabulary for whole numbers, so code moves between long and BigInt by changing a type; the trapping and Option pairs follow string.toLong / toLongOption. Alternatives: toString(radix) instead of toRadix (the integer types already chose toRadix); only Option conversions (forces .get at every call that knows the value fits); a string.toBigInt extension (adds to every string a method for one type).

  • Settled on the user’s delegation 2026-11-13 (built on branch bigint): the integer format conversions %d, %i, %x, %X, %o and %b take a BigInt, and %s refuses it as it refuses every number. The checker names the core library’s BigInt beside the integer widths and byte. Why: a whole number is formatted as one, with grouping, signs, zero padding and bases; refusing %s keeps the rule that a number’s conversion says how its digits are laid out. Alternatives: a trait (say WholeNumber) a type implements to be taken by the integer conversions (general, but a new trait and a display contract for one type); accepting BigInt under %s (inconsistent with every other number). Review with the user: whether a trait should open the integer conversions to other types.

  • Settled on the user’s delegation 2026-11-13 (built on branch bigint): a type’s static member is called on its name even where the type has a companion object. Cup.zero() with object Cup declared reported “Cup has no member zero“ (and Period.zero() the same), since the name was read as the object. Now Name.member is the companion’s where the companion declares a member of that name, and otherwise the type’s static member where it has one, for classes and data types, written with type arguments or not, called or named as a function value. Why: the spec calls a static member on the type’s name, and a companion is where a type keeps its factories, so a type with both is the ordinary case (BigInt.zero() beside BigInt.apply). Alternatives: refusing a static member and a companion on one type (rules out the common case); the type’s static member winning over the companion’s member of the same name (makes a companion unable to shadow it deliberately).

  • Settled on the user’s delegation 2026-11-13 (built on branch json-package): the corpus programs that test the compiler with JSON depend on the sibling checkout ~/dev/avin-lang/json by path (../../../../../json from tests/programs/{run,reject}/NAME/). Why: the corpus loads packages without fetching, and a copy of the package inside this repository would drift from the real one; the compiler already reaches ~/dev/sysl-lang/parsing the same way. Alternatives: a vendored copy under tests/packages/json (self-contained, but two sources of one package); a git dependency (the corpus does not fetch). Review with the user: it makes the avin gate need the json checkout beside it.

  • Settled on the user’s delegation 2026-11-13 (built on branch json-package): a trap inside a package is placed in the package’s source, as before for any module that is not the core library: j("absent") now reports at json.avin:98:9 where, as avin.json, it reported the program’s call. The corpus programs json_missing_key_trap and json_missing_index_trap hide the package’s line and column. Why: the rule that a trap is placed where the program last called in is the core library’s (errors), and widening it to every dependency is a design change of its own. Alternatives: placing a trap at the last call from the root package’s own code (better for a package’s users, worse for its author debugging it); a per-package opt-in. Review with the user: a package’s user would usually rather see their own call.

  • Settled on the user’s delegation 2026-11-13 (built on branch script-deps): A program of one file names its dependencies in a header of comment lines at its top: the line // avin.hocon, then // lines whose text after the // is exactly a manifest’s dependencies block, ending at the first line that is not a // comment (packages). Why: domain libraries are packages (JSON, CSV), and a script must reach them without becoming a directory with a manifest; reusing the manifest’s own HOCON means one syntax, one parser and one set of errors, shown at the header’s line in the file. Being comments, the header needs no change to the lexer, the parser, the formatter or the IntelliJ plugin, and a file with one is still Avin to every tool. // avin.hocon reads as “this file’s manifest”, and the editor grammar colours the block as embedded HOCON. Alternatives weighed: a --- front-matter fence (a second lexical form every tool must learn, and a file no older compiler reads); a declaration in the language, dependencies { … } or an annotation on the file (dependencies are the build’s business, not the program’s, and the checker would have to ignore it); one @dep("github.com/…@1.0") comment per dependency (a second syntax for what a manifest already says, without path, rev, member or features); a block comment (Avin has none). Review with the user: the marker’s spelling.

  • Settled on the user’s delegation 2026-11-13 (built on branch script-deps): The header holds dependencies only, and is at the top or refused. workspace = true and optional are refused (no workspace, no features of its own); package, features, sysl-dependencies and c-libraries are refused at the key, a program that needs them being a package. It begins on the first line, or the second after a #! line; a // avin.hocon line anywhere else is an error, because a header silently not read is a missing dependency reported as an unknown module. Alternatives weighed: allowing sysl-dependencies and c-libraries (each works through the same resolution, and may be added when a script needs one); allowing other comments or blank lines before it (a header that moves is harder to find, and the rule “first line” is one a reader can check at a glance).

  • Settled on the user’s delegation 2026-11-13 (built on branch script-deps): A header in a file of a package, or of a program of many files, is refused at the header, rather than merged with the manifest or passed over. Why: two places naming a package’s dependencies would disagree, and passing it over hides a mistake; a directory program has no manifest, and the way to give it dependencies is to make it a package. Only the package’s own files are checked; a dependency’s files are not.

  • Settled on the user’s delegation 2026-11-13 (built on branch script-deps): A program of one file’s sum file is beside it, named after it: tool.avin.sum, written and checked as avin.sum is, absent when nothing is fetched, rewritten by avin tidy tool.avin. A program of one file is not vendored: avin vendor refuses it, and avin add (which edits a manifest) refuses it too. Why: the sum file is where a manifest’s is, beside what names the dependencies, and naming it after the file lets several scripts share a directory. A vendor/ beside the file would be shared by every script in the directory, and vendoring one would remove the others’ packages. Alternatives weighed: no lock at all, trusting the cache’s recorded hash (a moved tag would go unnoticed on a second machine); one avin.sum per directory (scripts would add and tidy would remove each other’s lines); the hashes written into the header (the build would rewrite the user’s source); a vendor/<file>/ per script. Review with the user: whether a script’s sum file is wanted, or is clutter next to a one-file tool.

  • Settled on the user’s delegation 2026-11-13 (built on branch script-deps): A first line beginning #! is not Avin, in every file, and the line is written #!/usr/bin/env avin. avin <file> ... (the form a #! line runs, with no command word) for a file whose first line begins #! gives every argument after the file to the program, so ./tool.avin -O0 x passes -O0 and x. Every other form keeps the command line’s rule: avin run tool.avin -O0 -- x and avin -O2 tool.avin -- x take the options as avin’s and pass only what follows --. Why: ./tool.avin a b runs avin ./tool.avin a b through the #! line, and without the rule the program’s arguments would need a -- that a command’s caller cannot know to write; while a person typing avin run is using avin, and its options mean the same wherever they stand. Alternatives weighed: every argument after any #! file the program’s, avin run included (the branch’s first form; it made avin run tool.avin -O0 mean something different for one kind of file); #!/usr/bin/env -S avin run as the line (needs env -S, and runs through avin run, where the options are avin’s); #! lines needing avin run -- (env passes the file after the --, so it would be an argument, not the program); taking options before the first non-option and the rest as the program’s (./tool -O0 would still be eaten). Review with the user: the argument rule, which makes -O0 after a #! file the program’s when run as a command.

  • Settled on the user’s delegation 2026-11-13 (built on branch fmt-pack): avin fmt fills a broken literal of short, simple items, as many to a line as fit (branch fmt-pack). A sequence literal […] or set literal {…} (brackets not after an operand, so no index or type arguments) whose every item is a number, a character, a plain string, true, false or a name, a number with a sign against it included, and no item wider than 32 characters, is broken where any list would be (past 120 characters, or written with a line break after its opening bracket and before its closing one), but its items are then laid out , -separated, as many to a line as fit in the 120 columns, two columns in, a trailing comma kept after the last. Any other item (a call, a lambda, a tuple, a nested literal, an interpolated string, a key: value entry) keeps the one-item-per-line layout, and a comment among the items keeps the lines as written, as everywhere inside brackets. Arguments of a call are never filled. The result is idempotent: a filled literal is broken after its opening bracket, so formatting it again fills it the same way. WHY: a generated table (tui’s width_table.avin, about 640 pairs of code points) became ~1,280 lines of one number each; filled, it is 111 lines and reads as a table. ALTERNATIVES: keep a source that is one per line one per line (leaves the table unreadable, and a table that has been through fmt once could never recover); fill any list of one-token items, call arguments included (a call’s arguments are each a meaning, and one per line shows them); fill short tuples (a, b) too (more rules for the reader of the style to learn; a table of pairs is written flat, as tui’s is); align items into columns (wider diffs for one changed entry, and no gain for numbers of one width). Review with the user: the 32- character limit, and whether a short list deliberately written one per line should stay so.

  • Settled on the user’s delegation 2026-11-13 (built on branch discarded-result): A dropped Result or Future is an error, and _ = e drops one on purpose (errors). A value of either type is reported where it is thrown away: a block’s statement, the last line of a function or lambda yielding unit, a branch of an if without else or of an if/match written as a statement, a loop’s body. _ = e evaluates e and keeps nothing. A deferred statement is exempt, and so is an expression the checker reads only for its own errors after the form around it failed. The standard library’s call sites were each handled or marked _ = (a socket or pipe closed once its exchange is over, a temporary directory removed, a signal to a program that may have ended).

    • Why: fs.writeText("/nonexistent/x", "hi") as a statement compiled and failed silently (gap audit C8). An error, not a warning: Avin has no warnings channel, every diagnostic is an error, and a warning shown only sometimes is the one that is missed (as for unreachable match arms). _ = e is the spelling a reader already knows from destructuring, where _ drops a part. A deferred statement is exempt because it runs while its block is being left, where no ? or return can carry a failure anywhere, and defer f.close() is the form defer exists for. A Future is included because dropping one loses its answer the same way.
    • Alternatives weighed: a warning (no channel to carry it); a @mustUse annotation on types or functions (more general, but a new attribute for two types, and a library author could forget it); Result only (a dropped Future[Result[…]] loses the failure just as surely); reporting a dropped Result in defer too, which would make defer _ = f.close() the idiom (noise on the one form defer is for); val _ = e as the only discard (it already works, but reads as a declaration).
    • Review with the user: whether defer should stay exempt (decisions above left “whether discarding a close‘s Result in defer deserves a warning” open), and whether a lambda yielding unit should be held to the rule (it is, so xs.foreach(f -> fs.remove(f)) is an error).
  • Settled on the user’s delegation 2026-11-13 (built on branch bigint-natural): Integers meet a type that takes them, through a core trait FromInteger (2026-11-13, branch bigint-natural; types). trait FromInteger with one member, static fromInteger[N: Integer](n: N) -> Self; BigInt implements it. (1) An integer literal where such a type is expected is T.fromInteger(literal), the literal typed as a long where it fits and otherwise at the narrowest width a multiple of 64 bits that holds it, so a literal of any size and base is a BigInt (val x: BigInt = 123456789012345678901234567890). (2) In + - * / %, the comparisons and ==/!=, an operand of an integer type (or a type parameter bounded by Integer) beside an operand of such a type is converted with fromInteger, on either side and in chains; a compound assignment converts only its value, so an integer target keeps its type. (3) Where the type has an operator method of the name and no overload of it takes an integer, its integer argument is converted, and a converted left operand calls it. (4) An integer literal is refused as a pattern for such a type, since its value is a call. WHY: f * i, f == 0 and val f: BigInt = 1 are what a reader writes, and BigInt(i) around every integer hid the arithmetic. One trait serves both rules and any later number type (a decimal, a rational) joins by an impl, with no type named in the checker; the conversion is lossless by the trait’s contract, which is why it is allowed where integer widths, which can lose, still need long(x). A literal too large for long reuses the arbitrary-width integers rather than a text form, so the trait has one member. ALTERNATIVES: operator methods on BigInt taking [N: Integer] (covers big * i only; i * big and 0 == big still need a checker rule, so two mechanisms); a general reversed-operand lookup on the right operand’s type (larger, and it says nothing of literals or ==); implicit conversion of an integer to a FromInteger type at every expected type, arguments included (wider than asked, and it makes overloads f(BigInt)/f(long) harder to read); a fromDigits(text) member for literals past long (a second member every implementer writes, and a parse at run time). Literal patterns for such a type (matching by ==) were left out: a pattern is a constant today, and coverage reasons about constants. Review with the user: whether the conversion should reach plain arguments (gcd(7) already works for a literal; gcd(i) does not), and whether BigInt.zero()/one() should lose their () with the core traits’ wave.

  • Settled on the user’s delegation 2026-11-13 (built on branch bigint-natural): BigInt(n) with a literal past long stays an error (2026-11-13, branch bigint-natural): apply(n: long) and apply[T: Integer](n: T) give the literal no wider type, and the message says it does not fit; val x: BigInt = … is the spelling. WHY: typing a literal at a free Integer bound by its size would be a second literal rule for one call. ALTERNATIVE: an apply overload the literal rule reaches.

  • Settled on the user’s delegation 2026-11-13 (built on branch bigdecimal): BigDecimal: an immutable unscaled BigInt and a scale, rounding by a Rounding data type, no context object (2026-11-13, branch bigdecimal; types). The class is BigDecimal(val unscaled: BigInt, val scale: int); a negative scale traps in the constructor, so a whole number is always scale 0 and a large one carries its zeros in unscaled. Rounding has HalfEven (the default everywhere), HalfUp, HalfDown, Up, Down, Ceiling and Floor, and no mode that traps on inexactness: the exact operation is exactDiv, answering an Option. Every rounding operation takes its precision positionally and its mode by name: round(places, rounding = …), roundSignificant(digits, rounding = …), div(o, scale, rounding = …), divSignificant(o, digits, rounding = …). WHY: one value type with its precision stated at each call reads plainly and has no hidden state; an Option says “may not be exact” in the type where a trapping mode would say it at run time. ALTERNATIVES: a context object or a thread-wide default (hidden state, the thing the user asked to leave out); an Unnecessary mode (a trap where a type can say it); a visible negative scale (1E+3 as unscaled 1, scale -3: compact, but a second spelling of every whole number and a source of surprise in scale).

  • Settled on the user’s delegation 2026-11-13 (built on branch bigdecimal): / gives 34 significant digits, half to even, and an exact quotient within them at the “preferred” scale (branch bigdecimal). The quotient is rounded to 34 significant digits, then zeros after the point are dropped down to the dividend’s scale less the divisor’s (never below 0): 1 / 4 is 0.25, 6.00 / 2 is 3.00, 1 / 3 has 34 threes. So / agrees with exactDiv wherever it is exact, and divSignificant keeps the same rule at its own digit count. WHY: 34 is the precision of a 128-bit decimal, enough for money and rates; padding every quotient to 34 digits (0.2500000…) would make / useless for display. ALTERNATIVES: a fixed scale for / (wrong for large and small magnitudes alike); refusing / and requiring div (the user asked for a default); no zero-stripping (the padded form above).

  • Settled on the user’s delegation 2026-11-13 (built on branch bigdecimal): Decimal literals reach a type through a core trait FromDecimal: FromInteger, with the literal’s text (branch bigdecimal; types). static fromDecimal(text: string) -> Self takes the literal as written, sign and exponent kept and separators dropped; RealLit now keeps its spelling for this. The parse happens at run time, each time the literal is evaluated. WHY: the literal is exact only if no real is ever made of it, and text is the one form every decimal type can read; the trait mirrors FromInteger, so a program’s own decimal type joins by an impl. ALTERNATIVES: emitting BigDecimal(unscaledLiteral, scale) (exact and parse-free, but names one library type in the checker and serves no other); a compile-time constant pool (later optimization, not a language question). Review with the user: whether to hoist the parse once performance matters.

  • Settled on the user’s delegation 2026-11-13 (built on branch bigdecimal): A BigInt meets a type that takes decimals by FromDecimal.fromBigInt (branch bigdecimal). The trait’s second member converts a BigInt operand beside a FromDecimal type under the five operators, the comparisons and ==, either side, chains and compound assignment included, as an integer operand meets a FromInteger type. A type that takes only integers takes no BigInt. WHY: price * qty with a BigInt count should read as written, and a type taking every decimal takes every whole number losslessly. ALTERNATIVES: a fromBigInt member on FromInteger (every integer-only type would have to write it, with nothing to build it from); converting through fromDecimal(n.toString()) (no extra member, but a text round trip on every operation); overloads on BigDecimal and BigInt (covers one pair of types, and BigInt would have to know BigDecimal).

  • Settled on the user’s delegation 2026-11-13 (built on branch bigdecimal): A real literal waits for the other operand only beside a value that is not a literal (branch bigdecimal). In x + 0.5, 0.5 + x and x < 0.5, the literal takes x‘s type, so a BigDecimal x makes it one; among literals alone (1 + 0.5, 1 < 2.5) everything is a real as before. WHY: the operand order rule integer literals follow, extended without changing a program that compiled.

  • Settled on the user’s delegation 2026-11-13 (built on branch bigdecimal): The Rounding variants are core names, seen everywhere (branch bigdecimal). HalfEven, Up, Down, Ceiling, Floor and the rest are variants of a prelude data type, so rounding = Floor needs no import or qualifier. A program’s own Up or Down hides them where nothing expects a Rounding, and where one is expected the bare name is still Rounding‘s, as for None and Some; Rounding.Up is always available. WHY: the call reads x.round(2, rounding = HalfUp), as asked. ALTERNATIVES: a module avin.math for BigDecimal and Rounding (an import for every program using money); prefixed names (RoundHalfUp). Review with the user: short common words such as Up and Down in the prelude.

  • Settled on the user’s delegation 2026-11-13 (built on branch bigdecimal): BigDecimal‘s smaller choices (branch bigdecimal): (1) the sign accessor is sign, as on BigInt and the integers, not signum; (2) round(places) always answers that scale, padding with zeros where the number has fewer places, and a negative places rounds to tens, hundreds, … answering scale 0; (3) roundSignificant drops one zero a carry adds after the point (9.99 to 2 is 10), while a whole number keeps the zeros it needs; (4) % and divRem use the quotient cut toward zero, the remainder taking the dividend’s sign, as on BigInt; no floorDiv yet; (5) toBigInt, toLong and toInt take the whole part toward zero, as real‘s do, trapping (or None) only when it does not fit; (6) fromRealExact and fromRealShortest trap on NaN and the infinities and answer the least scale that holds the value; fromRealExact writes the real with 1074 places through %f, which every finite real fits exactly; (7) BigDecimal(text) and parse accept .5, 5. and an exponent, refuse separators and white space, and answer None for a resulting scale outside int (a large positive exponent within it, 1e100000000, is read, at the cost of its digits); (8) %f takes a BigDecimal with its precision as places, half to even, and with none keeps its own scale; %e, %g, %s, %d and , are refused; (9) the hash is the least-scale form’s, so equal values hash alike; (10) exactDiv by zero traps, as every division does, since None means “never ends”; (11) BigDecimal.zero() and one() are at scale 0; (12) mixing a real value with a BigDecimal is an error that names fromRealShortest and fromRealExact. ALTERNATIVES weighed for each: signum (inconsistent with BigInt); round never adding places (then round(2) cannot be used to show cents); floor division for % (different from every other % in the language); traps for fractional toLong (the whole part is what conversions take elsewhere); Option from the real conversions (NaN is a programming error, not data); a %f default of 6 places (loses digits a decimal holds exactly).

Deferred

  • Path-dependent and intersection types; inferred unions; implicit parameters; macros.

  • Settled by the user 2026-11-13: Avin has higher-kinded types and a standard Functor, Monad and Traverse family, reversing their deferral; the design’s choices are under Proposed (branch hkt-design), and the guiding rule the user gave with it is that Avin is the ultimate sound, nominally typed, compiled, garbage-collected high-level language: every rule is sound with no unchecked escape, the traits are nominal, and for comprehensions admit their sources by conformance.

  • Settled on the user’s delegation 2026-11-12 (built on branch library-version): the standard library carries the compiler’s version, and the compiler refuses a library of any other. library/library.hocon‘s package.version is stamped by scripts/release.sh in the same commit as const Version and compiler/sysl.hocon, and a compiler checks it against its own before it compiles anything: check, build, run, test and lsp print one error naming both versions and the library’s path, and nothing else. A library with no version, or a library.hocon that is missing or unreadable, is refused the same way. The rule is an exact match. A compiler built between releases carries the last release’s version, and so does the library in its own checkout, so a development build matches its own tree; only a library from another release, through AVIN_ROOT or an install, differs. Why: a library of another version fails as dozens of errors inside library/avin/*.avin, which points a reader at the library rather than at the mismatch. Alternatives weighed: a dev compiler accepting a library from the same commit (needs a commit id stamped into both and a build step that keeps them in step, to answer a case the exact rule already passes); “the library is newer than the compiler” (a newer library declares what an older compiler cannot check, which is the failure being fixed). Review with the user: whether a pre-release suffix should be accepted in the library’s stamp; manifests accept three numbers only, as sysl.hocon‘s version does.

  • Settled on the user’s delegation 2026-11-15 (built on branch c1-diagnostics): A method declared m() and named bare where a value is expected is reported as “m is called with (): write c.m(), or () -> c.m() for a function value”, the call first, written on the receiver as the program named it (a local or parameter by name, self, a type for a static member, nothing for a bare name’s implicit self), _.m() alone for a placeholder, and .m() with “a lambda calling it” for any other receiver. Why: the error is almost always a missing () now that pure accessors are declared without a parameter list, so the fix leads, and a fix written on the program’s own receiver is what the reader types; the old text (“is declared with an empty parameter list, so naming it without a call makes a function value, which is allowed only where …”) put the rule before the fix and showed x.m() for every receiver. Alternatives weighed: repeating a complex receiver’s source text (the checker holds no source text, and a long chain would crowd the message); keeping the x. placeholder (it names a variable the program does not have). The opposite message, for x.m() on a parameterless m, is unchanged: it already reads well inside lambdas, placeholders and chains.

  • Settled on the user’s delegation 2026-11-13 (built on branch fmt-two-space): avin fmt keeps a function’s clauses together. No blank line goes between a function’s signature and its first clause or between two of its clauses, at the top level, in a class, an object, a trait or a block alike, and blank lines the source wrote there are dropped, around any comments between the clauses too (the comments stay). A clause is recognised as the parser recognises one: the name of the signature or clause before it at its level, an argument list, then =, a guard or an indented block of guards; the signature is a line naming the function with typed parameters, no = and no indented body. The function counts as one declaration, so the blank line between it and a different declaration before or after it stays as before, and a blank line inside a clause’s body is the body’s own and stays. In a literate file, blank lines beside prose are the document’s and are kept even between clauses. Why: a function written as clauses is one declaration and the preferred form for a function that matches on its parameters; a blank line before a multi-line clause, which the rule for top-level declarations put there, makes it read as several declarations. Alternatives weighed: keeping the blank lines the source wrote and only not adding any (a file would read differently by who wrote it, and the formatter is meant to settle exactly this); a blank line between clauses only around a multi-line one (it still splits one function in two); a blank line between every clause (it spreads a short definition over twice its lines).

  • Settled on the user’s delegation 2026-11-15 (built on branch http-stream): A streamed response is a Response whose body a function writes through a BodyWriter (Response.stream(status, contentType, write), with a length overload, and Response.events for server-sent events through an EventWriter). The head says Transfer-Encoding: chunked, or Content-Length where the length is given, or to an HTTP/1.0 client neither, the body ending with the connection. Each write answers Result[unit, IoError], Err once the client has gone or the server is stopping and for every later write; a write past a given length traps; a handler trapping once the head is sent has its connection closed with no 500. Why: one Response type keeps routers, middleware and error pages working on streamed answers unchanged, and a Result per write makes the end of a stream the program’s ordinary control flow. Alternatives weighed: a separate StreamedResponse type beside Response (every handler type and middleware doubled); a handler handed the connection (the server loses its framing and keep-alive); writes that trap when the client has gone (a client leaving is not a bug). Review with the user: whether Response.events‘s fifteen-second keep-alive default suits.

  • Settled on the user’s delegation 2026-11-15 (built on branch http-stream): Typed parameters through a FromParam trait of static methods, paramAs[T], queryAs[T] (with a default overload) and queryOption[T] answering Result[_, ParamError], Missing or Invalid; string, int, long, real and bool implement it. Why: a static parse makes a program’s own type a parameter type by one impl, and a Result lets ? answer the client 400. Alternatives weighed: separate queryInt/queryLong methods (closed to a program’s own types); trapping on bad input (a client error is not a server bug).

  • Settled on the user’s delegation 2026-11-15 (built on branch http-stream): Handlers that fail answer Result[Response, ToResponse]: ToResponse is a trait with toResponse(), implemented by Response itself and ParamError, fromResult turns such a function into a Handler, and each Route.get … patch has an overload taking one. Why: ? then ends a handler with any failure the program’s own error types can render, and a plain Response handler is untouched. Alternatives weighed: one Result-only handler type (every simple handler would wrap in Ok); an Error-bounded error rendered as 500 (hides the status the program meant). Making the overloads work needed two compiler fixes: a lambda tried against several overloads is compiled only for the one chosen, and an argument checked before the overload was chosen is made @sendable where the chosen one’s parameter is (tests overload_lambda_return, overload_sendable, overload_sendable_capture).

  • Settled on the user’s delegation 2026-11-15 (built on branch api-request-values): A middleware hands values on through the request, keyed by their exact type: ServerRequest.withValue[T: Sendable](value: T) -> ServerRequest and value[T: Sendable]() -> Option[T]. withValue answers a new request; a second value of one type replaces the first; the key is the type withValue was given, compared exactly as a type pattern compares a generic type’s arguments (each value is held in an invariant private Carried[T] as an Any), so a value handed on as a trait is not read as its class nor the reverse, and int is not long. Parameters a router binds keep the values. Why: the type is a key no two middlewares collide on by accident and that needs no cast to read, reified type patterns make it sound with no new language feature, and a request id or a span from a logging middleware fits the same API as a user from an auth one. The names follow withParams and header(name) beside it. Both take Sendable because a handler may move what it reads onto another thread (untilStopped), and a non-sendable T is refused at value too rather than silently answering None. Alternatives weighed: a key object (RequestKey[T]) for two values of one type — not built, since a program wraps each in its own data type, which also names what the value is, and the library has no key-object idiom elsewhere; subtype matching on read (value[Role]() finding an Admin) — refused, since which of two values answers would depend on their order; route parameters or headers as the carrier — strings only, and spoofable from the client; the names with/get — with already means running a body on a Mutex, and withX is the request’s and the response’s existing form. Review with the user: whether a key-object form is wanted after all.

  • Settled on the user’s delegation 2026-11-15 (built on branch http-stream): Route groups and middleware are plain functions: type Handler, a middleware (Handler) -> Handler, Route.wrap, Route.under and Route.group(prefix, routes, middleware) answering a Vector[Route], nesting with the inner middleware inside the outer. A prefix must begin with / and not end with one, else it traps. Why: groups flatten into the router’s one ordered list, so matching, 405 and HEAD stay as they were. Alternatives weighed: a nested router type (two matching rules); a prefix tolerating a trailing / (two spellings of one path, and // after joining).

  • Settled on the user’s delegation 2026-11-15 (built on branch http-stream): Error pages are an ErrorPage = @sendable (int) -> Response, given to Router (its 404 and 405) and http.serve (every status it answers itself), defaulting to plainError, the reason phrase as text; the status sent is always the one given, and a 405 keeps its Allow. Why: one function covers JSON or HTML pages without a table of statuses. Alternatives weighed: a Map[int, Response] (every status listed by hand, and none computed); letting the page change the status (a 404 page answering 200 misleads clients).

  • Settled on the user’s delegation 2026-11-15 (built on branch http-stream): isStopping() and untilStopped(wait) on a ServerRequest, BodyWriter and EventWriter, untilStopped running wait on its own thread through TcpServer.idle, so stopping cancels it and the handler gets None. Why: a long poll or an event stream otherwise holds join() until its client goes. Alternatives weighed: a cancellation token passed to every handler (every handler signature changes); leaving shutdown to the write timeout (a quiet stream would hold it for writeTimeout).

  • Settled on the user’s delegation 2026-11-15 (built on branch api-websocket): An upgrade is a Response too: Response.upgrade(protocol, take) is a 101 carrying an Upgrade, and the server, seeing one, writes the head with Upgrade: protocol and Connection: Upgrade and hands take an Upgraded (the stream, the bytes it had read ahead past the request, the write limit, and the server’s isStopping/untilStopped), reading no more requests and closing the connection once take returns; a trap in take closes it with no 500. Why: routes, groups and middleware apply to a WebSocket route unchanged, as they do to a streamed one, and the bytes read ahead are not lost when a client sends its first frame with the handshake. Alternatives weighed: a separate upgrade handler type on Route (middleware written twice); handing the raw ByteStream alone (a frame read ahead with the request would vanish).

  • Settled on the user’s delegation 2026-11-15 (built on branch api-websocket): WebSockets in avin.net.http: webSocket(request, session, protocols, maxMessageBytes = 1 MiB, closeTimeout = 5 s) -> Response checks the handshake and answers 101, 405 (not GET), 426 with Upgrade: websocket (no upgrade to a WebSocket asked), 426 with Sec-WebSocket-Version: 13 (another version) or 400 (HTTP/1.0, no Connection: Upgrade, a key not sixteen bytes of base64); the subprotocol chosen is the server’s first that the client offers. WebSocket.connect(url, headers, protocols, tls, timeout, maxMessageBytes) is the client, ws and wss. Both ends share one WebSocket: send(text), send(bytes), ping, receive(), receive(limit), close(code, reason), isOpen, isStopping, untilStopped, answering Result[_, WebSocketError] (Closed(code, reason), Broken, and for connect Refused, BadHandshake, Unreachable). Why: one module with the HTTP server it upgrades from, and errors the program’s control flow handles, as a BodyWriter‘s are. Alternatives weighed: an avin.net.websocket module (it needs the server’s private connection loop); a callback per message (onText, onClose; the session’s own loop reads more plainly and keeps its state in locals).

  • Settled on the user’s delegation 2026-11-15 (built on branch api-websocket): What a WebSocket does by itself: a ping is answered with a pong as it arrives and a pong is passed over; a fragmented message is put back together, control frames between its fragments answered; the size limit is checked against a frame’s declared length before its payload is read, so an oversized message is refused without being buffered (1009); text is checked to be UTF-8 once the message is whole (1007), and so is a close reason; a frame breaking the protocol (1002) — a client’s frame not masked or a server’s masked, a reserved bit, an unknown opcode, a fragmented or long control frame, a continuation with nothing to continue or a new message inside one, a close of one byte or with a code no endpoint may send, a 64-bit length with its top bit set — fails the connection: the close frame is sent and the connection closed at once. A close from the other end is answered with its code (none for none, heard as 1005) and the connection closed; this end’s close waits closeTimeout for the answer. A session returning with its WebSocket open closes it with 1000; a server stopping closes it with 1001 at its next receive (the wait being through idle) or send; a peer going without a close is Closed(1006, …). A frame’s length need not be in its fewest bytes, though this end writes it so; every message is sent as one frame; a client masks each frame with four bytes from SecureRandom. Why: these are RFC 6455’s rules where it gives them, and where it leaves a choice (validating UTF-8 at the end rather than as fragments arrive, accepting a longer-than-needed length) the simpler one that still refuses what it must. Alternatives weighed: surfacing pings and pongs as messages (every session would answer them by hand); validating UTF-8 per fragment (fails a bad message sooner, at more code). Review with the user: a WebSocket belongs to one thread, as its stream does (a TLS stream checks its owner), so a session that must send what another thread produces while also receiving polls with receive(limit); a select-like receive over a channel, or a sendable sending half, would be the next step if a program needs one.

  • Settled on the user’s delegation 2026-11-15 (built on branch lazy-local): A local lazy val, in a block, is the value of a cell made where it is declared, the core library’s private LazyCell[T], holding the value, its state word and the closure computing it, so a read is that cell’s lazy field read: once on the first read, under the same protocol as a field’s between threads, with the same trap for a read made while it is being computed. The choices the request left open:

    • Closures share it. A closure capturing the name captures the cell, so a first read inside the closure computes it for the enclosing scope too, and the reverse; it outlives its block. A declaration in a loop body makes a new cell on every pass. Alternatives: copying the value into the closure at capture (would force it where the closure is made, defeating the point); one cell per declaration site (wrong for loops and recursion).
    • The initializer sees the locals as they are at the first read, a captured var included, since it is a lambda run then; fields see their object at the first read in the same way. Alternative: snapshotting the locals at the declaration (would need a copy of every captured var, and differs from what a lambda written in the same place does).
    • Across threads, sendable where its type is and its initializer would be. A @sendable closure (a thread’s body, a future’s) may capture a local lazy val only where the value’s type is sendable and every local and parameter the initializer captures passes the rules that closure is held to, a var refused, through each lazy value the initializer reads in turn; what the initializer reaches is held to the module-level state rule too. Why: the initializer may run on whichever thread reads first, so it is code the closure carries; a field’s initializer captures only its object, which the object’s own sendability covers. Alternatives: refusing every capture of a lazy local by a @sendable closure (simpler, but refuses the plain case of a sendable value computed from sendable vals); checking the value’s type alone (unsound: an initializer capturing a Buffer or a var would run on another thread).
    • A self-read follows the other lazy values: today it traps at run time, avin: trap: `x` is read while it is being initialized, as a field’s and a module-level value’s do, and a lazy list may refer to itself through its cells. The sound-initialization design (### lazy val in declarations) makes a read the initializer’s own code reaches a compile error; a local is held to it in the same way when that is built, and its run tests lazy_local_self_direct (a direct read, which becomes a reject test) and lazy_local_self (a read through a closure the initializer calls, which stays a trap) say which side each falls on. A trap in the initializer stops the program as any trap does.
    • The type must be known where it is declared: an initializer whose type is not settled there (one reading only its own value) is refused with “cannot infer the type of x“, as a field’s is, rather than settled by later uses as a plain val‘s may be. An initializer that never finishes gives the type Nothing. A mismatch with a declared type is reported as “the initializer of x yields …”.
    • One name per declaration: lazy val (a, b) = … and lazy val a, b = … are refused (“take the value apart where it is read”), as is a lazy val without an initializer; an assignment, a compound assignment and a step are refused as for a module-level lazy val.
    • Cost: a declaration allocates the cell and the initializer’s closure, both kept until the cell is unreachable. Alternative weighed: storing the value, state and closure in boxed locals without an object (saves one allocation but needs a layout of its own in the lowering and a separate sendability rule); clearing the closure after the first read (frees its captures early, but fields keep theirs, and a race-free clear needs another store on the hot path). Review with the user: the cross-thread rule (the more permissive of the two sound choices).
  • Settled on the user’s delegation 2026-11-15 (built on branch sync-kit): A WaitGroup counts work and has no spawn. add, done, wait, a timed waitFor and pending; a count below zero traps. Why: a scope already starts threads and waits for them structurally, so a spawning wait group would be a second way to do what scope does; what a wait group adds is counting work finished by threads started elsewhere (an executor, an actor, another scope) or by no thread at all. Alternatives weighed: wg.spawn(body) starting and counting a thread (duplicates Scope.spawn, and an unscoped spawn escapes cancellation); answering a negative count by clamping at zero (hides a double done).

  • Settled on the user’s delegation 2026-11-15 (built on branch sync-kit): A Semaphore has a capacity, and a release beyond it traps. Semaphore(permits, capacity = permits); negative permits, a capacity below one or more permits than the capacity trap too. Permits belong to no thread, and waiters are not queued (one arriving as a permit comes back may take it first). Why: an over-release is the same bug as a wait group’s double done, a permit given back that nobody took, and a trap finds it where it happens; the separate capacity keeps the signalling use (Semaphore(0, capacity = 1)) that an “at most the initial permits” rule would forbid. Alternatives weighed: an unbounded count (a silent over-release grows the limit for good); permits owned by the thread that took them (rules out a permit taken by one thread and given back by another, which hand-offs need); a FIFO queue of waiters (a cancelled waiter would have to take its place back, for a fairness the condition’s oldest-first wake mostly gives already). Review with the user: trap or ignore an over-release.

  • Settled on the user’s delegation 2026-11-15 (built on branch sync-kit): withPermit and a RwLock‘s read give back what they hold when a cancellation stops their body; a RwLock‘s write runs to its end; a trap in any of them stops the program. The share is taken under the library’s lock and held in a region in doubt from that moment until it is given back (the runtime’s new lock_release_holding and cancel_guarded_held), so no cancellation can come between taking it and the body. A read body or a permit’s body runs at a cancellation point of its own inside that region, so a cancelled scope stops a long download inside withPermit at once and the permit goes back, while a trap there, even in an actor, stops the program as one under a lock does, since recovering the actor’s turn would leave the share held for ever. A write body is also uncancellable, as a Mutex‘s body is, since stopping it could leave the value half changed. Why: a semaphore guards no value, and a reader changes nothing, so nothing is left in doubt by stopping them; a writer does change the value. Alternatives weighed: every body uncancellable, as a mutex’s (a scope’s cancellation would wait for every permit holder’s whole body); every body cancellable (a write could leave the value torn); a trap in an actor’s body failing only the actor (needs a give-back chain run by the actor’s recovery, which the runtime does not have).

  • Settled on the user’s delegation 2026-11-15 (built on branch sync-kit): A RwLock lets writers in first, and lets in the readers a write kept waiting before the next writer. A reader that arrives while a writer waits waits behind it; when a write ends, every reader then waiting is admitted ahead of the writers waiting. Why: writers do not starve under overlapping readers, and readers do not starve under back-to-back writers, with no tuning. Alternatives weighed: pure writer preference (readers starve while writers keep coming); reader preference (writers starve); a strict FIFO of both (serialises readers that could share). Review with the user: a read body is trusted only to read; nothing stops it changing a mutable value other readers share, which races with them (a race is not undefined behaviour in Avin, but the type system does not rule it out here as it does elsewhere). A read-only view of a value would close it and is a language feature, not a library one.

  • Settled on the user’s delegation 2026-11-15 (built on branch sync-kit): A Barrier‘s action runs under its lock, and a party cancelled while waiting withdraws. The last arrival runs the action holding the barrier’s lock, so the action is uncancellable and one that waits on its own barrier traps as a lock taken twice does; wait answers whether the caller arrived last. A cancelled waiter takes its arrival back (it is not counted for the round), through the runtime’s settling condition wait, which answers a cancellation with the lock held again rather than stopping at once. Why: a scope cancelled mid-round leaves the barrier as if the stopped parties had never come, ready for new ones. Alternatives weighed: a cancelled party staying counted (the round could trip with a party missing); “breaking” the barrier for every party (a state each wait would have to answer); running the action outside the lock (waiting on its own barrier would then deadlock instead of trapping).

  • Settled by the user 2026-11-14 (built on branch contextual-keywords, from the user’s decision of 2026-11-14 that data keeps its spelling and becomes contextual): the words that begin a top-level declaration are keywords only there, before the name they declare, and ordinary names everywhere else: data, class, object, trait, impl, import and module join type, opaque, export, derive, actor and machine, and open and abstract are keywords only before class. So val data = readFile(p), a field class, a method object(), a parameter import, a named argument module = 2, a type parameter, a variant, a module named data and r.type are all legal, and data(x: int) at the top level declares a function called data. The reserved words stay: as, is, match, then, else, elif, do, yield and derives, because each follows a complete operand on its line (x as T, if c then a, Base(x) derives Eq), where a name is an infix call; if, while, for, loop, defer, return, break, continue, val, var and def, because each begins a statement or a declaration inside a block, where a line may equally be an expression starting with a name (loop and an indented block would read as a call of loop with a trailing block; return (x) as a call); private, static and override, because they begin a member of a class body, where a line may be a statement, and private + (o: T) would be both a method named by a symbol and an expression on a value; true, false, self and super, which are values. end keeps its rule (a keyword only before a name), and not and with theirs. Why: the test is whether the keyword’s every position can be told from a name’s by the next token alone. A top-level line holds only declarations, never a statement, so a declaration word followed by a name can mean nothing else, and none of these words begins anything inside a block or a class body. Alternatives weighed: renaming data (the user kept the spelling); making every word contextual by look-ahead over whole lines (loop, return and the modifiers would each need a rule of their own that a reader cannot see at a glance); keeping class and object reserved as the most declaration-like (they are common field names, and nothing about them is less decidable than data). The user settled 2026-11-14 that private, static and override stay reserved: a modifier used as a variable name would read strangely.

  • Settled on the user’s delegation 2026-11-14 (built on branch hkt-7): a trait for types whose members never write Self bounds constructors too (generics). A trait with parameters, no static member, no member naming Self beyond the receiver, and requiring only such traits (Foldable[A], any Countable[A] of a program’s own) is a trait for types everywhere it is one, and also a bound of a constructor parameter of its arity: impl Foldable for Option makes each Option[T] a Foldable[T], so Option is a constructor for [F[_]: Foldable], and a constructor trait may require it at its own parameters (trait Traverse[A]: Functor[A], Foldable[A]). A type conforms as a constructor only where a conformance states the trait’s parameters as its own parameters, so impl Foldable[int] for Ints makes no constructor; a type whose parameter is bounded is one only for a hole promising that bound (TreeSet for F[_: Ord]), as for a constructor trait; a trait naming Self otherwise or declaring a static member bounds types only, and one writing Self[X] stays a constructor trait, never a type. Why: Foldable‘s method mentions no Self, so what it promises of an F[X] is exactly what the type conformance promises of that type; one trait serves both uses, generic code over constructors reads the conformances the collections already have, and nothing new is needed at run time (each instance’s call is the ordinary call on its type). Alternatives weighed: a constructor trait requiring a trait for types at its holes (a constraint on every application Self[A], a second notion with its own rules, where the dual reading needs none); giving Foldable a method that writes Self (an artificial member, and it would stop Foldable[int] being a type). This supersedes the Proposed “a constructor trait requires only constructor traits” (branch hkt-3) for traits that bound constructors.

  • Settled on the user’s delegation 2026-11-14 (built on branch hkt-7): every Iterable[A] is a Foldable[A]. Iterable requires Foldable and gives foldLeft as its default, moved from the impl adding methods to every Iterable; List gives its own walk in its impl of Seq and Vector overrides it, so every collection of one parameter is a constructor for [F[_]: Foldable] with no impl of its own, and Option, Result and Either gain foldLeft in their impls of Traverse. A class of a program’s own conforming to Iterable that declares its own foldLeft now marks it override. Why: the fold is what every collection already has, and the nominal rule needs a conformance; one in Iterable gives it to all of them at once. Alternatives weighed: impl Foldable for each collection (an impl per type, each restating foldLeft, since a method an impl adds to a trait does not implement another trait’s); leaving the collections out of Foldable (generic folds would not take a Vector).

  • Settled on the user’s delegation 2026-11-14 (built on branch hkt-7): Seq and Set leave the table of the standard constructor traits; the impls are for concrete types only (generics): List, Vector, ArraySeq, Queue, LazyList, Array, Buffer, Deque, Option, Result, Either, and the sets and sorted collections as Foldable only, since their map answers a Set and needs Eq & Hash or Ord of its result. Generic code over sequences takes an F[_]: Monad (or the trait it needs). No impl is for a trait type. Why: an impl is for a type’s own constructor, and a trait’s map answers the trait’s type for every implementing class, so Seq could meet Functor only through an impl for a trait, which the language does not have. Alternatives weighed: impls for trait types, a future language feature, added only if a library need appears.

  • Settled on the user’s delegation 2026-11-14 (built on branch hkt-7): traverse and sequence through Applicative.map2 apply f to every element and answer the first failure. The spec’s “stops at the first failure” means the result, not evaluation: a sequence’s traverse folds through map2, which runs f on each element in order, and the first None, Err or Left decides what is answered. Why: traverse is written once for every applicative, and map2 is all an applicative gives; stopping early would need a short-circuiting fold the trait does not have. Alternatives weighed: a stopping traverse per constructor of the result (Option‘s, Result‘s), which generic code at a program’s own applicative would not have.

  • Settled on the user’s delegation 2026-11-14 (built on branch hkt-7): a constructor trait’s parameter bounds ask nothing of the conforming type’s parameters: impl SendableMonad for Future, whose T has no bound, conforms, since the trait applies the constructor only to types meeting Sendable; a type whose parameter is bounded by more than the trait’s parameter promises is still refused, and a trait requiring the trait bounds its own parameter as it does. A conformance had held T to Sendable as an ordinary trait argument, against the spec’s “bounded by no more than Sendable“. Alternatives: none that keep Future a SendableMonad with its parameter unbounded.

  • Settled on the user’s delegation 2026-11-14 (built on branch hkt-8): a value bounded by two traits that reach one method, one of them overriding it, has the override alone: with F[_]: Monad & Filter, fa.map is Monad‘s default, not also the Functor method Filter requires; with T: Loud & Quiet over Base, describe is Loud‘s override. The calls had been reported ambiguous, so the spec’s F[_]: Monad & Filter took no comprehension. Why: a type conforming to both has the override as its one method, so the bound has it too, as a type inheriting both already did (unreplaced). Alternatives: none; the ambiguity was a bug.

  • Settled on the user’s delegation 2026-11-14 (built on branch hkt-8): the views withFilter makes conform to Iterable, each by an iterator() that tests the source’s elements as they are reached; their own map, flatMap, withFilter and foreach are kept, so a comprehension’s result is the collection’s as before. Why: the spec says the calls after a guard are on an Iterable; a view may now be held as one, looped over and folded. Alternatives: leaving the views outside the hierarchy (a guard’s result could not be passed where an Iterable is wanted).

  • Settled on the user’s delegation 2026-11-14 (built on branch hkt-8): a refused comprehension source names the fix only where the module can make it: declare impl Monad for Box for a type of one parameter declared in the module being checked, “declare an impl of Monad for Pair at the parameter it holds its elements in” for one of more, “a type of no parameters is a source only as an Iterable“ for one of none, “add Monad to the bounds of F“ in generic code, and nothing for another module’s type (Result‘s missing Filter), whose impl the module rule puts out of reach. The source is named where it is a name (`box` is a `Box[int]`), “this source” otherwise; a guard’s refusal is reported at the guard. A source is checked for its roles before any call on it, and a refused one checks nothing after it. Alternatives: always suggesting an impl (wrong advice for a library type).

  • Settled on the user’s delegation 2026-11-15 (built on branch api-pool): a resource pool is avin.threads.Pool[T, E], lending through a body (pools). use(f) and lease(f) lend a resource for the call of f and always take it back, answering Result[R, PoolError[E]]; there is no acquire/release pair. Why: the scope of the body is what makes “always returned” true by construction, on a return, a cancellation inside it, and a trap (which stops the program); a resource handed out by acquire comes back only if every path remembers to give it back. It sits in avin.threads beside the semaphore it resembles, built on the same lock and cancellation machinery; the executor’s private worker pool, which was also called Pool, is renamed WorkerPool. Alternatives weighed: an acquire() answering a lease to release() by hand (an actor holding a connection across messages would want it; it can be added beside the body form later); a module of its own (avin.pool), which would need the threads module’s private machinery made public. Review with the user: whether an explicit acquire/release form is wanted for resources held across an actor’s messages.

  • Settled on the user’s delegation 2026-11-15 (built on branch api-pool): a pool’s resources are isolated rather than sendable. A Pool is sendable whatever T is, as a Mutex is: create, validate and destroy are @sendable, so a resource is made from sendable values alone, and use‘s and lease‘s bodies are @isolating and give back a sendable R, so the resource never leaves the call it is lent to. Why: the resources worth pooling are mutable (a connection’s buffers and state), and a program’s mutable class cannot promise Sendable (the @trusted_sendable mark is the standard library’s), so a pool that asked T: Sendable could not hold the database client it exists for. The cost: a body may not capture a mutable value from around it, and two mutable resources cannot be used in one nested body (db.use(c -> cache.use(r -> … c …)) is refused, since the inner body captures c). Alternatives weighed: T: Sendable (sound, and too narrow, as above); unrestricted bodies (a resource kept past its call would be used by two threads at once). Review with the user: the nested-body restriction, which a borrow form the language does not have would lift.

  • Settled on the user’s delegation 2026-11-15 (built on branch api-pool): a pool’s waiters are served first come, first served, by direct hand-off. A resource given back goes straight to the call that has waited longest, and so does the place a destroyed resource or a failed make gives up; a new call queues behind any waiter even when it comes just as a resource is given back, so no call is overtaken. Idle resources are lent most recently used first, so the oldest expire under idleTimeout. Why: fairness the brief asks for, and an AcquireTimedOut under load then means the pool is too small rather than unlucky. Alternatives weighed: waking any waiter and letting it race (the semaphore’s way; cheaper, and unfair); oldest idle first (keeps every connection warm, and none ever expires on a quiet server).

  • Settled on the user’s delegation 2026-11-15 (built on branch api-pool): every function a pool runs for a call runs where a trap cannot be contained. A trap inside f, create, validate or destroy stops the program even in an actor, as one inside withPermit does. Why: an actor that survived the trap would leave the pool counting a resource or a place that is never given back, shrinking it for good. f and create stay cancellable; destroy runs to its end. Alternatives weighed: containing the trap and leaking the place (a pool that slowly loses capacity in a long-running server). Review with the user: a server whose handlers are actors may prefer the handler’s failure to the program’s.

  • Settled on the user’s delegation 2026-11-15 (built on branch api-pool): idle resources expire when the pool is next used, not on a timer of their own. A call looking for a resource, and evictIdle(), destroy those idle longer than idleTimeout, keeping minIdle; minIdle also sets what warm() makes, and is not kept topped up as resources are destroyed. Why: a pool then starts no thread and holds no timer, and a program that wants eviction on a quiet pool calls evictIdle from a Ticker. Alternatives weighed: a reaper thread per pool (a thread that outlives every call and must be stopped by close); refilling to minIdle after each eviction (a create failing in the background has nobody to report to).

  • Settled on the user’s delegation 2026-11-15 (built on branch api-pool): a pool’s failure is PoolError[E]: AcquireTimedOut, PoolClosed, CreateFailed(error: E). It is an Error where E is, CreateFailed having error as its cause, and shows the same sentence wherever E has a Display. The case names carry Acquire/Pool so that they do not clash with avin.io‘s TimedOut in a program importing both. Timeouts are Option[Duration], None for waiting for ever. Alternatives weighed: a string error (loses the database’s own error); Option[T] from use (a caller could not tell a timeout from a closed pool).

  • Settled on the user’s delegation 2026-11-15 (built on branch pool-production, for the PostgreSQL driver’s pool): a Pool takes maxWaiting: Option[int], and a call that would wait while that many already wait fails at once with a new case, QueueFull. A server on lightweight threads under overload otherwise queues every request behind the pool until each one’s timeout, holding a thread and a socket for each; failing at once lets it answer 503. The bound is checked under the pool’s lock where the call would join the queue, so it is exact under any number of threads; a call that finds a resource idle or a place to make one is never refused, and a call already queued that has to look again (its resource failed validate) is not refused either. It lives in Pool rather than in a wrapper because only the lock knows the queue’s length: a count kept outside overshoots by every caller racing past the check. Alternatives weighed: a separate admission Semaphore in front of the pool (bounds callers inside, not callers waiting, so it refuses while resources are idle); reusing AcquireTimedOut (a server cannot tell overload from a slow database). Review with the user: QueueFull is a new case of a public data, so an exhaustive match on PoolError elsewhere needs an arm.

  • Settled on the user’s delegation 2026-11-15 (branch pool-production): maxLifetime and jitter retire old resources, and jitter lengthens limits, never shortens them. A resource older than maxLifetime is destroyed rather than lent (looked at in the lending, before validate) or kept (looked at as it comes back), and evictIdle destroys idle ones however few that leaves, minIdle being warm‘s to make up, since an aged connection is replaced, not kept. Each resource draws its part of jitter, from 0 up to jitter, once when it is made, and both its lifetime and its idle limit are lengthened by it; the draw comes from a SplitMix64 generator of the pool’s own under its lock, since avin.random builds on avin.threads. Adding rather than subtracting follows the PostgreSQL driver pgx (MaxConnLifetimeJitter), keeps every limit a true minimum, and needs no clamp when jitter exceeds a limit. Alternatives weighed: subtracting the jitter (a limit becomes a ceiling, which suits a server-side cutoff, but a jitter longer than the limit would need clamping); a jitter as a fraction of each limit; jitter on the lifetime only. Review with the user: subtracting is the other common choice.

  • Settled on the user’s delegation 2026-11-15 (branch pool-production): counters() answers a PoolCounters of running totals beside stats(), rather than widening PoolStats. acquires, waited, waitTime, timeouts, rejected, created and destroyed are what a server exports as metrics (pgx’s Stat, a pool’s usual gauges); PoolStats stays the deterministic snapshot of what is held now, which tests and programs print, while waitTime varies run to run. waitTime runs from the call to the lending, so it includes making or checking a resource, as pgx’s AcquireDuration does. Alternatives weighed: one wider PoolStats (its printed form would stop being stable); counting in each user’s wrapper (waited and timeouts are only known under the lock).

  • Settled on the user’s delegation 2026-11-15 (built on branch select-readable): a thread waits for a connection’s bytes OR a channel’s value with a select arm, stream.readable() -> body, not with a second waiting mechanism. A connection belongs to one thread (its reference counts are not atomic, and OpenSSL is single-threaded per connection), so the thread that owns a WebSocket must do all of its reads and writes, and so must wait for “bytes arrived or another thread queued a frame”. The arm fits the others’ shape, an operation on its operand (ch.receive(), ch.send(x)), so it composes with channel arms, after and else, and the select’s one-park, wake-once token covers it: where the stream is not readable when tried, its descriptor is registered with the runtime’s poller for one report under the select’s own waiter, and every ending withdraws it under the poller’s lock, as channel links are withdrawn. The arm binds nothing and reads nothing (its body reads), since a read’s size and form (read(max), readLine) are the body’s choice. Ready means a read would answer without waiting: buffered read-ahead, TLS plaintext already decrypted or a whole record arrived (TLS’s readable() hands the engine the ciphertext already on the socket, so part of a record does not count, and keeps any failure it meets for the next read), the end, a reset or a closed connection. Its operand is the trait avin.threads.Readiness (readable() -> bool, readinessDescriptor() -> int), which ByteStream extends, so avin.threads needs nothing of avin.net, and a source of one’s own, with -1 for no descriptor, can be named too. The thread dump counts the arms as sockets (“in a select on 1 channel and 1 socket”). Alternatives weighed: an interruptible socket wait rung by a waker (smaller, but a second way to wait beside select, composing with neither after nor several channels); an arm that reads and binds the bytes, conn.read(n) as bytes (fixes the read’s form in the arm, and a readLine could not use it); waking on socket readiness alone for TLS (a partial record would wake a select whose read then blocks). Review with the user: the spelling readable() and the name Readiness; whether the descriptor should stay a public method.

  • Settled on the user’s delegation 2026-11-15 (built on branch ws-sender): a WebSocket’s other threads send through ws.sender(), a sendable WebSocketSender that queues whole messages in a bounded outbox the owning thread writes while it receives. The owner’s receive waits in one select on the stream’s readable(), the outbox, a sender’s close request, the server’s stopped() channel and the limit, so every frame (senders’, its own, pongs, the close handshake) is written by the thread the connection belongs to, a message at a time, never interleaved. Alternatives weighed: a mutex around the socket shared by every writer (impossible: a TLS stream and a socket’s handles belong to one thread); a writer thread per WebSocket (a second owner of the connection, the same impossibility); an unbounded outbox (a slow client would hold every message ever sent to it).

  • Settled on the user’s delegation 2026-11-15 (built on branch ws-sender): the outbox is bounded in messages, outboxSize = 64 on webSocket and WebSocket.connect, not in bytes; a send to a full one waits up to the WebSocket’s write timeout and answers Err(Broken(IoError(TimedOut, _, _))), the WebSocket left open. A message bound is one bounded channel, and the owner’s write to a client that does not read fails at the same write timeout, closing it, so a slow client holds at most 64 messages and its senders at most one write timeout each. Zero is a hand-over: each send waits for the owner to take it. Alternatives weighed: a byte bound (needs a second counter beside the channel, and one huge message would still have to be admitted); failing at once when full (a burst would lose messages a healthy client reads a moment later); closing the WebSocket when a send times out (the owner’s write timeout already does, for a client that really stopped). Review with the user: whether a byte bound is wanted beside the message bound, and the default 64.

  • Settled on the user’s delegation 2026-11-15 (built on branch ws-sender): Ok from a sender means queued while open; the close is a request, and the senders are refused from the start of any close. A sender’s close(code, reason) sets the shared state at once (every sender call after answers Err(Closed(code, reason))) and the owner carries it out while it receives, after writing what was queued before it. The owner’s close refuses senders from the start of its handshake, and its end (close, peer close, failure, server stopping, cancellation) drops what is queued and wakes every sender waiting for room. A message queued in the instant the WebSocket ends may answer Ok and be dropped, as a write accepted by a socket that then breaks is. Alternatives weighed: an Ok only once written (every send would wait for the owner’s next receive); closing from the sender’s thread (it does not own the connection).

  • Settled on the user’s delegation 2026-11-15 (built on branch ws-sender): a session that only answers what arrives loops in ws.serve(onMessage) -> WebSocketError, which receives until the WebSocket closes and answers why, beside receive(), which a session may loop on itself; it is while the owner receives that its senders’ messages are written, so a session must be in one or the other. Alternatives weighed: a background writer started by sender() (a second owner); no helper, documenting the receive() loop (the chat server’s loop is written once in every app).

  • Settled on the user’s delegation 2026-11-15 (built on branch ws-sender): data messages over 65536 bytes are sent in fragments of 65536, written back to back, by the owner’s send and by senders alike, so a peer limiting frame sizes still takes large messages; a pong waits for the end of the message being written. A thread cancelled while it receives closes the connection with no close frame (a frame may have been half written) and ends the WebSocket with 1006. TcpServer.stopped() is a channel closed by stop, which the owner’s select watches in place of running each wait on a thread of its own through idle. Review with the user: the fragment size, and whether stopped() should be a receive-only view rather than a Channel[unit].

  • Settled on the user’s delegation 2026-11-15 (built on branch stdio-blocking): standard input and output wait safe for the collector. Every read of standard input and every write to standard output or standard error, a flush and a trap’s report included, marks its thread safe for the collector while it waits, the string being written kept in a frame of the runtime’s own. A lightweight thread reading standard input from a stream with no position (a pipe, a socket, a terminal where the platform answers so) parks on the poller first; one reading a file or a device reads at once, since the poller does not report a file at its end as ready. Writes do not park: the output goes through the C library’s buffer, shared with any C code the program calls, so a thread held up writing keeps its worker, counted as blocked, and the monitor runs another in its place. The wait for standard input is not a cancellation point, as it was not before: a cancelled thread goes on waiting for its line. Why: the smallest fix that keeps the behaviour the program sees; making it one would add a failure path to readLine, which answers no error. Alternatives: parking writes too (needs non-blocking standard output, which a pipe shared with the parent process cannot be given safely); a cancellable input wait that unwinds the thread as a sleep does. Review with the user: whether waiting for standard input should be a cancellation point.

  • Settled on the user’s delegation 2026-11-15 (built on branch net-split-writable): a connection splits into a reader and a writer for two threads at once. ByteStream.split() -> (StreamReader, StreamWriter), for TcpStream, UnixStream and TlsStream; both halves are sendable traits, each half its own thread’s, so a driver pipelines a batch of any size without stopping at windows for the send/receive buffer deadlock (found by the pg driver’s batch item). Closing the writer half-closes (shutdown write; TLS sends its close notice first); closing the reader only stops reading; the connection closes once both halves are closed or unreachable. The split connection is used up (every operation answers an error naming the split; closing it does nothing); splitting it again, or splitting a closed connection, traps. No reunite: a protocol that wants one owner again keeps both halves on one thread, and a reunite would have to check that the two halves are of one connection and that neither has pending state. A TCP or Unix writer’s close answers Ok where the peer has gone, as a connection’s does; a TLS writer’s answers whether the close notice went out, as TlsStream.close does. Each half holds its own handle on the socket (avin.rt.socket_share), so each is owner-checked on its own. The runtime’s poller keeps, per descriptor, the waiter of each direction and registers the union of the two (runtime/avin/rt/sockets.sysl), so a reader parked for bytes and a writer parked for room wait on one descriptor at once; before this a second registration replaced the first under epoll. A TLS stream’s halves share one session in a @keeps_owners object: the engine and the TCP writer are reached only holding a lock of their own, each handle taken from transit by the code holding the lock and handed back before it goes (a cancellation included, by defer), and nothing is held while waiting for the connection, so the reader decrypts while the writer waits for room. A reader that has ciphertext of its own to send sends it only where nobody else is sending (tryAcquire), and otherwise leaves it owed to the writer. Alternatives weighed: concurrent reads and writes on one connection value, with no halves (no owner check could then tell a misuse from a use); duping the descriptor for the writer (Sysl’s Socket cannot adopt one, and the poller would still need two registrations under kqueue’s filters); a TLS writer that waits for the reader on every record (a renegotiation alone needs that, and the writer does wait for it then). Review with the user: whether a reunite is wanted, and that a writer told by TLS to wait for the peer (a renegotiation) waits for its reader to read.

  • Settled on the user’s delegation 2026-11-15 (built on branch net-split-writable): writable() is a select arm beside readable(), with a partial write writeSome(bytes) -> Result[int, IoError]. threads.Writability (writable(), writabilityDescriptor()) beside Readiness; every ByteStream and every StreamWriter is one, and select reads sink.writable() into a SelectWritable arm, watched on the poller for room. writeSome is added because the arm needs it to be useful: write sends everything and so waits again after the arm said there was room. It waits for room for the first byte only where there is none, sends what fits, and answers at least one unless given nothing. Over TLS it hands TLS at most one record (16384 bytes of plaintext) and sends what of the record fits; the rest is kept and goes before anything else, and writable() sends it as room comes and answers true only once it has gone, so writeSome after writable() never waits; a read meanwhile leaves its own ciphertext queued behind that record rather than waiting for room. Alternatives weighed: no writeSome, the arm for write (waits again on a large write, as above); a TLS writeSome that sends its whole record (waits for room for a record after the arm said there was some); a writable() that ignores the kept record (a select that finds the socket writable and the arm not, round after round, spinning). Review with the user: the TLS record bound of writeSome, and the names writeSome and writabilityDescriptor.

  • Settled on the user’s delegation 2026-11-19 (branch read-secret): io.readSecret(prompt), readSecretBytes and readSecretOrLine read a line from the controlling terminal with echo off. fettle prompts for a sudo or ssh password, as does any tool asking for a passphrase, and nothing in the library read input with echo off. The calls open /dev/tty (so a piped standard input does not matter), write the prompt to it, turn off ECHO and ECHONL while keeping ICANON, and restore the exact termios found. Details settled: (1) no terminal is Err(IoError(NoTerminal, "read", "the terminal")), a new ErrorKind case, since a program tells it apart from a failed read; readSecretOrLine is the opt-in fallback, writing the prompt to standard error and reading a line from standard input, as a tool run by a script with its password piped in needs. (2) Signals: ISIG stays on, and for the length of the read the C side (runtime/avin/rt/__posix__/secret_tty.c) catches interrupt, hangup, terminate and quit: its handler restores the terminal, gives the signal its previous action back and sends it again, so the program dies or handles the signal with echo on; a program that survives sees the read fail as Other("interrupted"). A terminal stop (Ctrl-Z) is caught too: the handler restores the terminal, stops the program with the default action, and on continue hides the terminal again and the read writes its prompt again and goes on (as sudo and getpass do); what was typed before the Ctrl-Z is discarded by the terminal. SIGTTIN and SIGTTOU are not caught: they stop a program before the terminal has been changed. (3) Concurrency: the read holds input_readers, the lock of every standard input reader, so a secret and a readLine never read the terminal at once; a lightweight thread waiting for the line is not cancellable, as one waiting for standard input is, so a cancel takes effect once the line has been read and the terminal is back. (4) Bytes: readSecretBytes returns an Array[byte] the caller can overwrite; readSecret is a string, which has no way to be cleared, and the runtime clears its own gathering buffers. (5) A trailing \n and a \r before it are dropped; the end of input with bytes typed ends the line, with none it is Other("end of input"). Alternatives weighed: turning ISIG off as getpass does (Ctrl-C then arrives as a byte only once the line ends, so it would not interrupt a prompt); reading standard input when there is no terminal by default (a secret would then show on the screen, and a program that means to read one must ask by name); a cancellable wait (the existing standard input lock holds the thread’s cancellation off, and a read cut short would leave typed bytes half taken); a single readSecret with a fallback flag. Tests drive real programs over a pseudo-terminal (tests/pty/pty_drive.c, secret_tests.sysl). Review with the user: the name readSecret (against readPassword or promptSecret), and the no-terminal behaviour: an error by default with readSecretOrLine as the explicit fallback, rather than falling back to standard input on its own.

  • Settled on the user’s delegation 2026-11-19 (branch stdio-bytes): io.stdin() is standard input as a Reader of bytes, and io.stdout() and io.stderr() are standard output and error as ByteWriters, answering the Sendable objects StandardInputBytes, StandardOutputBytes and StandardErrorBytes. Source: the avin-lang/lsp package could not serve LSP over stdio, whose Content-Length counts bytes, since avin.io read standard input only as text decoded with U+FFFD and had no byte writer for standard output; the workaround would have bound Sysl’s FdReader directly, as the tui package does. Details settled: (1) Mixing: byte reads take from the one buffer readLine, lines(), readAll and Source.stdin() share (runtime/avin/rt/input.sysl), so a header read as a line and a body read as bytes go on from each other with no byte lost or read twice; a read answers what the buffer holds, else one read of the input. (2) Serialization: byte reads hold input_readers, the lock of every standard input reader and of readSecret. (3) Parking: a lightweight thread waits on the poller, as a line read does. (4) End and failure: the end is an empty array, every time it is asked; a read that fails is Err(Other(<platform sentence>)) for bytes, while the text readers keep seeing the end. (5) Output: a byte write is unbuffered and goes out whole before it returns, behind what print buffered: it holds standard output’s stdio lock while flushing that buffer and writing to the descriptor, and println writes its whole line through the same stream, so a printed line is never split by a byte write (the println-atomic entry of 2026-11-15 still holds); a write to standard error flushes standard output first, as eprint does. (6) A reader that has gone: SIGPIPE is held off for the length of a byte write (on macOS by the descriptor’s own mark, the 2026-11-20 entry below; elsewhere blocked on the writing thread, the one the write raised taken back), so the write answers ConnectionReset (EPIPE, the kind a connection’s write answers) and the program goes on; print keeps its quiet death, which a filter in a pipeline wants. (7) Closed descriptors: a bug met on the way, a program started with standard input closed read the runtime’s own pipe, which had taken descriptor 0; the runtime now opens /dev/null on each of 0, 1 and 2 that is missing before it opens anything. Alternatives weighed: an error for mixing text and byte reads (two buffers or a mode switch, and a header and body protocol could not be written at all); a buffered stdout() with flush (a byte write could then be overtaken by, or split, a println, and an LSP message must leave whole); ignoring SIGPIPE for the whole program (every print to a closed pipe would then have to fail somewhere, where today it ends the program quietly); public objects alone with no functions (a module-level function reads as io.readLine() does). Tests: stdio_tests.sysl, driving tests/stdio/stdio_bytes.avin through sh and tests/pty/stdio_tty.avin over a pseudo-terminal, at -O0 and -O2. Review with the user: the names stdin(), stdout(), stderr() and the object names StandardInputBytes, StandardOutputBytes, StandardErrorBytes (beside the text writers StandardOutput and StandardError).

    • Settled on the user’s delegation 2026-11-20 (branch stdio-sigpipe): on macOS a byte write to standard output or error marks the descriptor never to raise SIGPIPE (F_SETNOSIGPIPE) for the length of the write only, and puts back the mark it found. WHY: macOS raises the SIGPIPE of a write to a gone reader on the whole process, where any thread not blocking it takes it, so blocking it on the writing thread (item (6) above) failed whenever the program had another thread: four threads writing to prog | head -c 10, or one writer beside busy threads, ended with status 141 every time at -O0 and -O2 before the change. The mark belongs to the open pipe or socket, which the shell and the program’s children share, so it is held under the stdio locks of both standard streams and taken off before the write returns: print, eprint and a child writing to the same output keep their SIGPIPE, and nothing is left changed on the shell’s pipe after the program ends. On Linux the signal goes to the writing thread, so the thread mask is kept there unchanged. ALTERNATIVES: marking descriptors 1 and 2 once at startup (every print to a gone reader would then fail silently and a printing loop would never end, every child and every later process on the shell’s pipe would inherit the mark); ignoring SIGPIPE for the whole program (the same print problem, and an ignored signal survives exec into every child). Tests: stdio_tests.sysl § several writing threads, a writer beside busy threads, threads writing to standard error, print without a newline after a failed byte write, and a child (yes) started after one, at -O0 and -O2.
  • Linux as a target, and machines in packages (branch linux-plan, 2026-11-19; the user, 2026-11-19: Avin is “for anyone who would enjoy using it”). The plan is Linux; the package surface is machines.

    • Settled on the user’s delegation 2026-11-19: Avin’s targets are aarch64-macos, x86_64-linux and aarch64-linux, glibc on Linux, named as Sysl’s target registry names them. WHY: they are Sysl’s release platforms, so the toolchain Avin drives at every build exists on each; servers and CI are overwhelmingly x86_64 Linux, and aarch64 Linux is what a Mac’s containers run natively. ALTERNATIVES: x86_64 Linux alone (leaves out Arm servers and makes every local Linux test an emulated one); musl (static executables, but Sysl’s registry and its library are glibc’s); Intel macOS and Windows (Sysl ships neither).
    • Settled on the user’s delegation 2026-11-19: Avin is built natively on each target, not cross-compiled from the Mac. WHY: an installed Avin runs sysl build-c and clang at every user’s build, so Linux needs Sysl and clang on Linux whatever the release does, and a native build is the configuration users run; cross-building would add a sysroot to manage for no user. Local Linux work runs in a colima VM (aarch64, native speed on Apple silicon) through marshal; CI runs GitHub’s x86_64 and arm64 Ubuntu runners. ALTERNATIVES: cross-compiling from the Mac with a glibc sysroot (Sysl cannot yet: the probe of sysl build --target x86_64-linux fails building its standard module, stdio.h not found, and Sysl has no way to name a sysroot); both (cross kept for avin build --target, a later item once Sysl has sysroots).
    • Settled on the user’s delegation 2026-11-19: a Linux release ships a tarball per target (avin-<v>-linux-x86_64.tar.gz, avin-<v>-linux-arm64.tar.gz, the same prefix layout as the macOS one) and an install script that installs Avin and the Sysl it needs into a prefix and names the distribution’s packages for clang, lld, llvm-ar and pkg-config; the Homebrew formula gains on_linux once Sysl’s formula has it. No .deb. WHY: a tarball is what every other route is built from, and an install script reaches every distribution with no repository to host or sign. ALTERNATIVES: Linuxbrew only (needs Sysl’s formula on Linux first, and many servers have no brew); a .deb and an apt repository (hosting and signing, one distribution family); a static single binary (Avin needs Sysl and clang beside it anyway). Review with the user: whether a .deb is wanted later.
    • Settled on the user’s delegation 2026-11-19: machine conditions in the manifest are Sysl’s condition language (symbols, !, &&, ||, parentheses), over the closed set macos, linux, posix, aarch64, x86_64, as if on an entry of dependencies, sysl-dependencies and c-libraries and on a feature (where it says only where the feature exists), checked symbol by symbol when the manifest is read; package.targets lists the targets a package supports (all by default); install may be a block of sentences by condition; link-flags passes flags such as -framework Security as written. avin tidy and avin vendor answer for every target. WHY: one condition language across Avin’s manifest, Sysl’s manifests and the Sysl dependencies Avin hands to Sysl; checking every symbol at read keeps a misspelling from silently dropping a dependency. ALTERNATIVES: per-target blocks (targets.x86_64-linux { dependencies { … } }, which repeat a dependency per target and cannot say “every Linux”); a target name as the condition (if = "x86_64-linux", which cannot say “every Linux” either); Sysl’s choices and per-target linker keys (machine and image configuration Avin’s hosted programs do not have).
    • Settled on the user’s delegation 2026-11-19: in source, the file is the unit a machine selects: name.<symbol>.avin is read only where the symbol holds, a module exists on a machine where any of its files is read, an import of a module that is not everywhere is allowed only from a file that is read no more widely, and avin check type-checks once per target where anything differs. Values that differ by machine are written over avin.target.os and avin.target.arch, compile-time constants whose untaken branches fold away, both branches checked on every machine. WHY: it keeps the rule features follow (a whole unit is in or out, nothing in a file changes with the build), so every file means one thing; a module keeps one name and one surface on every machine, and the per-target check proves the surface is there. ALTERNATIVES: Sysl’s #if lines (a file reads differently per machine and the untaken lines are never checked); a constant alone (cannot hold a call only one system declares, since both branches are checked); whole modules per machine in the manifest (a machines { linux { modules = […] } } block, which forces shared code to import a different module per machine); name_linux.avin with an underscore (collides with ordinary file names that end in a system’s name). Review with the user: the surface syntax: the .linux.avin infix, package.targets, the if key, the install block and avin.target.
    • Settled on the user’s delegation 2026-11-19 (closing two Open items): a feature has no compile-time constant, the module staying the only unit a feature gates. WHY: a feature’s modules and optional dependencies are absent with it off, so a branch on feature("x") could not type-check against them; a machine constant works only because every machine’s standard library is whole. ALTERNATIVES: a feature("x") constant folded away (fails to check, as above); line gates (the conditional compilation the features design refused). A module is listed by one feature only; a part two features share becomes a feature both enables. WHY: every gate stays one feature, so the import check stays one question. ALTERNATIVES: a module on while any of its features is on (the import check would have to reason about disjunctions, and a module’s presence would depend on combinations).
    • Found while surveying, not fixed here (no runtime run is allowed on this branch): the DNS lookup’s pipe sets descriptor flag 2 (runtime/avin/rt/lookup.sysl, CloseOnExecFlag), but FD_CLOEXEC is 1 on macOS and on Linux, so the pipe is inherited by a child started during a lookup. macOS hides it, starting children with every other descriptor closed; Linux does not. It is the first item of the plan.
  • Settled on the user’s delegation 2026-11-19 (the user approved moving extractors onto a trait the same day; branch extractor-trait): an extractor is a value whose type implements one of three core traits, Extractor[-A, +B] (unapply(value: A) -> Option[B]), BoolExtractor[-A] (unapply(value: A) -> bool) and SeqExtractor[-A, +S] (unapplySeq(value: A) -> Option[S]), in library/avin/extractor.avin; the pattern checker finds the conformance (extractor_instances in check.sysl) and calls the trait’s method, a class’s or data type’s own implementation directly, so a method merely named unapply no longer makes an extractor. The pattern syntax, the three result shapes, coverage (an extractor never counts) and refinement (an extractor learns no equalities) are unchanged, and the methods keep the names unapply and unapplySeq. A type implements each trait at one type argument (the rule for every trait with instance members); the trait whose A takes the matched value serves, an unapply trait before SeqExtractor. A type’s name is no extractor. A value implementing none is reported with the trait to implement, worked out from the type’s own unapply or unapplySeq where it has one, or with the three traits and their methods. WHY: the user’s rule that Avin is sound and nominal, which the soundness audit found broken here by a lookup by name; as ordinary traits, extractors also become first-class: held in a value of the trait’s type, passed as a parameter, bounded on a type parameter, implemented by a data type through an impl, inherited by a subclass, with the variance a function’s argument and result have. The S of SeqExtractor is left open rather than bounded by Seq, so a List stays a List for its rest* and list patterns; the pattern asks for a sequence where it is used. ALTERNATIVES: a marker trait with no members, the method still found by name inside it (half nominal; a value of the trait’s type could not be matched); one trait with the result shape as a type parameter (the three shapes are different methods); unapply keeping its role by name with a modifier (not a trait, so no extractor values). Review with the user: two things the structural rule allowed are gone: an extractor object with a generic method, object Pair with unapply[A](xs: List[A]), which no trait instance can name, is now a generic class used through a value (val pair = Pair[A](), pair(a, b)); and one object with unapplys overloaded on several input types now picks one input type per trait. Each implementation is also written override, as every trait member’s is.

  • Settled on the user’s delegation 2026-11-19 (built on branch builder-trait; the move onto a trait approved by the user 2026-11-19): a collection literal finds its builder through the core trait Buildable[A], never by a method’s name (literals). The trait has one member, static newBuilder() -> Builder[A, Self]; A is the element a literal gives the builder, a map’s (K, V) pair. A literal where a type C is expected is built by C.newBuilder() where an impl of Buildable targets C itself, or where C is a type parameter bounded by it (make[C: Buildable[int]]() -> C = [1, 2, 3]); otherwise it is the default Vector, Set or Map, built through their own conformances. A companion object’s newBuilder builds no literal. Every library collection implements it, its impl calling the companion’s newBuilder, which stays the public way to get a builder (Vector.newBuilder[int]()); a repeated parameter’s vector is built through Vector‘s conformance too. An expected collection (an Iterable, or a type whose companion has a newBuilder) that is neither Buildable nor an instance of the default is reported by the trait it lacks: “a sequence literal cannot build Stack[int], which does not implement Buildable…”. WHY: the user’s goal is a sound, nominally typed language, and a literal that called whatever its expected type’s companion named newBuilder was the last structural lookup the soundness audit left; a trait is a stated promise, checked where it is made. One trait for sequences, sets and maps, parameterized by the element rather than by a type constructor, serves every collection the library has: BitSet (a Buildable[int] with no parameter of its own), TreeSet (an Ord bound on its impl), maps (pairs), traits (Set, SortedMap, building their default kinds), and any program’s collection, with or without a companion, from any module, as FromInteger does for integer literals. The conformance is the type’s own: a TreeSet expected is built by TreeSet‘s impl, never by SortedSet‘s or Set‘s, since those would make a different collection. ALTERNATIVES: a constructor trait on the companion, trait IterableFactory[C[_]] with newBuilder[A]() (cannot express BitSet, which takes no parameter, nor TreeSet‘s Ord and HashSet‘s Eq & Hash element bounds, and needs a second trait for maps); two traits, one for sequences and sets and one for maps (the element type already tells a pair from an element, so the second adds nothing); removing the companions’ newBuilder and calling the static as Vector[int].newBuilder() (breaks every call site in every avin-lang repo for no gain in soundness). A trait type’s own conformance builds where the trait type is expected (SortedSet, Set, Map, SeqMap, so {} where a Map is expected is the empty map through Map‘s own impl), and an impl for one instance, impl Buildable[int] for Count[int], builds that instance only; Count[string] expected is the error naming the trait. The companion apply stays an ordinary method (Deque(1, 2, 3)): its repeated parameter’s Vector is already built through Vector‘s conformance, so it meets the trait where a literal does, and each collection keeps the cheapest way from that vector to itself. ALTERNATIVES for apply: rewriting every companion apply over its own newBuilder (no gain in soundness, and slower where apply converts the vector directly, as Array‘s toArray does); a static apply(xs: A*) -> Self in Buildable with a default body (makes C(1, 2) callable on a bound C: Buildable[int], but adds a second member every program’s impl inherits, and C.newBuilder() already serves that). Review with the user: the name Buildable, and whether the companions’ newBuilder should eventually be the static member alone.

  • Settled on the user’s delegation 2026-11-19 (branch train-ay, reconciling builder-trait with the comparisons of ranges and literals that predate it): a type only suggested to a collection literal, by another operand of ==, != or an ordering, leaves the literal its default where no literal builds that type, so (1 .. 3) == [1, 2, 3] is a Range compared with a Vector by their elements, as before Buildable; a type demanded of the literal (a declaration, a parameter, a result, an ascription) still reports the trait it lacks, val r: Range = [1, 2]. WHY: the suggestion exists so a literal compares like with like where it can (xs == [1, 2] with xs a List); where it cannot, a literal of the default compares the same by Seq equality, and an error there would refuse a comparison that has an obvious meaning. ALTERNATIVES: refusing the comparison and asking for .toVector (breaks established programs for no soundness gain); making Range Buildable (a literal cannot promise a range’s even step, so its builder would have to fail at run time).

  • Settled on the user’s delegation 2026-11-19 (branch train-ay, reconciling bytes-sendable‘s object Isolated with constructors used as values): a class’s companion object that declares no apply leaves the name the class’s constructor where a function is expected, as in call position, so val mi: (Vector[string]) -> Isolated[Vector[string]] = Isolated and [1, 2].map(Box) make values; elsewhere the name is the object. WHY: adding a companion with unrelated members (Isolated.move) must not take away the constructor value its class had. ALTERNATIVES: the object always (breaks every such value when a companion is added); an error asking to choose (nothing is ambiguous where the object is not a function).

  • avin repl, an interactive session (branch repl, 2026-11-19; approved by the user the same day). The surface is in getting started.

    • Settled on the user’s delegation 2026-11-19: a session is one growing program, built and run whole after each input; earlier inputs run again, their output passed over. Imports go to the program’s top, type declarations below them, everything else into main; the program writes a mark before the newest input and one after it, and only what lies between is shown. WHY: Avin compiles a closed world — one LLVM module with the library, monomorphized instances, devirtualized calls and per-program type descriptors — so loading each input as a shared object into one live process (keeping the heap, globals and threads) needs separate compilation across units: instances shared or duplicated between units, type identity across them, the collector’s roots registered per loaded unit, and the runtime moved into the host. That is a compiler architecture, not an item. Replaying costs an input’s side effects repeating unseen, values computed afresh (random, time) differing from the ones shown, and run time growing with the session; each input still builds in about a second at -O0 through the instance cache. ALTERNATIVES: dlopen per input into a live process (the right end state, above); an interpreter over the checked program (a second semantics to keep equal to the compiled one); replaying with the earlier inputs’ effects suppressed (not possible for effects outside the process). Review with the user: whether the live-process design is wanted next, and how soon.
    • Settled on the user’s delegation 2026-11-19: each code input is a block nested in the one before it (if true around the rest), so val x entered again hides the earlier x from the later inputs, as a block’s local does, and the earlier inputs keep the x they saw; a local function entered again does the same. WHY: Avin forbids a second val of one name in one block; nesting gives the hiding every interactive language has without renaming anything. ALTERNATIVES: renaming earlier bindings (rewrites what the user typed, and diagnostics show other names).
    • Settled on the user’s delegation 2026-11-19 (branch repl-2; replaces “functions are local functions of main“ and “a type declared again replaces the earlier declaration”): each declaration of types, and each function or val that uses no local of main, is a module of the session’s own (avinrepl.c3), which imports, by name, the newest of each name the inputs before it gave, and every earlier module whole (so their extensions are seen). Such a function or val is hoisted: a class, trait or function entered after it calls or reads it. A hoisted function is also written into main where it was entered, and a hoisted val read there under its name (val base = avinReplC2.base), so code in main sees every name in the order entered, exactly as before. A name entered again hides the earlier one from every later input, module or code, and a module entered before keeps the one it imported: a class calling twice keeps the twice it was declared after. “Uses no local” is the checker’s answer, not a guess: the input is first checked and run as code of main, and hoisted when none of its references resolve to a local of main other than a hoisted input’s. A hoisted input is written as a module only once a declaration of types comes after it (nothing else can reach it there), so a session of code alone checks and builds no extra files; one that does not check as a module when a declaration first needs it stays code of main, and the declaration is checked again without it. A function or val that uses a local stays in main, and a var, a lazy val, a destructuring val and an input of several statements stay there too, out of the modules’ reach; a module never imports a name whose newest declaration is such a local. main imports the newest of each type’s name, so code there sees a type declared again in place of the old one, and the new declaration is refused where earlier code of main no longer checks against it. An impl of a type or trait the session declared joins that declaration’s module, where a conformance has to be and a plain impl’s methods are the type’s own; any other impl is an extension in a module of its own. A session import binding a name a module gives is left out of the later modules, the module’s name being the nearer. A hoisted val is computed before main when the session runs again, which is not seen: an earlier input’s output is passed over. WHY: a declaration can only reach what is declared at the top level of some module, and modules are how Avin scopes names, so one module per input gives declarations the same hiding main has, with nothing renamed and every diagnostic in the user’s own names; and each module’s text is fixed once entered, so its instances stay in the build cache. ALTERNATIVES: one top-level module for every declaration (a function or val entered again would replace the earlier one under the inputs that used it, and a value computed from it would change when the session runs again); hoisting by renaming (twice$2; diagnostics and types show the other names); hoisting by a syntactic test of the free names (a parameter named like a local would keep the function local). Review with the user: that code of main sees a type declared again where modules keep the old one (Avin has no local types to hide it with), and whether a var should be reachable from declarations too (a module-level var changes what threads may read).
    • Settled on the user’s delegation 2026-11-19: an expression’s value is kept as resN and shown as res0: int = 42, by its type’s Debug through Any (a string quoted, a type with no Debug by its name, a function as <function>); a val or var shows its own name, a local function its header, a type declaration its header; an expression of type unit shows nothing and takes no number. The type is the checker’s, as hover shows it. ALTERNATIVES: Display (a string unquoted reads like output); it for the last value only.
    • Settled on the user’s delegation 2026-11-19: an input ends at the end of its line unless a bracket is open, the line ends with an operator, = or a comma, or the input opened a block — a type’s declaration, a line the parser finds unfinished at its end (if x > 0, f(n: int) -> int), or a local function’s header with parameters (log(m: string), which alone reads as a call) — which an empty line ends. greet() alone is a call; a function of no parameters opens its block with a result type or =. ALTERNATIVES: a continuation character; always waiting for an empty line after an indented line (one more Enter for every one-line input).
    • Settled on the user’s delegation 2026-11-19 (branch repl-2, replacing sysl.term.edit, which edits one line and completes nothing): at a terminal an input is edited whole by the session’s own editor (repl_editor.sysl, over sysl.term.keys): Enter enters an input the completeness rule above finds complete, wherever the cursor is, and otherwise breaks the line at the cursor and goes on under a | prompt, indented as the line above and two more after a line opening a block (if, else, a header, an open bracket, a trailing operator; a trailing comma keeps the indentation); Backspace over an indentation takes back two columns; the arrows move through the input’s lines and, past its first or last, through the inputs entered before (500, whole); Ctrl-A/E/B/F/P/N/K/U as usual, Ctrl-C drops the input, Ctrl-D on an empty one ends the session. Lines wider than the terminal are drawn over as many rows as they take (its width is asked at each drawing). Raw mode only while an input is read, so a running input gets Ctrl-C; read from a pipe there are no prompts, and lines are taken one at a time as before, so a scripted session’s output is what its inputs write. An input’s standard output and error reach the session as one stream, in the order written. No new C dependency. ALTERNATIVES: linenoise (a C dependency); a line at a time with a continuation prompt (an earlier line cannot be changed); entering on an empty line always (one more Enter for every one-line input).
    • Settled on the user’s delegation 2026-11-19 (branch repl-2): Tab completes from the language server’s completion (completion.sysl): the input is placed in the session’s program as it would be entered (an import among the imports, a declaration of types as a module of its own, other code in main), the word at the cursor replaced by the stand-in, and what the check finds there is offered: names in scope (locals of main, hoisted inputs, types, imports, the core library, and the keywords an expression may begin with), a receiver’s members after a ., modules after import. The names are ordered nearest scope first, then by name; Tab writes what all of them begin with, and when that adds nothing and there are several, lists them under the input. Tab with only spaces before the cursor indents. The session’s own names (avinReplShow, the module aliases) are never offered. ALTERNATIVES: names collected from the session’s text (no members, no types of expressions); a menu to choose from (a larger editor).
    • Settled on the user’s delegation 2026-11-19: in a package, or a directory holding a program, the session’s program is that program with its root module replaced by the session, so its modules import as they do from main, and its dependencies, Sysl packages and C libraries come with it. :load <file> enters a file’s imports and top-level declarations one at a time as if typed; its main becomes a local function to call. ALTERNATIVES: keeping the root module (its main collides with the session’s); :load running the file’s main (it can be called).
  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design, the design approved by the user 2026-11-13 and its build approved 2026-11-19; built from branch given-1 on): contextual parameters are for context values, never for conformances (contextual parameters). A using parameter is filled from a given in scope; a bound is met only by the type’s impl, a given never overrides or adds to one, a contextual parameter’s type names no type parameter, and a given has none. Why: Avin already resolves trait instances coherently through impl and bounds, so letting a given fill a bound would be a second way to supply an instance, and an incoherent one: a TreeSet built under one ordering and searched under another. Under the principle the user set the same day (“the ultimate SOUND, NOMINALLY typed, compiled, garbage-collected high-level language”), coherence is not negotiable, so givens carry what conformances cannot: a transaction, a logger, a request, a clock. A non-natural order stays an argument of its call (sortWith, sortBy with Reverse). Alternatives weighed: a using of a trait type filled by a given, falling back to the impl (two ways to do one thing, and incoherent across values built under different scopes); givens for bounds only with priorities (the search and ambiguity rules that cost compile time and predictability); no contextual parameters at all (every layer threads a logger by hand). Review with the user. This is the central choice.

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; built on branch given-1): every given is named; no anonymous givens. given tx = db.begin(), given log: Logger = …. Why: one way to declare one; the name is what a call passes explicitly (tx = …), what a diagnostic names and what another file imports. Alternatives weighed: anonymous given RequestContext(id) (a second form for the same thing, and an import with nothing to name); given existingName to make a value a given (a second way to make a lambda’s parameter one, beside using). Review with the user: anonymous givens are the likeliest to be missed.

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; built on branch given-1): using is a trailing section of the one parameter list, f(a: A, using tx: Tx, log: Logger), passed explicitly only by name. Why: Avin has one parameter list per function and named arguments already; positional passing would let an argument meant for an ordinary parameter land on a contextual one. Alternatives weighed: a second parameter list f(a)(using tx) (Avin has no curried lists); using on each parameter (repetition); positional explicit passing (ambiguous next to defaults).

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; to be built at step 3 of the plan): resolution is lexical, nearest level wins, two fits at one level are an error: blocks, then enclosing functions’ and lambdas’ using parameters, the class constructor’s or actor’s, the object’s givens, then the module’s own givens with the file’s imported ones; fit is nominal conformance; then the parameter’s default. Why: one deterministic answer per call, decided where it is written and shown by the source; no ranking by specificity, so no rule a reader must simulate. Alternatives weighed: exact-type matching only (a given FileLogger could not fill a Logger); most-specific ranking across levels (search, and surprising winners); one flat scope (a block could not narrow a module’s given).

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; to be built at step 4 of the plan): a given is seen in another file only when imported by name (directly or through an export); importing the module whole does not bring its givens. Why: a given changes what a call receives with nothing written at the call, so the file says which; a library adding a given then cannot change an existing call elsewhere. Alternatives weighed: givens seen through any import of their module, as extensions are (silent changes of meaning); a .given wildcard import (Avin has no wildcard import). Review with the user.

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; built on branch given-1): a given’s type is a nominal type of the program (a class, an object’s type, a trait used as a type, a data type, closed type arguments); built-in types, tuples, function types and unions are refused, and a given is a val. Why: nominal typing — a value fills a parameter because its type declares what it is, not because a common shape such as int fits; and a var given would share a box across closures and threads.

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; built on branch given-1): givens are declared in blocks, at a module’s top level and in object bodies; classes and actors take context as using parameters of their constructors (private fields, givens in their bodies). No given in class, trait or data bodies, and none of data variants, main, tests, hooks or bindings take a using section. Why: one place per kind of declaration; a class’s context comes from whoever makes it.

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; to be built at step 5 of the plan): lambdas and function values. A lambda resolves where it is written and captures the givens it uses; its parameters after using are givens in its body but positional in its type; function types have no using section; a function taken as a value has its section filled where it is taken. Why: a function value is called with positional arguments only (as for names and defaults), and lexical capture keeps one rule for every closure. Alternatives weighed: contextual function types ((using Tx) -> R, a new kind of type); a given tx statement in the lambda’s body (a second way). Review with the user: contextual function types are what would make db.transaction { insert(row) } need no parameter.

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; to be built at step 5 of the plan): a given does not cross spawn by itself; a closure that uses one captures it and is checked as any capture (sendability, no var). Why: a given is a lexical value, not thread-local state, so the sharing rules see it. Alternatives weighed: an inherited per-thread context (dynamic scoping, invisible in the source).

  • Settled on the user’s delegation 2026-11-19 (proposed 2026-11-13 on branch given-design; the section built on branch given-1, its filling at step 3 of the plan): contextual parameters may have defaults, used where no given fits, and every default of the function sees the contextual parameters, which are filled first. The section takes no part in choosing an overload. Why: a default is the natural fallback (using clock: Clock = SystemClock), and resolving after the overload is chosen keeps the cost of a call linear and its errors at the chosen function. No standard-library API adopts contextual parameters in this design; adopting one (an Executor for Future(body)) is its own item, since ex.future(body) already exists and the two would be two ways.

  • Settled on the user’s delegation 2026-11-19 (branch given-1): an opaque type may be a given’s and a contextual parameter’s type, beside classes, objects, traits used as types and data types. Why: the refusal of built-in types exists because a given int would be given wherever any int is asked for; an opaque type is a nominal type of its own (opaque type UserId = long), which only what asks for a UserId receives, so it has none of that problem, and “avin is for everyone” favours the wider rule. Alternatives weighed: refusing it as the design’s list did (a wrapper data type would be needed for a value an opaque type already names). Review with the user.

  • Settled on the user’s delegation 2026-11-19 (branch given-1): where given and using begin their forms. given begins a given where a name and its : or = follow it; before val, var or a capitalized name it is read as a given and reported (a val already; never a var; every given named); everywhere else it is a name. using begins a section where a name (or a class parameter’s modifier) follows it in a parameter list, also in a parenthesized lambda and as using tx ->, alone or as a call’s trailing lambda. Why: the smallest test that keeps every existing use (args.given(…), given = 3, given(x), a parameter using: Mode) meaning what it did; the capitalized-name case turns the likeliest mistake, an unnamed given, into its own message rather than a parse error. Alternatives weighed: reserving both words (breaks existing programs); reading given before any name as a declaration (an infix call given max b on a value named given would change meaning).

  • Settled on the user’s delegation 2026-11-19 (branch given-1): a contextual parameter has a name, is neither by-name nor repeated, and a class’s is written without val, var or private; a repeated parameter may come just before the section. Why: it is passed explicitly only by name; a given is one value already made, so by-name evaluation and repetition mean nothing for it; a class’s contextual parameter is a private field and a given by definition. The section comes last, so a repeated parameter is last of the others (all(xs: int*, using tx: Tx)). A data variant takes no section, reported where it is parsed.

  • Settled on the user’s delegation 2026-11-19 (branch given-3): a local function’s or a lambda’s contextual parameters are a level of the scope walk between its body and the block it is written in, so they beat the givens of the blocks around it and lose to the givens of its own body’s blocks. Why: the chapter listed “the enclosing blocks” before “the contextual parameters of each enclosing function or lambda”, which read literally would let a block outside a local function hide the function’s own using parameter, the value its caller chose for it; resolving by lexical nearness is the rule every other name follows, and it is the reading of “nearer level wins” a reader expects. Alternatives weighed: every block first, then every function’s parameters innermost out (the literal list, where helper(using tx: Tx) = tag() written in a block with given t = Tx(…) would ignore its own tx).

  • Settled on the user’s delegation 2026-11-19 (branch given-3): the section’s defaults are computed before the other omitted defaults, and a contextual parameter’s default sees the section’s parameters before it, not the ordinary ones; an ordinary default sees the parameters before it and the whole section. Why: the chapter has ordinary defaults see the section, so the section must be complete first; a section default that also saw ordinary parameters could depend on an ordinary default that depends on it, a cycle with no order to compute it in. Alternatives weighed: a section default seeing every parameter before it in the list (needs an order that interleaves the two kinds, and the cycle above is then a compile error to explain); a section default seeing nothing of the call (using tx: Tx, clock: Clock = Clock(tx.start) lost).

  • Settled on the user’s delegation 2026-11-19 (branch given-3): a positional argument past the parameters before the section is the “passed by name” error when the call writes no more positional arguments than the function has parameters, and the argument-count error otherwise (tag(tx, tx) for tag(using tx: Tx) says it takes 0 arguments, not 2). Where a repeated parameter comes before the section, every positional argument is the repeated parameter’s, so a tx written last is a type error there, and the section is still filled. Why: the error names the likeliest fix, naming the argument, where a call has one positional argument per contextual parameter; beyond that it was not meant for the section. Alternatives weighed: always the “passed by name” error (wrong advice for a call of too many arguments).

  • Settled on the user’s delegation 2026-11-19 (branch given-4): a given a module exports by name is a given of that module’s own files too, beside the givens it declares, at the module level of the scope walk; a given and an export of it, or two imports of one given (current as tx and kit.{current}), are one given, never two that fit. Why: an export names the given as explicitly as an import does, and a module’s files already see every name it exports as one of their own, so the rule “a file sees another module’s given only where a name of it is written” holds for both. Alternatives weighed: an export presents the given to importers only, its own files needing an import as well (a second line naming the same given, with nothing the reader learns from it). Review with the user: whether exporting a given should also bring it in for the exporting module.

  • Settled on the user’s delegation 2026-11-19 (branch given-4): the “no given” error’s hint names every public given, of the parameter’s type or one conforming to it, that a module the file imports whole declares or exports and the file does not already import, each as its own clause after ; (`kit` declares the given `kitTx`, which this file does not import: `import kit.{kitTx}`), under the name that module presents it by. A private given is never offered, since it cannot be imported. Why: the hint is there to say which import to write, so it offers exactly the imports that would compile and fix the call. Alternatives weighed: the first such given only (hides the choice when two modules offer one); every module of the program (suggests modules the file never named).

  • Settled on the user’s delegation 2026-11-19 (branch given-4): imported givens enter the instance cache through the module-level value each filled call reads, with no extra key input: a filled argument is a read of that value in the typed tree, and a key already holds the interface of every module-level value its tree reads, so an edit of an imported given’s type lowers each caller it fills again and an edit of its value alone does not. Alternatives weighed: a key input listing every given a file imports (re-lowers callers on edits that cannot change their text).

  • Settled on the user’s delegation 2026-11-19 (branch given-5): a function, method or constructor with a using section, taken as a value, is a closure calling it as a call written where the value is taken would: its type is the parameters before the section, the section is filled from the givens in scope there, which the closure captures, and a contextual parameter no given fills takes its default, computed at each call of the value. rows.map(insert) is exactly rows.map(row -> insert(row)), so a value with no given in scope is the call’s “needs a Tx“ error, two that fit are the call’s “two givens” error, an overload is chosen by the parameters before its section, and a value cannot take the section explicitly (a lambda does: (r, t) -> insert(r, tx = t)). A method whose parameters are all in its section is called with () as one of no parameters is: s.current with no function type expected is the “called with ()“ error, and val f: () -> int = s.current is its value. Why: the chapter’s own equivalence, taken literally, gives every other answer: the given is captured as any read of it is, so the spawn, @sendable, executor and @threaded checks name it with no new rule, and a default is computed where an omitted argument’s always is, at the call. Alternatives weighed: keeping the section as positional parameters of the value (the step-3 behaviour; the given in scope would be ignored, and the value would not fit the function types it reads as); computing the defaults once where the value is taken (a second time at which a default runs, unlike every other default); a value of a method of only contextual parameters made where no function type is expected (s.current would then quietly be a function where a call was almost certainly meant).

  • Settled on the user’s delegation 2026-11-19 (branch given-5): an actor’s using section is held to Sendable as any actor parameter is, filled where the actor is made, by the given in scope, by name, or by its default, and its parameters are givens in the actor’s body and its receive. Why: an actor’s parameters are carried to it by its behaviour, so the section is checked where the actor is declared, once, with the message every other parameter gets. Alternatives weighed: none that keeps one rule for actor parameters.

  • Settled on the user’s delegation 2026-11-19 (branch given-6): an editor sees each argument a call’s using section was filled with at the call’s name. Hover on the name shows the function’s signature, then “Filled from givens:” and one line per filled parameter as it would be written, with the given’s declaration beside it (tx = current // val current: Tx); go to definition answers the function first and then each given, in the section’s order (an editor shows a list to pick from); a given’s references and highlights include the calls it filled, at the call’s name; a rename of a given never edits a call it filled, since nothing there spells it; and the call’s name stays one semantic token, the function’s. A signature shown by hover or completion writes using once before its section (send(n: int, using tx: Tx, log: Log)), and a completed call’s snippet leaves the section out. Why: a filled argument has no text of its own, and the call’s name is the one place a reader looks at when asking what the call receives; listing the givens in definition makes the jump one step from where the question arises. Alternatives weighed: an inlay hint after the call’s parentheses (insert(2)⟨tx = current⟩; cleaner to read, but a separate request most editors show only when asked, and nothing here serves inlay hints yet); definition going to the given alone (loses the function, the commoner question); leaving filled calls out of references (then “where is this given used” has no answer). Review with the user: whether inlay hints for filled arguments are wanted as well.

  • Settled on the user’s delegation 2026-11-19 (branch given-6): completion offers given and using where a form may begin with them: both among the statement keywords where a name in an expression is being written (a block’s given; a using lambda, using tx -> …); given at the start of a line no expression holds (a module’s or an object’s given); and using at an item’s start in a parenthesized list no expression holds (a parameter list, on its line or a line of its own). A type, a member after a dot and an import offer neither. Why: the checker already tells an expression’s place apart; the other two are read off the text before the cursor, which is all a half-written declaration offers. Alternatives weighed: walking the parsed declaration for a parameter at the cursor (exact, but a half-written parameter list rarely parses); offering both everywhere (noise in types and imports, where neither can be written).

  • Guards on select arms, and Selector for a set of sources known at run time (branch select-dynamic, 2026-11-19). The gap came from the ssh package (branch pty-forward, Socket.waitWith): relaying a tunnel to a local connection, it could not leave out an arm by a run-time condition (“watch local.writable() only while bytes are pending for it”) and spelled out twelve selects, one per combination; and nothing could wait on N connections or N tunnels, which blocks a multi-connection ssh -L and -R. The surface is select and selectors.

    • Settled on the user’s delegation 2026-11-19: any arm but else may end in an if guard, written as a match arm’s is, after the operation and its as pattern. A false guard makes the arm absent: not evaluated beyond its guard, not watched, never run, its value never sent. The guard is evaluated first, with the arms’ other expressions, once and in written order, before any arm is tried, so it cannot name the arm’s pattern’s bindings, which no value has yet. WHY: evaluating the guard first lets it protect the arm’s own expressions (conns(i).readable() if i < n) and keeps a value meant for an absent arm from being computed; an arm that is not there should cost nothing. ALTERNATIVES: the guard after the arm’s expressions (a send’s value computed for nothing, and a guard that cannot protect its arm); a guard that sees the received value, as a match guard sees its bindings (it would have to receive before deciding, then put the value back, which a channel cannot do without reordering).
    • Settled on the user’s delegation 2026-11-19: a select whose every arm is guarded off, with no after or else left, traps, and so does wait on an empty Selector. WHY: only a cancellation could end such a wait, which is almost always a loop’s exit condition gone wrong; the trap names it where it happens, instead of a thread that hangs or a deadlock report later. A thread meant to wait for its cancellation says so with an after or a channel. ALTERNATIVES: waiting for cancellation (as the brief offered; silent where it is a bug); a compile-time error (guards are run-time values, so it can only be caught at run time).
    • Settled on the user’s delegation 2026-11-19: after takes a guard; else does not. A false guard on after leaves a select that waits until an arm runs. else‘s body follows it with no arrow, so else if c then a else b already means an if there. WHY: a guarded after is the “time out only while something is pending” case; a guarded else is after 0 guarded, which already exists. ALTERNATIVES: a guard on else (else if would read two ways).
    • Settled on the user’s delegation 2026-11-19: the dynamic form is a library type, avin.threads.Selector[K: Eq]: entries receive(channel, key) -> SelectReceive[T] (whose received() holds what was received), send(channel, x, key), readable(source, key) and writable(sink, key); remove(key), removeWhere(p), clear(), size, isEmpty; waits wait() -> K, within(timeout), until(deadline) and poll() -> Option[K]. The entries stay between waits; a send entry is taken out once its value has gone. Each entry is the arm object a select block is read into, and a wait runs the same library loop and the same runtime park on the poller, so there is one wait path. WHY: a set of N sources needs a value the program can build, keep and change between waits, and keys of the program’s choosing answer “which one” without index bookkeeping; mixed kinds (channels and streams) live in one set. ALTERNATIVES: a for arm in select (for c in conns: c.readable() -> …), which reads well for one homogeneous collection but rebuilds the set every time the select is reached, needs a second arm per kind of source, and adds a binding form to the select grammar; both (two ways to say the same thing, the for arm being sugar the library type can carry later if programs want it); entries answered by index (indices shift as entries are removed); a send entry that stays after it ran (it would send the same value again at the next wait). Review with the user: the Selector surface (its name, keys over indices, receive answering the entry, a send entry taken out once it ran), and whether select should gain a for arm as sugar over it.
  • Settled on the user’s delegation 2026-11-19 (branch stdin-readiness): io.stdin() is a Readiness, any thread may wait on it, and readAvailable(max) reads only what is there. Source: the stdio-bytes branch found that the tui package could not move off its own Sysl binding of descriptor 0 (sysl.io.wait.ready with a time limit, then a raw read), because io.stdin() had no timed wait and bytes in the runtime’s shared buffer would never show as the descriptor’s readiness; any interactive program (a TUI, a REPL, a language server with timers) needs standard input in one wait with channels and timers. Details settled: (1) Ready means bytes are in the shared buffer (a readLine‘s read-ahead among them), the input has ended or failed, standard input is a file (whose read never waits), or descriptor 0 polls readable; readable() never waits, and answers false while another thread holds the input lock. (2) Ownership: none. Standard input is process-global, so any thread may name it in a select or a Selector, and several at once; a connection keeps its owner rule. (3) The lock: a select never takes input_readers to wait. Every select arm on standard input is enlisted on a runtime queue (input_changed) that every reader notifies as it lets the lock go, so bytes another thread’s readLine left in the buffer end the wait; one select at a time watches descriptor 0 on the poller (which holds one waiter per descriptor and direction), and hands the watch on, waking the others, when its wait ends; a reader parked on descriptor 0 takes the watch’s place and tells the selects when it lets go. The library is unchanged: the runtime’s select_watch takes descriptor 0 by this path. (4) readAvailable(max) -> Result[Option[Array[byte]], IoError]: Some of what read(max) would answer without waiting, an empty array at the end, None where a read would wait or another thread is reading; it is a method of StandardInputBytes, not of Reader. WHY: one wait path for every source; the queue closes the one gap readiness on the descriptor alone leaves (bytes already buffered) without polling; Option keeps “nothing yet” apart from “ended”, which a TUI must tell apart. ALTERNATIVES: only the thread that first waits on standard input may wait on it, trapping others (a rule a program could not see, for a resource that has no owner); taking the input lock to look (a select would then wait behind a thread parked in readLine, past its after); a select re-trying standard input on a timer (wakeAt) while another thread reads (polling, and a delay); readAvailable answering an empty array for both “nothing yet” and the end (ambiguous); readSome/readAvailable on the Reader trait (every reader would owe it, and files and connections have no use for it yet). tui switched in its branch stdin-api. Review with the user: the name readAvailable and its Option answer.

  • Settled on the user’s delegation 2026-11-19 (the user asked for the change, branch method-chain): a comparison chain’s links may call operator methods; a chain is allowed when every link yields bool. lo <= x < hi with x‘s type defining <= and < as methods is one chain, as it is for built-in comparisons, and links of methods mix with built-in links, == and != among them. The chain keeps its meaning: operands are evaluated left to right, each middle operand exactly once, and evaluation stops at the first false link. Each link resolves on its own left operand’s type, so overloads are chosen per link (t0 < t <= d calls Instant < Instant and then Instant <= Duration). A link whose method yields anything but bool (a query builder’s age < 30 yielding a condition) makes the chain an error naming the link, its method and the type it yields, and saying to join the comparisons with && or parenthesize one; a < b alone still yields whatever the method yields. The compiler lowers a method link through the chain’s one lowering: the checker records the link’s resolved call on two unnamed locals, and the chain gives them the operands’ values it already holds. Why: chains read as the mathematics they write, and the house style asks for them wherever possible; the earlier rule’s reason, that a method may yield anything, is kept exactly where it applies, a link that does not yield bool. Alternatives weighed: keeping the error (forces lo <= x && x < hi on types with methods only); allowing any result type and joining links with the result’s own && (no single meaning for short-circuiting, and a condition builder’s && is a method too); desugaring method chains into nested && blocks in the checker (a second lowering of chains to keep in step with the first). Amends “the arithmetic operators … are free method names” above.

  • Settled on the user’s delegation 2026-11-19 (built on branch machine-conditions): the choices machines left open in the manifest.

    • A feature that does not exist on a machine turns nothing on there, even when a feature that does exist enables it: the selection leaves it out, and what only it would turn on stays off. A feature that requires it is refused there as requiring a feature that is off. WHY: “does not exist” means the same whichever way the feature is reached; turning its modules on through another feature would make it exist after all. ALTERNATIVES: refusing a feature that enables an absent one (makes a cross-machine package spell its enables twice); taking it through enables anyway (contradicts its if).
    • targets = [] is refused; a package builds for at least one target. WHY: an empty list is a package nothing can build, and is more likely a slip than an intent. ALTERNATIVES: reading it as every target (the opposite of what it says).
    • Whether a dependency “reaches further” is asked over the dependent’s targets where the entry’s condition holds, so lib { …, if = "macos" } may name a package that builds only for aarch64-macos. The check runs whatever machine the build is for, against the manifests. WHY: an entry the condition leaves out is not in those machines’ builds at all. ALTERNATIVES: refusing on every target of the dependent (forces targets where if already says it).
    • A whole workspace resolved for a machine is the members that build for it, so avin tidy and avin vendor of a workspace answer each target with the members that list it. A workspace’s root, and a package listing no targets, answer for every target. WHY: a member built for Linux alone has nothing to resolve on macOS. ALTERNATIVES: refusing the workspace on the machines some member leaves out.
    • link-flags are passed exactly as written, in order, with no flag merged with another, after the flags of pkg-config or link. WHY: the spec’s “as written”; -framework repeated before two frameworks must stay two pairs. ALTERNATIVES: removing repeats (breaks -framework pairs).
    • c-linking‘s static and dynamic may name a C library the machine leaves out, which does nothing there: a library of a package in the build whose if does not hold, or, <package>/<library>, a library of a dependency whose if leaves it out, named by the dependency’s label (its libraries are not read on that machine, so an unqualified name of one is still refused there). A name that is no library at all is refused on every machine. static-system‘s checks stay per machine. WHY: one program manifest serves every target, so a name meant for one machine must not fail the others, while a typo still fails everywhere. ALTERNATIVES: an if on c-linking‘s entries (a second place to say what the library’s own if already says); resolving every target to check each name (a build would resolve three times).
    • --target is taken by avin check alone for now, reading every manifest as that machine’s build does; avin build --target is the cross-build item. WHY: checking builds nothing, so it needs no other machine’s tools. ALTERNATIVES: every command (a build for another machine needs a sysroot Sysl does not have yet).
    • A condition’s syntax errors name the condition and what is wrong at the place: a symbol, ! or ( wanted (at the end or where a character stands), a ( never closed, or a word following a whole condition; symbols are lowercase and - belongs to a word, so a target’s name is read whole and refused with the condition it means. WHY: one place and one sentence per mistake, as the manifest’s other errors give. ALTERNATIVES: one generic “not a condition” error.
  • Settled on the user’s delegation 2026-11-19 (built on branch machine-files): the choices files for one machine and the machine in an expression left open.

    • A literate file is selected as an ordinary one (watch.linux.lavin), and a file’s name carries one symbol: two parts (watch.linux.x86_64.avin) are refused, naming each, as is a part that is no symbol, on every machine, in a package, a program with no manifest, a dependency and the standard library alike. A file named as a symbol alone (linux.avin) is ordinary. WHY: the spec’s “the part is one symbol”; a .lavin file is a module’s file like any other. ALTERNATIVES: a compound part as && of its symbols (a second condition syntax in file names); leaving .lavin unselected (a literate module could not differ by machine).
    • A program of one file is never selected: avin run tool.linux.avin runs it anywhere. WHY: the file is named outright, so there is nothing to choose between. ALTERNATIVES: refusing it off Linux (a script would fail for its name).
    • The import rule asks, for each file read on this machine, every target its root lists that reads the file, each target’s package read as its build reads it (resolving, and fetching what the cache lacks, a dependency taken only there). A target whose package cannot be read holds no file to anything in a build, and avin check reports it. “No more widely” is by machine: a file for x86_64 may import Linux’s module. A module whose files differ per machine but exist on every machine is imported from anywhere. The rule is checked only where anything differs (a file with a symbol, a manifest entry with if), so other packages cost nothing more. Standard library modules are not held to it, since none is missing on any machine. WHY: the spec’s “for every machine in targets, whichever one is being built”; a dependency’s module names are known only by reading it. ALTERNATIVES: mapping an import to a dependency’s label without reading it (a module’s name need not be its package’s); checking only in avin check (a build would accept what another machine’s build refuses). Review with the user: whether a build may fetch a dependency only another machine takes.
    • The import’s error names the module, its package where it is another’s, the machines it exists on and its files there, the importing file and the machines it is missing on, and it is the only error at that import (the “standard library’s module is meant” hint is not added beside it).
    • avin check checks once per set of targets that read the package alike (the same files, from the same packages), in the order targets lists them; with nothing differing it checks the machine being built for, as before, including refusing a host the package leaves out. A diagnostic every check reports is told once, as it is; one some report gets (onx86_64-linuxandaarch64-linux) after its message; a name that a file of the same module read on another machine declares is told as the spec’s no function start is declared in … on … (also no value, no type). A machine whose package cannot be read is told as on …: and its error. The C unit is built only for the machine the compiler runs on. WHY: one sentence per mistake with the machines it is for, and no other machine’s tools. ALTERNATIVES: a check per target always (the arch-only difference of avin.target would check every package three times); a prefix on …: on every machine-specific diagnostic (moves the headline off what is wrong).
    • avin.target‘s values are declared in the library by its own files (target.macos.avin, target.linux.avin, target.aarch64.avin, target.x86_64.avin), and folding is a lowering of a read of a value of avin.target: a match whose arms up to the taken one are decided by their patterns (variants, alternatives, _, names) compiles that arm alone; an is test against a variant and ==/!= with a variant or the other value are decided and fold the if or the left of &&/|| over them, as an is test a pattern refutes already does. A guard before the taken arm keeps the whole match. WHY: the values are ordinary declarations checked like any other, and folding reuses the decided-condition path. ALTERNATIVES: a compiler intrinsic for os and arch (a second way to make a value per machine); folding every compile-time constant (changes the code of every program reading a constant, beyond what was decided).
    • The language server checks the files of the machine it runs on, so a file for another machine open in an editor is not analyzed as part of its package. A later item may check it for a machine that reads it.
  • Settled on the user’s delegation 2026-11-19 (branch bounded-mailbox): A mailbox may be bounded, given as spawn(b, mailbox = Bounded(capacity, overflow)); a tell to a full one drops by the actor’s Overflow, and senders that must know or wait use offer and send. data Mailbox is Unbounded (the default) or Bounded(capacity: int, overflow: Overflow), Overflow being DropNewest or DropOldest; a capacity less than one traps in spawn. tell keeps its settled promise, never waiting and never failing, and drops as the policy says, counted by ref.dropped() -> long. offer(m) -> Result[unit, SendError] never waits and answers Err(Full); send(m) and send(m, timeout) park the sending thread until there is room (a timed one answering Err(TimedOut), a timeout of zero or less being offer), as a cancellation point that leaves nothing in the mailbox, waking with Err(Ended) where the actor ends; an actor’s send to its own full mailbox answers Err(Full) at once. SendError is Full, TimedOut or Ended; AskError gains Full, and an ask of a full mailbox completes with it at once under either policy, dropping nothing to make room. What the actor arranged for itself (a watch’s notice, a timer’s message, a piped future’s) goes in outside the bound and is never refused, and stop, restart and escalation are not messages, so no bound holds them back; a restart keeps the mailbox and its bound; messages a stash gives back do not count again. Router.pool(…, mailbox) bounds the router’s mailbox and each routee’s at one capacity, and the router waits for room in the routee it chose (SmallestMailbox only once every routee is full), so a full pool’s backpressure reaches the router’s own mailbox, where the policy and offer/send act. A bounded mailbox is a queue under a lock, so the oldest message may be dropped and senders may wait on a condition; unbounded actors keep the lock-free queue and pay nothing. Why: the bound is a property of the actor, chosen where it is started, as its supervision and executor are; separating the sender’s choice (tell fire-and-forget, offer to know, send to wait) from the actor’s policy keeps tell‘s settled meaning and gives every program its backpressure path (marshal’s queues, a pg pool) with no new wait inside tell; an ask that cannot be delivered answering at once is what Ended already does. Alternatives weighed: a capacity and policy on Behaviour or the actor declaration (the same actor wants different bounds in different places); a third policy that fails the tell (tell answers nothing, so the failure would be a trap in the sender for the receiver’s slowness); a tell that waits (breaks the settled rule, and deadlocks two actors telling each other); offer answering a bool (cannot tell Full from Ended); send as a Future (the message would still be delivered after its awaiter was cancelled); a dead-letters hook called with each dropped message (needs a typed callback on the mailbox and runs user code inside the sender’s tell; a counter is enough to observe overload); counting the actor’s own notices against the bound (a full mailbox would lose a watch’s notice of an end); each routee bounded but the router not (a full pool would make the router drop or block with no policy of the caller’s); a bounded lock-free ring (cannot drop the oldest without the actor’s help, and would cap the actor’s own notices too). Review with the user: the overflow surface (two policies, the policy always written out with no default, no failing policy), the names offer, send and dropped, and the router’s bound being shared by router and routees.

  • Settled on the user’s delegation 2026-11-19 (branch lambda-trailing-arg): a block’s last line that closes a bracket opened before the block ends the block at its first comma: in spawn(() -> … a + f(n), 67108864) the lambda yields a + f(n) and 67108864 is spawn‘s second argument, as on one line. The items after the comma are the bracket’s own (positional or named arguments, collection elements, map entries); every block opened in the same brackets on the way (an if‘s or match‘s, an inner lambda’s) ends there too, and a trailing block the line itself opens and closes is stepped over. A tuple the block yields on that line is written in parentheses, (a, b)); a ) on a line of its own, a tuple on an earlier line and a, b = b, a on an earlier line are unchanged. Why: the block’s lines read the trailing items as a tuple the block yields, so the call silently lost its argument (the thread got the default stack and yielded a tuple), and the spec’s “a block inside brackets starts a line again” said nothing about the line that leaves the brackets; the rule makes the multi-line form mean what the one-line form means, as the match-arm rule of 2026-11-15 (“inside brackets a comma ends a match arm’s one-line body”) did for arms. Alternatives: an error for an unparenthesized tuple on such a line, asking for parentheses either way (safe, but rejects the natural way to write a trailing argument); keeping the tuple (silent wrong code). It changes code that compiled before; a scan of every .avin file in the avin-lang repos found none relying on the old reading, and code that did now fails to compile (an argument count or a lambda’s type). Review with the user: it changes the meaning of code that compiled before.

  • Settled on the user’s delegation 2026-11-19 (branch link-control; the user: “It should be as flexible as possible. Avin isn’t just for me, it’s for anyone who would enjoy using it.”): a program chooses how each C library is linked in its root manifest’s c-linking block, and a C library’s own block says what else links it (C bindings). The program’s block holds default ("static" or "dynamic"), static and dynamic lists of libraries (<library> or <package>/<library>), static-system (-l names the system provides, linked from their archives) and search (where those archives are, absolute or root-relative). static-c-libraries = true keeps its meaning as the shorthand of default = "static"; saying both is an error, so nothing that builds today changes. A C library gains files (archives and shared libraries by path), search (-L directories, searched for archives when static), include (-I directories, since a vendored library’s headers are not where pkg-config would say), frameworks and link-flags (raw, the escape hatch); their paths are relative to the package and may not be absolute or hold a .. segment, so a fetched package builds wherever it lands. Static is a promise, dynamic is “as named”: a library linked statically takes no shared library from a search directory (an error names the missing archive, as before, now for link names and files too), while one linked dynamically is linked from the flags as given, so a vendored .a is static either way. Why one block: one place says how the program links, and a static/dynamic pair reads as the program’s sentence (“all static except mlt”). Alternatives weighed: a per-library static = true in the library’s block (the author would decide for every program; refused before and still refused, its test kept); per-library keys inside the program’s own dependencies entries (a library of a dependency’s dependency has no entry to put it in); a top-level link key as Sysl writes it (reads as one key with the -l meaning of a library’s link); static-c-libraries taking a list (one key with two types, and no room for dynamic). The command line (--static-c-libraries, --dynamic-c-libraries on build, run, test and check) stands in for the manifest’s default only; a library the manifest names keeps its way, since such a name usually records a reason (a licence, a missing archive) a one-off flag should not erase. Alternative: the flag overruling everything (simpler to state, but --static-c-libraries would then trip over every dynamic-only library the program had already answered for). A cached run/test build is keyed by how each library is linked and by its files, which also fixed the cache reusing a static build after the manifest changed. A library package may say dynamic-only = "<why>", one key for both “must be dynamic” (licence) and “has no archive”: both mean the same to a build and differ only in the reason, which the error quotes. A program that would link it statically, by its default, the flag or its static list, is refused with that reason and told to name it in dynamic; it is never made dynamic silently, because a program asking to be static would then ship needing the library installed. Alternatives: the requirement silently winning over the program’s default (quiet, and breaks the static promise); a requirement the program could override by static (a licence is not the program’s to waive); two keys, dynamic-only and no-archive (two names for one effect). System libraries stay dynamic unless static-system names them; a named one with no archive in the searched directories, or named but linked by no library, is an error. On Linux (not built yet) an archive is still linked by its path; a -l kept dynamic stays -l; a static-system name maps onto -Wl,-Bstatic -l<name> -Wl,-Bdynamic; frameworks are macOS’s. A package’s vendored C sources are compiled by the library’s sources (the next entry); files links a prebuilt archive. Review with the user: the surface syntax (c-linking and its five keys, <package>/<library> naming, the library keys files/search/include/frameworks/link-flags, the two flags’ names), and the library-requirement rule (dynamic-only refusing a static program rather than yielding to it, and the program’s static list not overriding it).

  • Settled on the user’s delegation 2026-11-19 (branch c-sources; the gap is link-control’s report: a package could link a prebuilt archive by files but not compile the .c files it ships, so a binding of a library distributed as source, sqlite3.c, miniz or stb, needed its user to build an archive for each machine; only a Sysl dependency’s own .c was compiled, by Sysl): a C library names the C files its package ships in sources, and the flags they are compiled with in cflags (C bindings). sources are paths relative to the package, under the rules of files (no absolute path, no .. segment), and a * matches within one directory, as a workspace’s members do; ** is refused, a pattern matching no file and a path that is not there are errors, and the matches are sorted and each file taken once. They are compiled by the clang the C unit is compiled with, for the build’s machine, with -O2 unless cflags names a level (whatever the program’s own -O, so -O0 and -O2 builds share the objects), the library’s include directories as -I, the --cflags of its pkg-config module, then cflags, last. cflags holds what a package says about its C and nothing about the build: defines (-D, -U), an optimization level (-O), warnings (-W, -w, -pedantic), the standard (-std=) and code generation (-f). -I and its kin are refused with a pointer at include, -Wl,/-Wa,/-Wp, with a pointer at link-flags, and anything else (the target, the output, -l, -g) as not a package’s to say; cflags with no sources is an error, since it would read as flags of the C unit, which it is not. The objects are linked into the program before the libraries’ link flags, statically, always, whatever c-linking, the command line or static-c-libraries say of the library: they are part of the program. So dynamic-only beside sources is an error at the entry, and pkg-config or link beside sources are allowed (a wrapper compiled against an installed library, a source calling libz). The cache: each object is kept in csources/ by a key over the source’s text, its flags (an include directory read as the package writes it, so a package keys alike wherever it is fetched), the target, the compiler’s version and clang --version, and the path (package-relative where inside it) and text of every header it includes, which clang lists (-MD) when it compiles and a record keeps; a source with no record is scanned with clang -M first, so two packages shipping the same file compile it once and link it once. avin run‘s cached executables are keyed by each source’s and recorded header’s modification time. The clangs run at once, one per processor at most: Avin has no job count of its own, and this is the bound codegen units already keep. A source clang refuses is reported as error: the source of the C libraryof package

    does not compile: followed by clang’s own output, which names the file and the line; warnings of a source that compiles are not shown (a vendored library’s warnings are its maintainers’; -Werror makes them errors). avin check does not compile the sources; it checks each is there and each pattern matches, as it checks files. Per-machine sources are entries with an if: a library whose sources differ by machine is written as one entry for what is common and one per machine (vend-macos { if = "macos", sources = [...] }), using the conditions every entry already takes, rather than a condition inside sources. A header-only library needs nothing new: its package ships the one-line .c that asks for its implementation (#define STB_IMAGE_IMPLEMENTATION then the include) and names it in sources. Alternatives weighed: a top-level c-sources block apart from c-libraries (the sources belong to the library whose headers and include they share, and a second block would repeat them); cflags passing anything (a package could then name a target or an output and break the build’s own choices); -I allowed in cflags (two ways to say include, one of them able to name an absolute path); the program’s -O level (debug builds of the program would rebuild and slow every vendored library, which is not what is being debugged); conditions inside sources (sources { macos = [...] }, a second condition syntax where if already serves); keying objects by the source alone (an edited header would be missed) or by its preprocessed text (a preprocessing on every build, even when nothing changed); a shared library built from the sources (they are the program’s, and a static object needs no install). Review with the user: the key names sources and cflags, which flags cflags allows, the default -O2 independent of the program’s level, and silencing warnings of sources that compile.

  • Settled on the user’s delegation 2026-11-19 (branch target-keys): every cache entry names the machine it was built for, in its name and in its key. A toolchain has a target (the compiler’s own machine unless a build names another). Under units/, shims/, cunit/ and csources/ an entry is <target>-<key>; the runtime archive is libavinrt-<target>-<key>.a, in the cache and shipped as share/avin/lib/<target>/libavinrt-<target>-<key>.a; a program’s directory under build/ is <name>-<target>-<key>, which holds its executables and its instance cache; the key hashed into each entry also holds the target, and an executable’s record does too. Without a cache directory the compiler’s own machine keeps .avin/build and another machine uses .avin/build/<target>. avin cache info lists the entries per target and avin cache clean --target <target> removes one target’s. Existing caches are not carried over: an old entry has no target in its name, so no build finds it (it is never misread), avin cache info lists it as untargeted, and the least-recently-used sweep removes it, so the first build after the upgrade rebuilds. Why: a cross build, or a prefix shipping archives for two machines, must never reuse an object built for the other, and the name makes the target visible to info and clean without opening a file. Alternatives weighed: the target in the hash alone (disjoint, but info and clean --target could not tell targets apart); a subdirectory per target in each kind (the sweep and info count entries one level down, and a directory would become one entry holding every object of its target, evicted whole); keeping old names for the compiler’s own machine (a compatibility rule with no reader once a second machine exists, and the rebuild is one build). The .avin/build fallback keeps its path for the compiler’s own machine so existing programs’ directories do not move, which is the one place an old entry stays valid, and its executable records carry the target so a stale one is rebuilt. avin clean removes a program’s builds for every target there, and each target’s directory once it is empty.

  • Settled on the user’s delegation 2026-11-19 (branch prefix-ops; the user approved the feature that day): a data type, a class or a trait may define the prefix !, ~ and + as methods taking no argument, as it defines - (operator methods). !a, ~a and +a call a‘s method of that name where its type, or a type parameter’s bound, has one taking no argument; each yields any type, binds at the prefix level, and is resolved by the one path the prefix - already took. Choices this branch made: a ! yielding something other than bool is allowed, as a method < may yield a Cond, so a query builder’s !cond is a condition object. In a condition (if, while, an operand of && or ||) the ! call must yield bool, and one that does not is “expected bool, found Cond”, the same message any non-bool condition gets; the condition then binds no names, since an is test is never the operand of a method !. A method ! takes no argument at all, a defaulted one included: ! has no binary form, and an a ! b reading would be a new infix operator nobody asked for. ~ and + keep their one-argument overloads for a ~ b and a + b. Generic code reaches them through a user trait that declares them (trait Flip with !() -> Self); there is no core trait for them, since no built-in type’s !, ~ or + is anything generic code over user types needs, and Neg stays the only prefix core trait. Where the type has no such method the operator keeps its meaning: on a data type or a class !a, ~a and +a are the errors they were (“expected bool”, “~ needs an integer or a byte”, “+ needs a number”). The built-in types stay closed: a method !, or ~ or + taking no argument, on int, real, byte, char, string, bool or a tuple, in an extension or a trait’s implementation, is an error (“a prefix ! on bool is the language’s own…”); ! is no longer among the reserved method spellings. Two prefix operators written together stay one name (!!x and -~x are the existing “a symbol method has no prefix form” error), so nesting is written ! !x and - ~x, as the operator-run rule already said. Alternatives weighed: requiring bool from every method ! (rules out the query builder the feature is for); core traits Not, Complement and Positive (no program asks for them, and each would need an impl for every built-in type); splitting a run of prefix characters such as !! into nested operators (it breaks the one longest-run rule the lexer and ++/-- rely on). Review with the user: whether !!x should read as ! !x without the space.

  • Settled on the user’s delegation 2026-11-19 (branch collection-apply): a collection is made by naming its type and listing its elements. Array(1, 2, 3) was refused; it now works, as an ordinary companion apply[T](elements: T*) in the library (no compiler special case: the repeated parameter infers T from the elements, from the expected type, or from type arguments written at the call, and Array() with none is the existing “cannot infer” error). Types that gained the form: Array, Buffer, Deque, ArraySeq, LazyList, the mutable Set and LinkedSet, and PriorityQueue (by the elements’ own order); Vector, List, Queue, Set, HashSet, SortedSet, SeqSet, OrderedSet, TreeSet (immutable and mutable) and BitSet already had it. Array(1, 2.5) widens to Array[real]; mismatched types are the ordinary argument error. A class that keeps fields its own code fills in (LazyList) no longer offers its constructor to a call outside that code, so LazyList[T]() calls the companion’s apply and makes the empty list instead of being refused. An empty call with no element type to infer follows the settled rule of 2026-11-04 (generics.md): the covariant collections (Vector, List, Queue, ArraySeq, LazyList) take Nothing, as [] and Vector.empty() do, and an invariant or bounded element type (Array, Buffer, Deque, every set, PriorityQueue) is a “cannot infer” error. The refusal of an array’s name with type arguments used as a value (Array[int]) stays, its text now naming Array(a, b). The old refusal of calling an array’s constructor is removed, and the literal [1, 2, 3] is unchanged. Maps are excluded (settled 2026-11-09): Map("k" -> 7) stays refused with its hint to write {"k": 7}, and no pair operator is added. Map((k, v), …) taking tuples already exists and stays; no other map gained a form. Alternatives weighed: a compiler special case treating Name(a, b) as a literal (rejected: the library form needs none, and a program’s own collections get the form by declaring apply). Review with the user: whether the tuple form Map((1, "one"), …) should stay beside {1: "one"}, since it is a second way to write a map that no one needs.

  • Settled on the user’s delegation 2026-11-19 (branch diff): avin.diff, a module of the standard library for the differences between two sequences and between two texts’ lines. It is library/avin/diff/diff.avin, a module of its own beside avin.uuid, not part of the prelude, so a program names what it uses (import avin.diff.{diff, unifiedDiff}). The API: diff[T: Eq](a, b) -> Vector[Edit[T]] with Edit[T] the variants Keep(value), Insert(value) and Delete(value); apply(a, edits), which checks every Keep and Delete against the input and traps naming the edit; changes; Line(text, terminated) with splitLines and joinLines; LineOptions(ignoreTrailingSpace = false, finalNewline = true) and diffLines; Hunk, hunks(edits, context); renderUnified and unifiedDiff, whose output is diff -u‘s byte for byte (checked against GNU diff’s on twenty fixture pairs at context 0, 1 and 3). The algorithm is Myers’ O(ND) with the linear-space middle-snake refinement, so memory is proportional to the inputs (three arrays of their combined size, and the script) and never to their product; a run of changes lists its deletes before its inserts, as diff -u prints them. Choices: edits carry the elements, not indices, so a script is self-describing and apply can verify it (a Keep holds the first sequence’s element, so a line diff that ignores trailing space keeps the original text); lines split at \n only and keep a \r, as diff does, so CRLF is a difference unless ignoreTrailingSpace is set (which ignores a \r with the rest); a last line with no \n differs from the same line with one by default, as diff reports it, and finalNewline = false makes them equal; two changes share a hunk when no more than 2 * context unchanged lines lie between them; an empty range is written start,0 with start the line before, a range of one line as its number alone, as diff -u does. Alternatives weighed: edits as index ranges (Keep(aStart, bStart, count), more compact for large inputs, but cannot be applied without the second sequence and reads less well in a pattern match); the quadratic table of the longest common subsequence (simplest, but 10,000 lines against 10,000 takes 10^8 cells); a patience or histogram diff (often reads better on source code, but is not shortest and does not match diff -u); a prelude placement (every program would carry the names Edit, Keep and Delete). Tests: library/tests/diff.avin, with every pair of sequences over three values up to four long and random pairs checked against the quadratic table for minimality. Review with the user: the names Edit, Keep, Insert, Delete, diffLines, unifiedDiff and changes, and whether a patience diff should join this one as diffLines‘ option.

  • io.inputs and io.inputLines: the files named, or standard input when none. Settled on the user’s delegation 2026-11-19: io.inputs(paths: Vector[string]) -> Iterator[Result[(string, string), IoError]] yields each input as its name and all its text, and io.inputLines(paths) yields the same shape with one line per element. No paths is one input, standard input; - names standard input wherever it stands in the list, and a name is yielded as written, so standard input is "-". Inputs are read as the iterator reaches them; one that cannot be read is an Err (the ordinary IoError, naming the file) in its place, and the iterator goes on, so a tool reports and carries on, and .collect/? style stopping at the first failure is the caller’s choice. Standard input is read to its end once, so a second - is empty. A file’s lines come from its whole text (readText), standard input’s as it advances. Why: every command-line filter writes this loop, and an element carrying its name serves the name:line output of grep and an error message alike. Placed in avin.io beside readAll and lines, named as they are. Alternatives weighed: Vector of results (reads every file before the first line is used, and cannot stream standard input); a Source of the concatenation (loses where each line came from); stopping at the first failing file (a tool wants to report each); a name of "" for standard input (indistinguishable from a named empty string, and - is what the tool was told). Tests: tests/run/io_inputs_files, io_inputs_stdin, io_inputs_lines_stdin. Review with the user: the name "-" yielded for standard input, and files being read whole rather than streamed by line.

  • A symbol method may declare its precedence and grouping (branch declared-precedence, 2026-11-19; the user approved “perhaps declared precedence” in the missing-features list, 2026-11-19). The surface is A declared precedence. Review with the user: the whole surface, the annotation names @precedence and @groupsRight, naming a level by an operator’s string, and the program-wide rule.

    • Settled on the user’s delegation 2026-11-19: @precedence("|") names a row of the existing level table by any operator in it, and @groupsRight makes calls group to the right with the receiver kept on the left. The rows a method may take are the symbol levels plus &&‘s and ||‘s, which a pipe looser than every comparison needs. WHY: no level is added, so the table stays the whole account of how an expression reads, and a reader who knows how | binds knows how a call declared as | binds; naming the row by its operator needs no new vocabulary. ALTERNATIVES: numeric levels (refused: a reader cannot place infixl 6 without a table of every declaration in scope, and two libraries’ numbers interleave in ways neither author saw); identifier level names such as @precedence(additive) (a second set of names for rows the operators already name); one annotation with a grouping argument, @precedence("^", right) (a positional flag reads worse than a word of its own); @groups(left) as well (a name ending in : would then take its receiver on the right yet group left, a combination nothing needs); nothing new, with documentation (the user approved the feature).
    • Settled on the user’s delegation 2026-11-19: a declaration belongs to the method’s name across the whole program, and every method of that name in the program reads alike: an overload, another type’s method, a trait’s declaration and each implementation either declare the same reading or one that comes to the same (a method declaring nothing agrees only where the declaration restates what its name gives); any other is an error naming both, reported at the program’s method where the other is the standard library’s. WHY: the parse runs before any type is known, so a <|> b cannot be read by a‘s type; a module holding a value of the type without importing it must read its calls as the declaring module does, which only a program-wide reading guarantees; and a module’s code cannot change meaning silently when an unrelated library joins the program, because that is an error instead. ALTERNATIVES: by the receiver’s type at each call (needs types at parse time, or a second parse after checking, and makes a op b op2 c unreadable without knowing every operand’s type); visible through imports only, as some languages scope fixity (a module that reaches the type through a function’s result, without importing its module, would read the calls differently from the declaring module); undeclared methods silently following a declaration (another library’s <|>, written for the default reading, would be re-read by a declaration it never saw).
    • Settled on the user’s delegation 2026-11-19: the compiler reads declarations after parsing every unit with the default levels, then parses again, at the declared levels, only the units that write a declared name, a program with no declaration that changes a reading being parsed once as before. WHY: the declarations are on methods inside the files, so they are known only after a first parse; re-parsing keeps the parser the one place precedence lives, with no tree rewriting pass to keep in step with it. ALTERNATIVES: a fixity-resolution pass over the parsed trees (a second implementation of the precedence rules over every expression form); a lexical pre-scan for declarations (a second, partial parser of class and impl bodies).
    • Settled on the user’s delegation 2026-11-19: only a method named by a symbol the language does not use declares: @precedence or @groupsRight on one of the language’s operators (+, |, <), an assignment (++=), a method named by a word, or a function is an error; ~, ++ and -- between two operands may declare. @groupsRight on a name ending in : is an error (it groups right already). A comparison and is take part in the rule against mixing groupings now that a right-grouping method can share their level. WHY: the language’s own operators keep one reading everywhere, and every named call binds alike.
    • avin parse, avin fmt and the LSP’s single-file views read one file at a time and so parse it at the default levels; avin check, run, build, test and the LSP’s diagnostics load the whole program and read the declarations. avin fmt keeps the file’s tokens, so a default reading changes only where it chooses to break a long line.
  • Settled on the user’s delegation 2026-11-19 (branch bytes-sendable; found by the ssh package on pty-forward, whose relay could hand read buffers to per-connection threads only by copying each into a Vector[byte]): an array the program holds moves to another thread with Isolated.move(items), with no copy, and the array carries an owner that every use checks (handing over ownership). move[T: Sendable](items: Array[T]) -> Isolated[Array[T]], on Isolated‘s companion in avin.actors; it covers every Array of sendable elements, bytes or not, and nothing else. An array’s header gains an owner word beside its length (eight bytes), zero for an array never moved, which any code that reaches it may use as before, since an array is still not sendable. A move also rewrites the length word for good: its top bit set, the length in bits 32 to 62, the low 32 bits zero. So an element use of an array never moved checks exactly what it did before, the index against the low 32 bits, and a moved array fails that check for every index and goes on, on a path the optimizer is told is cold, to compare its owner; length, a slice, a clear and a copy test the word’s sign as they read it. A move gives it an owner no running code is, by one compare-and-set; take claims it for the taker, with for the code running f and moves it again after; every use by other code traps with `Array` was moved to another owner: an element read or write, length, slice, a copy into or out of it, an iterator’s step, a C binding’s argument (checked before C sees it), a Sysl binding’s argument (checked as its shim reads it), a ByteBlock write from it, and a second move. Aliases (a field, a closure’s capture, an iterator) are the same object, so their uses trap as the local’s does; a slice taken before the move is a copy and stays the sender’s; frozen arrays (a Vector‘s or an ArraySeq‘s) are the library’s own, never moved, and unchecked. Why: an array’s elements are stored inside the object, so a move cannot hand the receiver new storage and leave the sender an empty shell; the only sound zero-copy move of an array other references may reach is one the array itself enforces, and an owner word read beside the length the bounds check already reads keeps the common path to a load and a compare. Handles already move this way, and the messages match. Alternatives weighed: (a) transfer on send, making Array sendable and moving it implicitly at every send — then an @isolating body (a mutex’s value, isolate) could capture an array that was never moved and share it unchecked between threads, so every array would need a real owner from birth and every mutex, pool and Isolated a walk to re-own what it holds; far wider and slower for the same gain. (b) freeze()/toBytes(), an immutable sendable view — still needs the array to refuse later writes (the same owner word), and the relay wants a buffer the receiver can write and hand back. (c) a separate Transfer[T] type — Isolated already is the type of “mutable, moving, taken once”, with take, with and its place in the handover walk; a second type would duplicate it. (d) lifting @trusted_sendable‘s restriction to the standard library — rejected: it would let any package declare an array-holding class sendable with nothing checking the claim, which is a data race, not a gap closed. A compile-time refusal of the sender’s later use was weighed too: it needs uniqueness or alias analysis the checker does not have, and the runtime check covers every alias. The cost, measured on the build that settled it: memory, a million live arrays of 0 to 100 bytes take 0 or 16 more bytes each, by whether the eight cross a 16-byte allocation class (56→56 bytes at 0, 1 and 8 elements; 56→72 at 9 and 16; 72→88 at 32; 104→120 at 64; 152→152 at 100). Time, at -O2: a read loop over an array never moved compiles to the same ten instructions as before; a write loop bounded by a.length keeps an element bounds check the optimizer used to drop, plus a sign test, three predictable instructions an iteration. A first encoding that loaded the owner word at every use was measured (preliminary, eleven interleaved runs, before the benchmark was cut short) at 3% to 54% slower in tight loops, which is why the owner sits behind the bounds check; the encoding that settled was checked in the generated code, not timed. Review with the user: the remaining write-loop check and the memory above, and whether Buffer should move the same way (its length is a field of its own, so it would need its own owner).

  • Settled on the user’s delegation 2026-11-19 (branch ports-cli): an example of many files, examples/NAME/, is run and its output checked when examples/NAME.out stands beside it, and is only built and linked when it has none, as a program that opens a window has none. Its input and expected standard error are examples/NAME.in and examples/NAME.err, its expectation lines (// args:, // expect:) in its own files, exactly as a program in tests/programs/run has them. Why: the command-line examples (wordfreq, grep, logsum, dusage, markdown, todo) are directories with a README, and the sidecar beside the directory is the rule the corpus already reads for programs of many files, so nothing new is learned to read one. Alternatives weighed: sidecars inside the directory (a second rule for the same thing); a header line marking a window program as not run (a marker on the exception rather than on the output that makes the check); a separate examples/run/ directory (splits the examples a reader browses by how they are tested). Branches ports-concurrent and ports-numeric reached the same rule on their own, with the same reasons; the corpus keeps one copy of it.

  • Settled on the user’s delegation 2026-11-19 (branch variant-fn-value): a variant with fields, named and not called, is its constructor as a function value, as a class’s name is. Heard, Event.Heard, events.Heard and Some[int] are each a function of the variant’s fields, in order and all of them (defaults are not dropped, as a class constructor’s value drops none), to its data type, or to a refined variant’s declared instance: ["a"].map(Heard), [1, 2].map(Some), adapter(Heard), listener.ask(Stop, patience). Where a function type of as many parameters is expected, its parameters stand for the fields’ (an open one there takes the field’s type, so adapter(Heard) needs no adapter[ChatEvent]) and its result is the type the variant is made at, which also decides between variants sharing a name; elsewhere the value’s type is the variant’s own, and a generic variant whose instance nothing decides is reported (“cannot infer T for Some used as a value; write it, as in Some[int]“). An expected type the variant does not fit is reported as the whole value’s type against it. Where a value of the variant’s own data type is expected, the call was meant, and the old error stands (“Circle has fields; call it, as in Circle(arguments)“); a variant without fields is still the value it names. A data type’s companion object of the variant’s name that declares apply, where a function type is expected, offers the variant beside its apply methods, chosen as among overloads, as the call Name(…) already chose among them. The value is a lambda made at the use that calls the variant as written, so it captures nothing and is @sendable where one is wanted. Why: the smallest rule that makes a variant behave as the constructor it is, with the typing a class constructor’s value already has; ports of concurrent programs reached for it at every actor adapter and ask. Alternatives weighed: a value only where a function type is expected (refuses val f = Heard, which a class name allows); a function value that drops defaulted fields (a value has no defaults, and which arity would be ambiguous); keeping the variant out of a companion’s overloads (inconsistent with the call). A lambda whose parameter type nothing but its body decides, adapter(e -> Heard(e)), still reports “cannot infer the type of e“: the lambda’s parameter is typed before its body is checked, and this item does not widen inference.

  • Settled on the user’s delegation 2026-11-19 (branch scalar-left-ops): a built-in value may stand on an operator method’s left. An impl of no trait adding to int, long (any integer width), real, byte, char, string or bool, in the type’s module or as an extension, may add a binary arithmetic, ordering, bitwise or shift method whose one parameter is a data type, a class, a trait or an opaque type (any type arguments): impl real adding *(v: Vec) -> Vec = v * self makes k * v legal. l op r with l built-in and r of such a type calls l‘s method when an overload takes r (or r‘s type has no integer/decimal conversion, so the call reports the overloads); resolution is static by parameter types, chains and <-links included. An integer literal on the left is int where an int overload fits, else long, else real (2 * v). A method of such a name on a built-in type taking a built-in type, tuple, function, union or type parameter stays an error (a type parameter could be filled by a built-in type), as does any such method in a trait implementation (impl Grow for real) and every prefix method; an unseen extension’s operator is reported with the module to import. WHY: k * v is how scaling is written, and code was forced into v * k; since the operand is never built-in, built-in × built-in arithmetic can never change meaning, and the rule reuses relaxed impls and overloading, adding no new declaration form. A type that takes integers (BigInt) keeps meeting integers by fromInteger unless an overload names it. ALTERNATIVES: reflected methods on the right operand (*: or a reverse *, as a second dispatch step: two places a reader must look for one operator, and a precedence question when both sides define one); a Scalar trait the right type implements (scale(k)), which serves only multiplication by numbers and not "label" + v or k < v; widening FromInteger-style conversion of the left operand to the right type (wrong for k * v, where a real is not a vector). The literal preference int, long, real was chosen over “ambiguous when several fit” so 2 * v works with only real adding *. Tests: tests/run/scalar_left_operators, tests/reject/scalar_left_operator_{declarations,builtin_operands,calls}, tests/programs/{run,reject}/scalar_left_extensions. Review with the user: whether an operand of a type parameter bounded by a trait ([T: Shape] k * s) should also dispatch (left out: the right operand must be a concrete program type today), and the literal preference order.

  • Settled on the user’s delegation 2026-11-19 (branch display-width): the standard library measures the columns of a terminal: char.displayWidth, string.displayWidth, padStartWidth(width, ch = ' '), padEndWidth(width, ch = ' ') and truncateWidth(width, ellipsis = "…"), and a formatted field’s width counts those columns. The rules (library/avin/display_width.avin): a character is 2 when East Asian Wide or Fullwidth; 0 when a nonspacing or enclosing mark, a format character (but the soft hyphen and the marks before a number), or a Hangul vowel or final jamo; 0 when a control character; 1 otherwise, Ambiguous and unassigned included. Text is measured by cluster: a character with the zero-width characters after it, a skin tone after an emoji, and, after a pictograph, each pictograph a zero-width joiner joins; a cluster is as wide as its first character, except that a variation selector 16 after an emoji, or a skin tone, makes it 2, and two regional indicators are one flag of 2. The table is generated from the Unicode Character Database 17.0.0 (the version sysl.unicode answers with) by scripts/display_width_table.avin into library/avin/display_width_table.avin, about 3 KB of base-32 runs decoded on the first character beyond ASCII; ASCII is answered without it. Choices, each with its rationale and the alternatives weighed:

    • Control characters are 0, not -1 as C’s wcwidth answers: a width is summed, and a -1 makes every sum wrong; where a tab or newline moves the cursor is the terminal’s business. Alternative: 1, as tui draws a control as U+FFFD (a drawing choice, not a measure).
    • Emoji sequences are 2 per cluster, as kitty, WezTerm, iTerm2, Ghostty and the other modern terminals draw them; older terminals that measure each code point make a family 6 or more. A variation selector 15 changes nothing, since terminals mostly keep a default-emoji character two wide under it. A lone regional indicator is 1, its East Asian width. A zero-width joiner joins only a pictograph to a pictograph, as the grapheme rule GB11 does, so a + ZWJ + 😀 is 3. Alternative: full extended grapheme clusters from the break tables avin.regex carries (exact for Indic conjuncts and prepended marks, but the prelude would carry those tables and the widths come out the same for what a terminal draws).
    • Separate names, padStartWidth/padEndWidth, beside padStart/padEnd, which keep counting characters. Alternative: a named parameter (padEnd(10, byWidth = true)), rejected as a flag that changes what the first argument means; or changing padEnd itself, rejected because a sequence’s padTo and take/drop count characters and padEnd pairs with them. A wide fill character fills two columns at a time and a space fills a column left over; a fill of no width traps (padding by width needs a fill character that takes a column) when padding is needed, rather than looping or silently using a space.
    • truncateWidth never cuts a cluster, so the result may be a column short of width where a wide character does not fit, and adds no padding (pad it after when a fixed width is wanted). An ellipsis wider than width is dropped and the clusters that fit kept; a width of 0 or less keeps nothing.
    • A formatted field’s width (%8s, %-6?, %3c, and FormatSpec.width in writeField) counts columns: field widths exist to line columns up, and for ASCII nothing changes. The precision of %s and %? still counts characters, as take does. The runtime’s text_width intrinsic, which counted code points for the field, is removed. Review with the user: this changes the output of an existing program that formats wide or combining text into a field (a CJK %10s now pads four columns less for two ideographs).
    • avin.cli‘s help measures names with displayWidth and pads with padEndWidth. The tui package’s own table (width_table.avin, Unicode 16.0.0) and its charWidth/textWidth can become calls to these.
  • Examples of concurrent programs, and what they asked of the library (branch ports-concurrent, 2026-11-19).

    • Running an example of many files that has its output beside it: the ports-cli entry above.
    • Settled on the user’s delegation 2026-11-19: Response.html(status, text), a response of the type text/html; charset=utf-8 with the text sent as given, beside Response.text and Response.json. WHY: a server that renders a page wrote Response.bytes(status, text.utf8, "text/html; charset=utf-8") by hand. ALTERNATIVES: none kept; escaping the text (it is markup, already written).
  • Settled on the user’s delegation 2026-11-19 (branch lib-papercuts): four library papercuts. (1) Every hasher of avin.crypto (Sha256, Sha512, Sha1, Md5) gains update(bytes: Array[byte]) and the range forms update(bytes, from, until) for a vector and for an array; the array is handed to the digest in place through the @sysl binding, with no copy, and a range outside 0 ..< bytes.length or with from > until traps. (2) Channel.length answers the number of buffered values, a snapshot under the lock that is stale at once (documented as a racy observation); size is the same number, since the inherited size would consume the channel by iterating it; capacity, the constructor’s bound, is now a public val (unbounded for a channel made with none, 0 for a rendezvous). (3) max and min are methods of every integer type, real (as math.max/math.min: NaN when either is, -0.0 below 0.0), char and byte, returning the first operand when equal; they are separate from int.MaxValue/MinValue, which are static members. (4) The mutable Map, Set, LinkedMap and LinkedSet companions gain the variadic apply, shaped as the mutable TreeMap and TreeSet have it (Map((1, "a"), (2, "b")); later pairs replace earlier ones, a linked collection keeps first-insertion order). Why: each closes a gap a ported program met and costs one line of surface. Alternatives weighed: a Slice type for the range form (rejected, (bytes, from, until) is the shape string.slice and the collections already use); Channel.length as a method with a call (kept parameterless, as size); max/min only through Ord (rejected, Ord has none, and the free functions need an import for real).

  • end closes a form only when a name follows it, wherever it stands. Settled on the user’s delegation 2026-11-19 (branch keyword-member-diag): end = at after a statement with an indented body is the word end used as a name and gets the one error end is not defined, instead of an end closer that swallowed the = and cascaded into an infix-call error quoting the whole enclosing body. The infix-call “no argument” suggestion quotes a receiver that spans lines as …, and is not reported when the receiver is itself an already-reported error. Alternatives weighed: a dedicated “end is a keyword” error (a second message for what the name lookup already says); quoting the last line of a multi-line receiver (a fragment that is not the receiver).

  • Settled on the user’s delegation 2026-11-19 (branch given-grammar): the editor grammar scopes given and using only where they are keywords. given is keyword.declaration at the start of a line (after an optional private) when a name and then : or = follow, and never after ., before val/var, or as a name (given = 3, given(x)). using is storage.modifier when a parameter name follows and then :, ,, ), -> or =, in a parameter list or a lambda, and not as a name (f(using: Mode), using -> using, val using = 1, x.using y). Why: the spec makes both words keywords only in those positions, and a line-local TextMate pattern can see exactly them. Alternatives weighed: scoping both words everywhere (colours ordinary names wrongly); a begin/end rule for parameter lists (a parameter list can span lines and nest, which the line-based tokenizer cannot track reliably). Review with the user: a using whose parameter name ends its line (a parameter list broken across lines) is not coloured.

  • API documentation from the source (branch avin-doc; avin doc, doc comments).

    • Settled on the user’s delegation 2026-11-19: a doc comment is the run of // lines directly above a declaration, past any annotations between: exactly what the language server’s hover already showed, so no second comment form exists and every comment the standard library already wrote is its documentation. It is Markdown with GitHub’s extensions; each line loses its // and one space, and keeps the rest of its indentation. Alternatives weighed: a /// form of its own (every existing comment would have to be rewritten, and a plain comment above a declaration would silently stop being shown).
    • Settled on the user’s delegation 2026-11-19: avin doc [<program>] [-o <dir>] [--check] [--std-url <url>] [<features>] and avin doc --std: the program is checked as avin check checks it, with every feature on, and refused with its diagnostics when it does not check; a page per module (<module>.html), the root module’s declarations on index.html beside the list of modules, a shared style.css and a search.js the search box reads, no fetch from anywhere else. The default output is .avin/doc beside the program (the package’s directory, the directory of a program without a manifest, or the file’s), which a package’s .gitignore already names; a directory is written only when it is new, empty, or holds .avin-doc, the marker avin doc writes, and then its old pages are removed first. Alternatives weighed: doc/ beside the program (a directory of hand-written docs by that name would be overwritten); --check that also writes (a check in CI wants nothing written).
    • Settled on the user’s delegation 2026-11-19: what a page shows: every public declaration of every module but a test module (@tests files and a package’s tests module), each with the header hover shows (a function’s, a field’s and a value’s as the checker typed it; a type’s first line as written), a data type’s variants and a record’s fields, a class’s public fields and methods, a trait’s members, an object’s, a type’s public member exports as written (export f.{m, n as k}), the impls a type has with their public methods, and a module’s exports. An impl is listed with its type when the site documents the type among modules of the same kind (the program’s, a dependency’s, the library’s), with the module it is written in named when that is another; otherwise under its own module’s “Implementations”. A method is shown without its type (map[U](…), not Option[T].map[U](…)). A module with nothing public and no comment has no page. Anchors are Type, Type.member, function, an overload’s name-2, an impl’s Type.impl; a byte outside a name is written ~ and its hex.
    • Settled on the user’s delegation 2026-11-19: a type named in a signature links to the declaration the checker resolved it there, so two types of one name in two modules are never confused; a name the checker inferred rather than read (an alias’s body shown in its place) links to the one type of the site with that name, and a type parameter never links. The standard library’s modules the program reads, and its dependencies’ modules, are written beside its own, listed apart on the index, so every link stays inside the site; --std-url names where the library’s pages are published instead and writes none of them. Alternatives weighed: always linking to a fixed public URL (a site that breaks offline, and on a version mismatch); never linking into the library (the commonest types of every signature would be dead text). Review with the user: whether the library’s pages should come with every package’s documentation by default.
    • Settled on the user’s delegation 2026-11-19: links in a doc comment: a link whose destination is a path of names, [the map](Vector.map), and [Name] or [`Name`] with no destination, link to that declaration, found as a member of the documented declaration’s type (and its owners’), then in its module, then as a full path or a module’s name, then in the prelude, then as the one declaration of the site with that name (Type.member included). A relative destination that names no declaration must be a page of the site. --check fails on a destination link that leads nowhere, a backticked [`Name`] that resolves to nothing, and a fenced block with no language or avin that parses neither as declarations nor as the statements of a function body; a bare [words] that names nothing stays prose, and http:-style links are not fetched. Without --check the same problems are warnings and the pages are written. Only the program’s own modules are checked, never a dependency’s or the library’s. Alternatives weighed: reporting every unresolved [x] (prose in brackets is common: [1, 2, 3]); fetching external links (slow, flaky, and a fetch the command promises not to make); running the blocks as tests (a separate feature, left for later).
  • Settled on the user’s delegation 2026-11-20 (branch mem-mir-size): the mid-level representation keeps an integer constant as a number and shares each call signature. An Operand was 40 bytes because ConstInt held its decimal text; it now holds a long (ConstInt(bits, value)), and an integer no long spells the same way (one wider than 64 bits, a BigInt literal) is ConstWide(bits, digits: &string), so the LLVM text stays byte for byte what it was. A Runtime or Indirect callee names a &MirSignature that lowering makes once per shape (MirSignatures, keyed by the signature’s types), so a call no longer carries its own two lists. Operand 40 → 24 bytes, Inst 136 → 88, Terminator 64 → 48. Measured on marshal at -O2 with a cold cache: the lower phase’s resident memory 2.98 → 2.28 GB, its in-use heap 1.80 → 1.41 GB, the build’s peak 5.54 → 4.66 GB; the emitted module of marshal (with and without -g) and of 252 corpus programs is unchanged. The instance cache’s entry format is unchanged too: a constant is still written as its digits and a signature in full, and reading one shares it again. Alternatives weighed: signatures by index into a table on MirProgram (as small, but every pass that reads a call’s signature, emit, devirtualization, union words and the instance cache, would need the table handed to it, where a shared reference needs nothing); keeping one signature per call behind a reference (no sharing: the lists stay per call); boxing the rare large instructions (Variable, AtomicCompareSet, a C call’s CFunction): once operands shrank, the largest variants, Call, Select, AtomicCompareSet and Variable, all carry 80 bytes, and Call and Select are common, so boxing the rare ones shrinks no instruction and was left out.

  • Settled on the user’s delegation 2026-11-20 (branch mem-clang-child): a build’s clangs and link run in a compiler image that never compiled. Once avin build, avin run or avin test has compiled (diagnostics already said, the instance cache already written), the compiler writes the module’s text, the shim archive, the C flags and the tests to a temporary directory and replaces itself with exec as avin --linking-handed <dir> <the same command>; the new image carries out the same command, takes the compilation from the directory where it would compile, removes it, and splits, compiles the units and links. Freed small allocations stay resident for a process’s life on macOS, so only a new image drops them: marshal at -O2, cold, peaked at 8.19 GB for the process tree before and 5.48 GB after (the compile alone; the linking image held 1.10 GB beside its 8 clangs), at the same speed. Same process id, standard streams, exit status and signals; AVIN_BUILD_LOG goes on in the same file, with handoff and restore lines between the compile’s phases and the link’s. When the directory cannot be written or the image cannot be started, the link runs in place as before; a directory that cannot be read is compiled again. Only the compiler’s own main hands off, so a compiler run in memory (its tests) links in place. Alternatives weighed: a child that compiles and exits while the first process waits to link (what Sysl’s sysl test does; two processes, and every diagnostic and the live report passed across); a child for the link while the compiling process waits (its retained heap stays resident beside the clangs, so nothing is gained); returning freed memory to the system (macOS gives none back). Review with the user: the internal --linking-handed argument shows in ps while a link runs.

  • Settled on the user’s delegation 2026-11-20 (branch gc-release): a collection gives the whole pages of large free runs back to the system (runtime), through the page release hook of gc 0.4.0, with the system’s page size (getpagesize, 16 KiB on macOS arm64).

    • How, on macOS: the range is mapped afresh in place (mmap with MAP_FIXED), as the stacks’ unused pages already are. Measured on a burst of 8 million strings (932 MB at the peak) dropped and followed by churn: the resident size the system reports (process.residentBytes, what marshal reads) stayed at 1047 MB with MADV_FREE and with MADV_FREE_REUSABLE, and fell to 2 MB with the remap. MADV_FREE_REUSABLE also expects MADV_FREE_REUSE before the pages are used again, and the collector hands a released run out again with no call to the client, so it was not sound here even had it measured well. On Linux, madvise(MADV_DONTNEED), which drops the pages at once; written, not run on this machine.
    • When: a collection releases only when the arena reaches more than twice the budget past what the last collection left live, and at most once a second. Without the first condition a program whose live data is small churns its 8 MiB of allocation in and out of the system at every collection; without the second, one whose live objects sit high in the arena (a buffer made after a burst) releases and refaults the free pages below them at every collection. Both were measured: unthrottled, the churn after the drop took 1.2 s more system time over 2000 collections; with both conditions the system time is the same as with releasing off. A collection that does not release runs with the hook removed, so its free runs stay ordinary blocks a later collection can release. The first release in a program is never delayed.
    • AVIN_GC_RELEASE=0 turns it off; unset or any other value leaves it on.
    • Cost: binarytrees 21 at -O2, three runs each way, 7.01–7.81 s with releasing and 7.01–7.39 s without (the same within noise); the burst reproducer’s churn 9.16–9.72 s user with and 8.78–9.56 s without, system time 0.09–0.11 s both ways.
    • Alternatives weighed: MADV_FREE and MADV_FREE_REUSABLE (above); releasing at every collection (the refault cost above); a retained cushion skipped inside the hook (unsound with this gc: a range the hook skips is still marked released, and is never offered again until written); a library call to release on demand (no program needs it yet). Review with the user: whether one second is the right interval, and whether a program should be able to ask for a release (a collection) itself, since without one a program that drops a burst and then allocates little keeps its pages until enough allocation brings a collection.
  • Settled on the user’s delegation 2026-11-23 (branch http-request-timeout): http.serve bounds the whole of a request (servers) by requestTimeout, 60 seconds unless asked, measured from the request’s first byte and covering its line, headers and body, chunked or of a length; once spent, the next wait for bytes is answered 408 and the connection closed, freeing its slot among maxConnections. Why: readTimeout bounds each wait alone, so a client sending a byte every few seconds held a connection, and a slot, for ever.

    • Each request has its own bound, begun when its first byte is read; on a connection kept alive the idle wait before it is idleTimeout‘s and no part of it, and a connection’s wait for its first byte stays readTimeout‘s. A wait is cut to what is left of the bound, so the 408 comes at about the bound and not at the next readTimeout. Bytes already read ahead (pipelining) are parsed without a wait, so the bound costs a clock reading per wait only.
    • Zero is no limit, as for the other timeouts; a negative bound traps where the server starts, as a negative maxBodyBytes does (a negative timeout is a mistake, not a wish).
    • The parameter comes last, after errors, so no call passing the earlier ones by position changes meaning.
    • A refusal’s drain is bounded in time too: after a refusal the server read and dropped what the client still sent, each read waiting half a second, up to 1 MiB, so a client trickling on after its 408 kept the connection for as long as it liked. The drain now lasts half a second in all.
    • Alternatives weighed: a header bound alone (as some servers keep apart from a body’s) leaves a trickled body open; a minimum data rate is harder to state and to test; 30 seconds (as readTimeout) or 300 seconds for the default. Review with the user: whether 60 seconds suits as the default, since a slow client uploading the default largest body of 1 MiB needs about 17 KB/s, and a server taking larger bodies has to raise it; and whether a TLS handshake, whose waits are each readTimeout‘s, should get a total bound too.
  • Settled on the user’s delegation 2026-11-23 (branch http-forms): form bodies in avin.net.http (HTTP server): ServerRequest.form() and Request.withForm for application/x-www-form-urlencoded, ServerRequest.multipart(limits), Multipart.parse, Multipart.encoded and Request.withMultipart for multipart/form-data.

    • One urlencoded codec, Url.formDecode and Url.formEncode, which queryParams now reads through, so a query and a form body decode alike (WHATWG URL’s parser and serializer). Decoding is strict where WHATWG is lenient: a malformed % escape or bytes that are not UTF-8 are an error (BadEncoding(UrlError), 400) rather than kept or replaced by U+FFFD, since a silently altered field is worse for a server than a refusal. A charset parameter is ignored; the body is read as UTF-8, as WHATWG reads every form. The serializer escapes ~ as WHATWG does, so formEncode differs from Url.encode there.
    • A wrong or missing Content-Type is an error (NotAForm, 415), never an empty form. form() and multipart() are methods with parentheses, since each parses the body anew.
    • Multipart is read strictly by RFC 2046 lines: CRLF only (a body of bare line feeds has no delimiter); a delimiter followed by anything but -- or optional spaces/tabs and CRLF is body content, so binary bytes resembling the boundary stay in the part; a body without the closing delimiter is BadMultipart; a body of no parts (--b--) is an empty Multipart. Every part needs Content-Disposition: form-data with a name (RFC 7578 §4.2); a part’s type defaults to text/plain (§4.4). Header lines must be token: value in UTF-8; folded lines are refused.
    • Names and filenames are read as the WHATWG HTML standard writes them: a quoted value runs to the next ", and %22, %0D, %0A become ", CR, LF; there is no backslash escaping (browsers send Windows paths with raw backslashes). The builder writes the same way, so the round trip is exact. A boundary in the Content-Type is read as an RFC 9110 parameter (quoted-pair escapes honoured) and must be 1–70 bchars not ending in a space (NoBoundary).
    • filename* (RFC 5987) in UTF-8 or ISO-8859-1 is preferred to filename, as RFC 6266 prefers it; one in another charset or malformed is ignored (falling back to filename, or no filename). RFC 7578 says senders should not use it, so the builder never writes it.
    • Filenames are untrusted and nothing writes them to disk: Part.filename is the sender’s text as given, documented so; the library offers no “save upload” helper that could use it.
    • Limits, MultipartLimits(maxParts = 1000, maxHeaderBytes = 8192, maxBytes = 10485760): a part count (TooManyParts), the bytes of one part’s header block (PartHeadersTooLarge) and the whole body (FormTooLarge), each 413. The body is first bounded by the server’s own maxBodyBytes (1 MiB by default), so maxBytes binds only where a program raises that; it is there so a streaming reader can enforce the same limits. 1000 parts follows common server defaults for form fields and files.
    • Streaming is a later addition, not a change: request bodies are buffered today, so parse takes the whole body; a streaming reader will be a separate entry point (a reader yielding each part’s head and then its body as a stream) beside Multipart.parse, sharing MultipartLimits, FormError and the header and disposition readers, so nothing here changes shape when it comes.
    • The client: withMultipart(form) uses Multipart.newBoundary() (avin- and 32 hex digits from SecureRandom); withMultipart(form, boundary) and encoded(boundary) trap on a boundary RFC 2046 refuses or one a part’s body holds. Both builders replace any Content-Type the request had. Request.header(name) was added beside Response.header.
    • Alternatives weighed: lenient urlencoded decoding as WHATWG (silent corruption); accepting LF line ends in multipart (looser than the RFC, invites ambiguity with binary bodies); RFC 9110 backslash escapes in disposition values (mangles Windows paths browsers send); refusing a malformed filename* (one bad optional parameter failing a whole upload); a form returning a plain vector like queryParams (a Form with value/values reads better in handlers, and pairs keeps the vector). Review with the user: the default limits, and whether a formAs[T] mirroring queryAs[T] is wanted.
  • Settled on the user’s delegation 2026-11-23 (branch avin-log): avin.log, structured logging in the standard library (system library).

    • The central API: a Sendable class Logger, reached as a given. The record functions trace … error(message, fields) are a logger’s methods and also module functions taking using logger: Logger = DefaultLogger; a program declares a given at its module’s top level, and a request’s handler a child as a given of its own block. There is no global logger to set: the default is a fixed val (Info, text, standard error), and configuration is a given, so no module-level mutable state exists and a test’s logger can never leak into another’s. Alternatives weighed: a given only, with no default (every library function logging would demand one of every caller); a settable global default (mutable shared state, and two configurations racing in a test run); a logger passed explicitly everywhere (what contextual parameters exist to remove). Review with the user: the central API, the name of the module functions (log.info(…) reads well, but debug and error imported by name hide the prelude’s debug of a value and read like the Error trait), and whether a settable process-wide default is wanted after all.
    • Laziness by by-name parameters. The message (-> string) and the fields (-> Vector[Field]) are by-name, so a record below the threshold evaluates neither; the threshold is one Level comparison. Measured at -O2, 10 million disabled debug calls with an interpolated message and two fields take about 17 ns each beside 0.4 ns for the bare loop, and 2.8 ns each behind if logger.enabled(Level.Debug): the difference is the two delayed arguments’ closures being made, which the by-name chapter’s representation says live on the caller’s stack where they cannot escape. Alternatives: a closure parameter () -> string (heavier to write at every call), a string built always (the cost a disabled record must not pay), a macro (the language has none).
    • A field is (string, Any): any value can be written without conversion, a number and a bool keep their kind in JSON and anything else is its Display. An Option is not unwrapped: a type pattern cannot match an Option of any element type held in an Any (Option[_] is refused as an open constructor), so a field not known is left out (the access log leaves out an unknown length or address). Alternatives: a union of the JSON kinds (every other value converted by hand at the call); a LogValue trait (an impl for every type a program logs).
    • A logger’s own fields are rendered when it is made, in its format, and held as text, which keeps the logger Sendable (an Any is not) and makes a child free per record. A key written twice, by a child and a record, is written twice rather than replaced.
    • Text lines: RFC 3339 time (Instant‘s display), the upper-case level padded to five columns, the message with its control characters escaped, then key=value with a value or key quoted as a JSON string where it is empty or holds a space, a control character, ", = or \. Colour paints only the level’s name, only where colour is asked and the sink takes it (the standard sinks: a terminal, NO_COLOR unset, TERM not dumb, through sysl.posix.tty).
    • Sinks are a Sendable Sink(write, colours) called once a line with its \n, so one call is one write and lines never interleave, as println keeps them. The file sink appends each line under a lock with the file opened for that line (fs.appendText), rather than holding a File open: an open File belongs to the thread that opened it and traps when another thread writes it, even inside a Mutex; and reopening per line also survives a log rotator moving the file away. A line that cannot be written is dropped: logging never stops the program it reports on. Alternatives: a writer thread owning the file behind a channel (a thread to start and stop, and lines not yet written when the record’s call returns); a File behind a Mutex (refused by the file’s thread ownership, above).
    • The HTTP access log gains an overload accessLog(logger, clock, ids), writing an Info record request with its fields; the sink form is unchanged.
  • File conveniences in avin.fs (branch fs-conveniences). Settled on the user’s delegation 2026-11-23: readLines/lines/writeLines, writeTextAtomic/writeBytesAtomic, a createParents = false argument on every write, removeAll and removeIfExists.

    • Lines end at \n or \r\n; the last line needs no terminator; a final terminator ends the last line rather than starting an empty one (so an empty file has no lines). writeLines always writes \n, so a file it writes ends in a newline.
    • lines(file) answers Result[Lines, IoError]: an open failure is immediate, a read failure mid-stream is the last item. Lines is an iterator and an io.Close. The file closes when the iterator is exhausted or fails; an early stop is close() (defer), and a forgotten one is closed by the collector like any File. Alternatives weighed: closing on garbage collection alone (descriptors held for an unbounded time); a callback form withLines(file, f) (does not compose with iterator adapters).
    • createParents is a default argument rather than twin functions, since the language has default arguments; the default is false, so existing calls are unchanged.
    • Atomic writes: a uniquely named file beside the target (its name from the system layer, unique per call and per process), written, fsynced, closed, and renamed over the target; any failure removes it and leaves the target untouched. The directory itself is not synced after the rename, and the replacement has default permissions rather than the old file’s.
    • removeAll removes a file, a link (never followed) or a tree, and a missing path is NotFound; removeIfExists returns Result[bool, IoError] (Ok(false) for nothing there) rather than a bare bool, since removal can fail for other reasons and a bool would hide them. Review with the user: whether removeAll of a missing path should rather succeed, as removeDirAll does.
  • Settled on the user’s delegation 2026-11-23 (branch fs-walk): avin.fs walks lazily, with options (system library).

    • walker(root, …) is an Iterator[Result[Entry, IoError]], the shape io.inputs already has for a lazy sequence whose steps can fail; each directory is listed (whole, as listDir sorts it) when the walk reaches it. walk(root) keeps its name, result and behaviour and takes the same named options, gathering walker; nothing is deprecated. Alternatives: changing walk to answer the iterator (breaks every caller’s match on its Result), and a separate options value (named, defaulted parameters read as well at the call and need no new type).
    • Options: maxDepth (no limit by default; 0 the root alone; negative fails at the call), includeRoot, postOrder, followLinks, prune, stopOnError. prune is asked about each directory the walk is about to go into, never the root (a hidden or oddly named root would otherwise end a walk before it starts) and never a directory at maxDepth (it would not be gone into anyway); a pruned directory is still an entry.
    • An unreadable directory: reported by default, failing on request. By default it is an entry with the reason in error and the walk goes on, as walk always did; with stopOnError it is an Err, the walk’s last element. A root that cannot be listed is an Err either way. A root that is not a directory is NotADirectory (as walk always answered) unless includeRoot asks for it, when it is the one entry.
    • Following links, a loop is found by canonical path: a link naming a directory whose canonicalize equals that of a directory on the walk’s own way down is an entry carrying Other("file system loop") and is not gone into; stopOnError makes it the Err. Only ancestors count, so two links to one directory are both walked. Device and inode would avoid a realpath per directory, but Metadata does not carry them yet (branch fs-metadata adds them); switching is a change inside Walker with no change to what a program sees. Canonical paths are asked only when followLinks is on. Alternatives: a global visited set (would skip a second link to a directory outside any cycle), a dedicated ErrorKind (adds a variant every exhaustive match of ErrorKind would have to name).
    • Entry keeps its fields; its kind is isDir and isLink, two calls per entry as before. A kind field joins it when Metadata.kind lands. A followed link to a directory has both true.
    • find(root, p, …) answers paths (as glob does), and has a pattern overload matched against relative; it takes the options but includeRoot and postOrder.
    • {a,b} alternation in matches, matcher and glob, written out before the pattern is split into components, so an alternative may hold /, ** and further braces. {a} is a, {} and {,x} have the empty alternative, an unclosed { is literal, as an unclosed [ is, and braces escaped or inside a class are literal. The hidden-name rule applies to each written-out pattern, so {.git,src} fits .git. Alternatives: {a} kept literal (some shells do; no pattern reads better for it), and alternation inside a component only (forbids {src,lib}/**). Review with the user: overlaps the path-helpers item, which also lists {a,b}.
    • matcher(pattern) is a function value reading the pattern once. Alternative: a Glob class; a function value is all a walk filter needs.

Proposed

  • Settled on the user’s delegation 2026-11-23 (branch fs-handle): File has positioned readAt/writeAt, setLength (alias truncate), sync/syncData/fullSync and deleteOnClose. Positioned calls never move the position and hand over or give up what the handle buffered (written bytes are drained, read-ahead dropped), so they mix freely with read and write. readAt loops until max bytes or the end, so a short answer only means the end; writeAt loops over partial writes, so it writes all or answers Err. syncData on macOS is fsync; fullSync is the one that empties the drive’s cache. deleteOnClose is a flag on the handle that close honours by removing the name (a file the collector frees is not removed), built in Avin on remove, with no new Sysl function. Why: positioned I/O is what random-access files, stores and concurrent writers need; one handle per lightweight thread keeps the “a file belongs to the thread that opened it” rule. Alternatives weighed: a Result[long] partial write (every caller would loop); marking at open time (createTemp), which would need a new open variant. Review with the user: whether delete-on-close should instead be an open option once Sysl exposes open_with.

  • Settled on the user’s delegation 2026-11-19 (branch train-ax): inside brackets whose commas separate items a comma after a select‘s one-line arm ends the arm, the select and the item, as it does a match’s, and a select on a block’s last line that closes a bracket ends at that line’s comma. Why: the select chapter says its arms are written as a match’s are, and with the 2026-11-19 rule that a block’s last line ends at its comma the old reading (the comma list a tuple the arm yields) no longer parsed at all, failing select_readable_custom; the rule makes f(select … -> v, x) mean what f(m match … -> v, x) means. Alternatives: keeping the tuple reading for select alone (one construct reading commas unlike its sibling); an error asking for parentheses either way. It changes code that compiled before: println(select … -> "up", made) printed a tuple and now passes two arguments, so that test writes println((select … -> "up", made)). Review with the user: it changes the meaning of code that compiled before.

  • Settled on the user’s delegation 2026-11-18 (built on branch tls-strand): a read of a whole TlsStream that has to wait for input while part of a record a writeSome made is still unsent waits for input OR room, whichever comes first, and sends that rest as room comes; its wait keeps the connection’s time limit (TimedOut where it runs out, the unsent rest kept in order for the next read or write). TcpStream gains timeout -> Duration, the limit setTimeout set, which that wait needs since the limit may have been set on the TCP connection before TLS began (spec system-library.md, TCP and TLS). This settles the review question of the pg-flake-0032 entry below. Why: a whole connection’s writeSome that sent part of a record left the rest for its next write, writable() or close, so a caller that ended a request with writeSome and then only read left its peer waiting for the rest while it waited for the peer’s answer, a hang until the time limit. The one wait cannot be for room alone, since a peer that is itself sending and not reading would then never be read from (two full connections, each end waiting to write); it cannot be for input alone, which is the hang. A select over the TCP connection’s readable() and writable() waits for both on the one thread that owns the connection; the runtime’s poller keeps one waiter per descriptor and direction, and an unsplit connection has only this thread, so the two watches never meet another waiter (the obstacle that ruled this out for a split connection’s reader). Alternatives weighed: a whole connection’s writeSome sending its whole record as the split writer’s now does (it would break “after writable() answered true, writeSome does not wait”, which single-threaded select loops rely on, and could deadlock one thread reading and writing a busy peer); flushing the rest in full before a read waits (the same deadlock, the read waiting for room while the peer waits for room too); a flush the caller must call (every caller, a generic StreamWriter one included, would have to know it). Not covered: a program that, after a writeSome left a rest, waits in a select with only a readable() arm on the connection; a select watches one direction per arm, so such a loop keeps a writable() arm while writable() answers false, as the threads chapter’s write loop does. Review with the user: whether that select case deserves more (a readable() that also sends what room allows).

  • Settled on the user’s delegation 2026-11-18 (built on branch pg-flake-0032): the writing half of a split TLS connection sends the whole record each writeSome makes before it answers, waiting for room for the rest where the connection has too little, refining the 2026-11-15 writeSome entry for that half (spec system-library.md, TLS). Why: a writeSome that kept the rest of its record for a later call left it unsent where the writer made no later call, and its peer waited for that rest for ever. pg’s batch writer hit exactly this: its thread sends a batch with the writable() and writeSome loop the threads chapter shows, then ends; when the last writeSome met a full connection, the end of the batch never left, the server waited for it, and the reader waited for the server (about one TLS batch in ten under load). A split writer has a thread of its own and its reading half reads meanwhile, so waiting there cannot hold up the peer’s answers, which is the deadlock the 2026-11-15 entry avoided by never waiting. Where the writer’s time limit runs out first, writeSome still answers the plaintext TLS took (it has been taken and will go), the rest kept to go before anything else and writable() sending it as room comes, as before. With it, ciphertext a wait that failed did not send is kept in order rather than dropped, on both the connection and its halves (a timed-out write used to lose the part of a record it had begun, breaking the TLS session). Unchanged: a whole TlsStream‘s writeSome still never waits after writable(), since one thread may be both reading and writing it; its kept rest goes at the connection’s next write, writable() or close. Alternatives weighed: the reading half sending the kept rest while it waits for input (it would wait for room on the descriptor the writer’s select watches, and the runtime’s poller keeps one waiter a direction, so one of them would never be woken); a flush the caller must call after its last writeSome (every caller would have to know it, and a generic StreamWriter caller cannot); a low-water mark of a whole record on the socket so a record always fits after writable() (not settable on every system); the whole connection’s writeSome waiting too (a single thread reading and writing a busy peer could deadlock). Its review question, whether a whole TlsStream‘s kept rest should also go while a read waits, is settled by the tls-strand entry above: it does.

  • Settled on the user’s delegation 2026-11-17 (built on branch println-atomic): println(x) and print(x) render all their arguments (and println its new line) first, into a string, and add that to standard output in ONE write, so a line printed is never split by another thread’s output (spec system-library.md, beside eprintln‘s same promise). Found when two threads’ println(99) came out 9999\n\n: println wrote each value and then the new line as separate writes. The one write is a single fwrite on the C stream, which holds the stream’s lock for the whole call, so another thread’s write lands before or after it and a flush sends it out whole, in order, however long it is. Rendering happens before the write, outside any lock, so a value slow or large to render holds no other thread up. Consequences: a value rendered for println is now built as a string first (one allocation and copy per call; the digits of println(n) no longer go out from the stack); a Display that itself prints puts its own output before the line rather than inside it, and one that traps part way leaves none of the line rather than a part. Output built from several calls, or written to StandardOutput piece by piece, is still several pieces. Alternatives weighed: hold the stream’s lock across the whole render (a slow render, or one that parks the thread or waits on a collection, would stall every printing thread, and a Display that prints would deadlock); keep separate writes and promise nothing (the spec already promises whole lines for standard error, and interleaved lines from threads are the commonest complaint); a per-thread line buffer in the runtime (more machinery for the same guarantee). Review with the user: only if the extra allocation per println shows up in a benchmark that prints heavily.

  • Settled on the user’s delegation 2026-11-15 (built on branch opaque-types): opaque types are spelled opaque type Name[T…] = Repr at the top level, opaque a declaration word only before type and a name. Why: an opaque type reads as the alias it resembles, with one word saying the difference, and the parser and formatter treat it as an alias. Alternatives weighed: newtype Name = Repr (a new keyword for a small feature); data Name(value: Repr) with an annotation (a data value is an object, and the layout is the point); type Name = new Repr (a modifier inside the body reads as part of the type).

  • Settled on the user’s delegation 2026-11-15 (built on branch opaque-types): the representation is seen only in the declaring module, through Name(r) and x.repr (and bare repr in its impls), with no implicit conversion either way even inside the module. Why: an explicit wrap and unwrap keep every crossing between the type and its representation visible in the source, which is what the type exists for, and one rule holds everywhere; repr is one short name that cannot be confused with a field of the representation. Alternatives weighed: the type transparent inside its module (the module’s own code could mix UserId and long unnoticed, and the type checker would need two views of every type); a .value accessor (a common field name of representations, so it would shadow or be shadowed); an unwrapping pattern Name(n) (it reads as a constructor pattern of a data type, which an opaque type is not, and x.repr covers it). Review with the user: whether the module that declares the type should see it as its representation.

  • Settled on the user’s delegation 2026-11-15 (built on branch opaque-types): an opaque type is nominal, Type.Opaque(id, name, args, repr), a value type that is boxed only where it becomes an Any or a trait’s value, and its box names the opaque type over a reference too. Its parameters are invariant and take no bounds; a phantom parameter is allowed. The representation may not be Nothing, unit, a union, a bare type parameter or name the type. Why: laid out as its representation, a Vector[UserId] holds the longs themselves and the type costs nothing; a box naming the opaque type is what lets x: Any be matched as UserId and never as long or string, so the abstraction holds through Any. Variance would expose the representation’s own variance, which only the module sees; bounds have nothing to bound, since the representation’s types hold their own. Nothing, unit, unions and a bare parameter have no single layout to share. Alternatives weighed: reusing the representation’s box for a reference representation (cheaper, but x is _: string would find an Email); covariant parameters (unsound for a mutable representation); refusing phantom parameters as an alias does (they are a main use: typed identifiers).

  • Settled on the user’s delegation 2026-11-15 (built on branch opaque-types): an opaque type is no type constructor: a generic one is refused for a constructor parameter F[_], and an opaque type declares no constructor parameter of its own; it is an ordinary type argument of F[A]. Why: every instance of a constructor parameter’s application is laid out as an object, which an opaque type over long is not, and a representation F[int] would leave the opaque type’s layout to each use. Refusing both is the sound position that can be loosened later. Alternatives weighed: accepting an opaque type over a reference type as a constructor (sound for the layout, but it would make the rule depend on the representation, which outside code should not see); accepting opaque type W[F[_]] (the layout question is only deferred, to every use).

  • Settled on the user’s delegation 2026-11-15 (built on branch opaque-types): a refined variant’s result does not name an opaque type (Newest -> Query[UserId], Query[Id[User]], Query[Vector[UserId]] are refused); a variant’s fields may be of opaque types and the type’s own argument may be one. Why: a match on a refined variant will learn type equalities from the result, and whether one learning R = UserId should see the representation inside the opaque type’s module is not decided; keeping opaque types out of results is sound and can be loosened once matching on refined variants is built. Alternatives weighed: accepting them as nominal types now (sound for values and layouts, but it fixes the answer to the open question before the matching it affects exists).

  • Settled on the user’s delegation 2026-11-15 (built on branch opaque-types): equality and hashing are the representation’s; every other trait comes from an impl, which takes the trait’s default bodies; an opaque type derives nothing and has no supertype. Why: every Avin type has == and a hash, so an opaque type is a Map key and a Set element without ceremony, while order and printing are choices the module makes for its type (an Email may print as <…>, a UserId may have no order). Default bodies run on the boxed value, so compare gives <, less, max and sorting. Alternatives weighed: derives Ord, Display forwarding to the representation (convenient, but it would show the representation’s text and order outside the module by default); inheriting every trait of the representation (the opaque type would leak its representation’s whole interface).

  • Settled on the user’s delegation 2026-11-15 (branch dwarf): -g is asked for, never implied, and only build and emit-llvm take it. Not even -O0 turns it on. Why: a -g build is slower and larger (every unit carries the metadata, function text is never cached, macOS runs dsymutil), and run/test executables live in the cache where no one points a debugger; a flag keeps every existing build exactly as it was. Alternatives: -O0 implying -g (the usual “debug build”; costs every -O0 corpus and test build), run -g/test -g (useful for a test under lldb, but the cached executable is not where a user expects it; easy to add later). Review with the user: whether -O0 should mean “debug build”.

  • Settled on the user’s delegation 2026-11-15 (branch dwarf): what the debugger is told. Functions are named by their symbols (<program>.fact, <program>.twice[int], <program>.main.lambda#1) as the linkage name, with the program’s own module prefix left off the readable name; lldb shows the linkage name. The compile unit says DW_LANG_C, so lldb reads the basic types in its own words (double, char32_t). char is a UTF-32 code point, byte unsigned, bool a byte; a reference is a pointer to an opaque structure named by its Avin type. A local a lambda shares (boxed) is not described, nor is a local the compiler made. DWARF version 4. Why: each is the smallest choice that makes b, bt and frame variable work with no lldb plugin. Alternatives: a vendor language code (lldb then treats frames as unknown language), describing objects’ fields as DWARF structures (a larger item: layouts per descriptor, unions, generics), showing strings as text (needs an lldb data formatter shipped with avin), describing boxed locals through DW_OP_deref (small, later).

  • Settled on the user’s delegation 2026-11-15 (branch dwarf): the code taking parameters in has no line, so lldb’s breakpoint at a function’s first line lands after the parameters are stored where their variables are read (a lambda’s parameter otherwise read a stale slot). A call there still gets the function’s own location, which LLVM’s verifier asks of every call in a function with debug information. Alternative: placing that code at the function’s name, as it was first built: lldb then stopped before the stores and showed the slot’s previous value.

  • Settled on the user’s delegation 2026-11-15 (branch dwarf): a -g build never reads or writes function text in the instance cache, and keeps its lowered code apart (program-O2-g); each Locate in a cached entry is kept counted from its declaration’s start, as trap sites are. Why: metadata is numbered across the module and locations follow lines no function key covers, so cached text would carry stale lines; the lowered code is still reused, and AVIN_INCREMENTAL=verify matches a clean build. Alternatives: per-function metadata numbering with a renumbering pass (the text cache would then work under -g), or a key over absolute positions (every edit above a function would relower it).

  • Settled on the user’s delegation 2026-11-15 (branch dwarf): codegen units carry all of the module’s debug metadata, as every other module-level line, so any line moved anywhere changes every unit’s text and recompiles every unit of a -g build. Plan to do better when it matters: the splitter follows !N references from each unit’s definitions through the metadata lines and renders only the nodes reached (plus the compile unit and the flags), which also shrinks each unit.

  • Settled on the user’s delegation 2026-11-15 (branch dwarf): the stack overflow report stays without a place. The handler runs on its own stack inside a signal, where reading DWARF (or running atos, a process) is not safe, and a build without -g has no line table at all. Plan: in a -g build the handler writes the faulting program counter and the image’s load address (avin: trap: stack overflow at pc 0x… (image 0x…)), and avin (or a user with atos -o prog.dSYM -l <image> <pc>) turns it into file:line after the process has stopped; a table of function start addresses with their names, emitted as a constant, would let the handler name the function itself, without lines, at any -g level. Neither is built: the first needs a runtime change and a symbolizing step, the second a table the emitter does not make yet.

  • A package’s tests import its gated modules; a test module is read only while every module it imports is (packages; branch gated-tests). The tests were fenced as an always-compiled module, so a test of a gated module had to live inside that module, and a tests file importing it was refused even under avin test, which turns every feature on. Now tests and the modules under it have no fences: they may import every module of the package and its optional dependencies. A build with a feature off passes over each test module importing a module that is off, and, repeated to the end, each test module importing one passed over; the rest are read and run. The module stays the unit, so a file of tests importing a gated module takes all of tests with it when that feature is off. Why: the spec already says avin test has every feature on, so the tests see the whole package; and the package’s own tests are compiled by build and run too, so a selection-independent refusal was the only thing keeping a build with features off working; deriving each test module’s gate from its imports keeps that guarantee with no annotation to write. Alternatives: allowing tests to import gated modules only under avin test (a build or avin test --no-default-features would then fail at the import, so the minimal configuration could not be tested); letting a feature list tests.server explicitly (works, but repeats in the manifest what the imports already say); skipping single files rather than modules (finer, but a file of tests could then lose a helper another file of it uses, breaking only the build with the feature off). Not covered: a test importing an optional dependency’s module directly while that dependency is not taken is reported as an unknown module, since a dependency not taken is not read and its modules are unknown; such a test reaches the dependency through the package’s gated module. Review with the user: whether a test module passed over should be named in avin test‘s output rather than silently absent.

  • An import refused for its module is one error per import declaration, not one per name it imports (branch gated-tests): import a.b.{c, d} refused as gated, as an optional dependency’s, or as a standard-library module that does not exist, is reported once, at the first name; two import lines are two errors. Why: the error is about the module, which the declaration names once. Alternatives: one per module per file (hides the second line’s error).

  • Settled on the user’s delegation 2026-11-15 (built on branch intersection-bounds): several bounds on one type parameter are joined with &, the one spelling, and an intersection is a bound only, never a type. [T: Ord & Display] replaces [T: Ord + Display] everywhere type parameters are declared (functions, methods, classes, data types, traits, actors, impl headers, after a lower bound); + between bounds is a parse error that says to write &, and the library, tests and docs are rewritten. Each operand is a trait or a class, at most one a class (a second class is an error naming both, a subclass of the first included), and each written once (the same trait at the same type arguments twice is an error; Make[int] & Make[long] are two). Name clashes: methods of one name from two bounds are overloads, resolved by parameter types; two of the same parameter types are not an error to declare, only a call both accept is, as the existing ambiguous-call error at the generic definition. A & B is not a type: written as a parameter’s, a field’s, a val‘s, a result’s, a type argument’s or a lower bound’s type it is a parse error that shows [T: A & B](x: T) instead. Why: & reads as “and”, which is what conformance to every bound means, and makes the bound read as the intersection it is, where + reads as arithmetic and was the only use of + in a type; one spelling, since two ways to write one thing is the kind of choice the language avoids. Bounds only, because a type parameter already gives a value of two traits everything an intersection type would, with each instance calling its type argument’s methods directly; an intersection type would need a new value representation (a pair of method tables, or a table per combination), subtyping rules against unions and variance, and reification for is — a large addition the language’s programs have not asked for, and a nominal type system with declared traits covers it by declaring a trait that requires both (trait Shown: Named, Sized). At most one class, because a class extends one superclass, so two unrelated classes can never both be met and a subclass already implies its superclass. Alternatives weighed: keeping + (the existing spelling, no source change, but reads as addition, and the user asked for &); accepting both (two spellings of one thing); intersection types in annotations, with A & B <: A, commutativity, distribution over unions and a dual-table layout (left out for the reasons above; this decision leaves room to add it, since A & B in a type position is an error today, not something else); allowing redundant bounds silently (a repeated bound is always a slip). Review with the user: whether A & B should become a type in annotations later, and whether to keep the + diagnostic once existing code has moved (it costs nothing and helps code written before the change). Packages outside this repository that still write + (the json package’s tests) move to & with the release that carries this.

Byte offsets inside a character (types, branch fix-charat-boundary)

  • Settled on the user’s delegation 2026-11-15: charAt at an offset inside a character’s encoding traps, charAt offset is not a character boundary, as slicing there does; the searches never trap on such an offset and never answer one. indexOf(p, from) and indexWhere(f, from) from inside a character start at the next one, so "café".indexOf("", 4) is 5; lastIndexOf(p, end) and lastIndexWhere(f, end) from inside one search back from the character it belongs to, so "café".lastIndexOf("", 4) is 3; and startsWith("", at) is false inside a character, since the empty string occurs only where a character begins or at the end. Why: charAt and slice read the text at the offset given, so an offset that is not a place in the text is the caller’s mistake, the trap the spec gives slicing; a search is asked “where at or after (before) this”, which has an exact answer from any offset, and answering only offsets where a character begins means every result can be fed to charAt or slice again. The cost on a character boundary is one comparison on a lead byte, none on ASCII. Alternatives weighed: trapping in the searches too (a search from i + 1 over text with characters beyond ASCII would then trap where the same search over ASCII succeeds); answering the offset itself for an empty needle, as before (a result that traps when sliced at).

Initialization (declarations, branch init-design)

  • Settled on the user’s delegation 2026-11-15 (built on branch deadlock-dump): A deadlock of the whole program is a trap; a partial one is not found (diagnostics). The main thread checks when it begins a wait with no limit, and again each time a worker finds no lightweight thread running or ready while it waits: the program is deadlocked where no lightweight thread is running or ready, no timer is set, no thread waits on a socket, no thread the program did not start is attached and no @threaded callback is held. Every wake goes through one counter, so a check whose count did not move between its first look and its last saw one moment of the program and cannot report a thread that ran meanwhile. The report is avin: trap: deadlock: all threads are waiting and a line per thread, the trap’s exit status, and the exit hooks run after it as after any trap. Why: it is the case a program can never leave, it costs nothing until main waits (one counter increment per wake, one clock read per wait for the dump), and a check made only from main‘s own wait needs no thread of its own. Alternatives weighed: a monitor that looks periodically (a thread or a tick for every program, and latency); finding cycles of lock holders (catches partial deadlocks, but needs owner tracking on every lock and misses channels and conditions, which have no owner); reporting a held @threaded callback or an attached foreign thread as deadlocked too (a C thread may call back at any time, so that would be a false report). Review with the user: whether a partial deadlock, found by cycles among lock holders and joins, is wanted later.

  • Settled on the user’s delegation 2026-11-15 (branch deadlock-dump): What a thread waits on is named by the runtime’s own queue: a lock, a condition, a join, a sleep, a socket; a condition the library makes for a channel’s receive or send, a future or an executor’s work says so, through the intrinsic condition_new_kind, which Condition‘s constructor reaches with a second parameter the library alone can pass (a Condition needs the library’s private Lock). A channel’s own lock is “a lock”. Threads are numbered from 1 in the order they started, not by their identity. A pool’s idle workers are left out of the deadlock report, whose length would otherwise follow the machine’s processors, and listed in the dump. Alternatives weighed: a label set around each wait by the library (a call on every wait); naming waits only by the runtime primitive (“a condition” for every channel and future, which says little).

  • Settled on the user’s delegation 2026-11-15 (branch deadlock-dump): The quit signal writes a thread dump and the program goes on. A handler in C writes a byte to a pipe; a thread started with the program, with every signal blocked, reads it and writes the dump, since a handler may not take the scheduler’s locks. A program that watches the signal hears it instead; one started with it ignored keeps it ignored. Why: the program under inspection keeps running, which is what a dump is for. Alternatives weighed: writing the dump from the handler (not safe there); starting the thread only on first use (a handler cannot start one); ending the program after the dump (loses the program being looked at). Cost: one thread and one pipe for every program.

  • Settled on the user’s delegation 2026-11-15 (branch deadlock-dump): A thread dump names no functions. A frame of the shadow stack holds its previous frame and its count of slots, nothing naming its function, and walking the native stack would need a table from code addresses to Avin names, which the compiler does not emit (the stack-overflow trap has no place for the same reason). Alternatives weighed: a function’s descriptor stored in each frame (a store on every call); emitting an address table and unwinding the native stack (a table per program and an unwinder for each platform). Review with the user: which of the two, if a stack in the dump is wanted.

  • Settled on the user’s delegation 2026-11-15 (branch deadlock-dump): A corpus program’s // stderr: times vary shows every number before ms in its standard error as n, so a thread dump’s durations do not make the test depend on the machine. Alternative: a dump without durations (loses what a dump is for).

  • CPU time is read from the kernel’s accounting: getrusage and wait4 (branch cpu-time, CPU time). CpuTime(user: Duration, system: Duration) with total and Add; process.cpuTime() and process.childrenCpuTime() (RUSAGE_SELF, RUSAGE_CHILDREN) answer it plainly, not in a Result, since getrusage fails only for a who it does not know; waitPidCpu / tryWaitPidCpu beside waitPid / tryWaitPid; and Child.cpuTime(), a pipeline’s stages and a sequence’s parts added. Why: a job manager that samples its jobs with ps cannot see the CPU of sub-processes that have already exited, and the kernel folds each reaped process’s time into its parent’s, so a wait that reads it gives a whole tree’s. Alternatives weighed: changing waitPid to answer the pair (breaks every caller; a return type cannot be overloaded); a ProcessUsage record with the other rusage counters (peak memory, faults, context switches — memory is in different units per platform, and nothing asks for them yet, so they can join later without breaking CpuTime); Child.cpuTime() as an Option empty before the wait (a running command’s reaped parts would then be invisible, and “nothing reaped yet” is already Zero). Review with the user: the names waitPidCpu / tryWaitPidCpu.

  • A started program is reaped by the library with wait4, not by its Sysl Spawned (branch cpu-time). Sysl’s Spawned.wait and try_wait reap with waitpid and drop the usage, so the runtime (runtime/avin/rt/cpu.sysl) reaps the program itself and the Spawned is then let go of with detach. A time limit is kept by the library in consequence, as Sysl kept it: polled with a backoff to 16 ms up to the deadline, then signal 15, a 200 ms grace, signal 9, and a final wait, the status TimedOut with the CPU time it used. Why: the alternative that keeps Sysl as the reaper, reading RUSAGE_CHILDREN before and after a wait, is wrong whenever two threads reap at once, which a job manager’s do. Alternatives weighed: asking Sysl for a wait that answers usage (the better home; reported to the sysl session as a gap, and this binding moves to it when it exists); reaping through Sysl and leaving cpuTime() empty for commands (no answer to the item). Review with the user: two reapers of one kind in the stack until Sysl grows the call.

  • Initialization is proved at compile time, by order and by withholding self (branch init-design, Initialization). No field, module-level value or lazy val is read before it is set: an object’s fields are set in the order written and self is withheld from everything that could read one later until the last is set; module values are computed in the order their initializers’ reach requires, a cycle an error; a lazy val is the explicit opt-out, its own cycles an error where its code reaches them, a trap only through a function it hands on. Why: it is sound with no annotation and no cost per read, it keeps the rules Avin already enforces (every probe of them held), and each rule’s proof is a short argument a reader can check. Alternatives weighed: a checker of object states (an object cold, then warm, then hot, a parameter or a method declared to accept a cold object) accepts more, such as passing a half-made object to a helper that only stores it, but needs those annotations and a far larger analysis, and the code it would admit is rare; a default value in every field before its initializer (a wrong value read silently, and Avin has no value every type can hold); a check on every field read (a cost on every read, and a trap where an error was possible); ordering modules by their imports (an import cycle would be an error, or the order a guess); making every module value lazy (a gate on every read, and cycles found only when they run).

  • A superclass’s arguments use nothing of the object, functions made there included (branch init-design). A lambda, an argument passed by name, a local function or a method value in them that uses a field, a method or self is an error; class parameters and module values are read freely. Why: avin 0.0.21 lets such a function through, and a superclass calling it in its body reads a field before it is set: 0 for a number, a crash for a string, a vector or a generic field (a soundness hole, the build plan’s first item). Alternatives weighed: allowing a function that reads only inherited fields of a class whose constructor finished before (it needs the superclass chain’s timing at each read, for code no library or example writes); a mark on a parameter the constructor may call during construction (an annotation for a rare shape).

  • An object’s own name in its body is self (branch init-design). O.k obeys the rule k does; in a method, a lambda made after the last field or a lazy initializer, it makes the object need nothing more. Why: today the name counts as the module value, so a lazy field or a late lambda naming its own object is refused as a cycle while the bare name is accepted, a false error with no unsoundness behind it. Alternatives weighed: keeping the refusal (sound, but the two spellings of one read disagree); counting only code the body runs (the same result, reached by the module order rather than by the object rules, which then speak of the name twice).

  • A lazy val cycle its own code reaches is a compile error; a read through a handed-on function traps (branch init-design). The reach is the module order’s (calls, every implementation a dispatched call or an operator may reach, other lazy values’ initializers), without the lambdas, by-name arguments and method values the initializer makes; for a field, only reads of the same object (bare name, self., methods called on self) count. Why: a cycle the code always makes is found where it is written rather than when it runs, while a value referring to itself through a function it hands on (lazy val ones = LazyList.cons(1, ones), a handler naming its button) is the reason lazy exists and stays legal; a reach that followed handed-on functions would refuse those, and one through another instance’s field would refuse recursion over a structure (a node’s depth). Alternatives weighed: the trap alone (today’s: a cycle anyone could see waits for a run to reach it); following every function value to every lambda of its type in the program (sound without a trap, but it refuses the knots and the handlers). Review with the user: through dispatch the reach counts every override, so a lazy value calling a trait method one of whose implementations reads the value is refused even where that implementation never runs, as module values already are.

  • Settled on the user’s delegation 2026-11-14 (branch init-3): the module-level part of the lazy val rule, and making a lazy field needs nothing. Uses keeps the functions code calls (with every implementation a call through a method table or an operator may reach, and the initializers of the lazy values it reads) apart from those it makes; the lazy reach follows only the first, stopping at another module-level lazy value’s initializer and naming that value, so the error is the `lazy val` `first` needs its own value to initialize: `first` → `second` → `first` , a value on its own as `l` → `l`, reported from the chain’s earliest-declared member, and a value that only reaches a chain is not named. The module order still follows both, except a lazy val field’s initializer where a constructor makes it: only a read of the field runs it, and every read is a call of it, which the order follows. Why: it follows from the chapter (the order needs what the body runs while the object is made), and it removes a false cycle — two objects whose lazy fields read each other, or a module value holding an object whose lazy field reads that value, were refused. Alternatives weighed: the self-cycle worded as the module order’s (is needed by its own initializer), which would give one rule two shapes of message; dropping every made function from the order (unsound: a lambda the initializer makes and calls reads what it reads).

  • Settled on the user’s delegation 2026-11-14 (branch init-4): the field and local parts of the lazy val rule. A field’s initializer is followed with the object located where its code holds it: the class body’s self it captures, a local given it (val me = self), the parameter a called function or method receives it in, and, for an object, every read through the object’s name anywhere in the program. A call through a method table on the object reaches the override of every class descending from the one declaring the field; an operator applied to it, the core trait method of those classes; a local function, the object where its caller sees it. A read of the same field of the object is a node of the chain, a read of another instance’s is not followed, and the chain, worded and placed as the module-level one, names lazy fields only. A local lazy val is followed through its block’s code and the local functions it calls, the other local lazy values it reads being the chain’s nodes. A cycle through a module-level lazy value that reads an object’s field is the module-level value’s cycle as well and is reported for both. Why: it follows from the chapter’s “only a read of the same object counts”, which a function given self or a read through an object’s one name is as much as a method called on self; anything less leaves the same cycle to the run-time trap by a change of spelling. Alternatives weighed: only bare names, self. and methods called on self (the chapter’s examples, but helper(self) would then trap at run time); following every value of the object’s class (it would refuse the recursion over a structure, a node’s depth, that the chapter keeps legal).

  • A lazy initializer waiting for a thread that reads the same value is not detected (branch init-design). It waits for ever, as threads waiting for one another do (threads). Why: Avin detects no deadlock but a lock taken twice, and a cycle through two lazy values’ own code is now a compile error, which leaves only a read through a function handed to the other thread. Alternative weighed: the runtime following a waiting read through the initializing thread’s own wait (a join, another lazy value) and trapping when the chain returns to the reader, cheap on the slow path. Review with the user: it is liveness, not soundness, but it is the one way a lazy read can still hang.

The security primitives an API server needs (branch security; avin.encoding, avin.crypto, avin.random)

  • Settled on the user’s delegation 2026-11-15: a new module avin.encoding holds hexadecimal, base64 and base64url (toHex, fromHex, toBase64, fromBase64, toBase64Url, fromBase64Url, DecodeError), and toHex moved there from avin.crypto, which keeps offering it with export avin.encoding.toHex, so import avin.crypto.toHex still works. Why: base64 is not cryptography (data URLs, Basic authentication, binary in JSON all use it), and hexadecimal in one module and its decoder in another would split one encoding. Alternatives weighed: everything in avin.crypto (one import for a server, but a module named for secrets would hold plain encodings); fromHex beside toHex in avin.crypto and base64 alone in avin.encoding (hexadecimal split across two modules).
  • Settled on the user’s delegation 2026-11-15: decoding is strict, one function per alphabet: fromBase64 takes only the standard alphabet with its = padding, fromBase64Url only the URL-safe one with no =; whitespace and line breaks are refused, and so is a last digit whose unused bits are not zero (RFC 4648 §3.5 allows a decoder to refuse it). Each byte sequence then has exactly one spelling, so a token or a signature cannot be sent in a second form that compares unequal as text but decodes equal. fromHex takes either case (a digit’s case carries no bits). Errors are checked in order: characters, then padding, then length, then unused bits, so the first offset named is the first character wrong. Why: the module exists for an API server reading untrusted text, where malleability is a defect. Alternatives weighed: Sysl’s forgiving decoder (either alphabet, optional padding, unused bits ignored), which is friendlier to sloppy writers but accepts many spellings of one value; a lenient flag (two behaviours to test and document for no current need). Review with the user: a reader of MIME-wrapped base64 must strip its line breaks first.
  • Settled on the user’s delegation 2026-11-15: DecodeError has four cases, BadCharacter(at), BadPadding(at), Truncated(at) (where at is the text’s length) and UnusedBits(at), all byte offsets, and is an Error. Why: the cases are what a caller would report differently, as UrlError‘s are; Truncated carries the length so every case has a position. Alternative weighed: binding Sysl’s DecodeError, whose BadLength has no position and whose Short and Utf8 cannot occur here.
  • Settled on the user’s delegation 2026-11-15: the encoders are written in Avin, while the digests stay bound to Sysl. Why: Avin’s decoder is stricter than Sysl’s (above), and encoding is a few lines of byte arithmetic with no platform behind it. Alternative weighed: binding sysl.encoding‘s encoders and writing only the checks in Avin (two passes over the text, and a second implementation of the alphabet anyway).
  • Settled on the user’s delegation 2026-11-23: avin.encoding gains base32 (RFC 4648 alphabet A–Z, 2–7): toBase32 (padded with = to a multiple of eight), toBase32Unpadded, toBase32Lower (lower case, no padding), each over a Vector[byte] or a string, and one fromBase32. The decoder reads either case (also mixed) and padded or unpadded text, because a digit’s case and a trailing = carry no bits; it stays strict otherwise, with the same DecodeError cases and check order as base64: a padded text needs the right count of = (Truncated when the length is not a multiple of eight, BadPadding for a misplaced = or more than six), an unpadded one must end on 0, 2, 4, 5 or 7 digits past a multiple of eight (Truncated otherwise), and a last digit with unused bits set is UnusedBits. Why: marshal writes a 128-bit token as 26 lower-case characters (toBase32Lower), and a token read back from a case-folding source (a URL host, a file name) must still decode. Alternatives weighed: an options argument or default arguments for case and padding (the base64 family has one function per spelling, and fromBase64Url shows the unpadded form as its own name); four encoders (padded lower case has no user); a decoder strict about case (a token typed or lower-cased in transit would fail for no gain in uniqueness a caller relies on). Review with the user: base32 decoding is therefore not one-spelling-per-value as base64’s is (case and padding vary).
  • Settled on the user’s delegation 2026-11-15: constantTimeEquals(a, b) in avin.crypto, for Vector[byte] and for string (compared as UTF-8 bytes, so "é" and "e\u{301}" differ), bound to Sysl’s sysl.crypto.verify, which reads every byte and branches only on the lengths. Why: Sysl pins that function’s branch-free code with its own codegen tests, which an Avin loop would not have; different lengths answering false at once leaks only a length, which a token’s or a tag’s is not secret. Alternatives weighed: an Avin loop accumulating xors (its constant time would rest on the optimizer); a method on Vector[byte] (a security property should be found where the secrets are).
  • Settled on the user’s delegation 2026-11-15: SecureRandom, an object in avin.random, with Random‘s drawing methods (nextBytes, nextInt, nextLong, both bounded, between for int and long, nextReal, nextBoolean, alphanumeric, shuffle, choose) and two token functions, hexToken(byteCount = 32) and urlToken(byteCount = 32). Every draw reads getentropy through Sysl’s sysl.posix.rand.entropy_from_os, which is on macOS, glibc Linux and the BSDs and loops past the 256-byte request limit. A refusal from the operating system traps. Why: one name beside Random is found by whoever reads that module’s warning; an object, not a class, because there is no seed and no state; trapping because a program wanting key material has no safe fallback. 32 bytes is 256 bits, past any guessing. nextGaussian, chooseWeighted and setSeed are left out: no secret is drawn from a normal or weighted distribution, and there is no seed. Alternatives weighed: a class SecureRandom() sharing a trait with Random (an instance holds nothing, and the trait would add a dispatch to every PCG draw); a buffered pool of entropy (fewer system calls, but secret bytes kept in the heap and a lock); secureBytes and token functions in avin.crypto (randomness split across two modules); Result instead of a trap (a caller of nextInt would match on every draw).

Refined variants (chapter, branch gadt-design; designed, not built)

  • Spelling: a variant’s result after ->, its own type parameters after its name. IntLit(value: int) -> Expr[int], Balance -> Query[long], Pair[A, B](…) -> Expr[(A, B)]; the data type’s parameter names are every variant’s parameters, so a variant with no result keeps meaning -> D[T…]. Why: a variant is a constructor, and (fields) -> Type is exactly how Avin writes a function’s signature, so the line reads as the constructor it declares; nothing else is written after a variant’s fields. Alternatives weighed: IntLit(value: int): Expr[int] (: already types each field on the same line and begins an inheritance list, which a variant is not); a where T = int clause (names the equality instead of the instance, and needs a second syntax for hidden parameters); a separate keyword per refined variant (a second kind of variant where there is one with an optional result).

  • A variant fixes only invariant parameters. Where the type’s parameter is +T or -T, a variant’s result has T there. Why: an invariant argument is exact, so the equality an arm learns is true; a covariant one is an upper bound, and taking it as an equality is unsound (the chapter’s asDog makes a cat a Dog). Alternatives weighed: refining a covariant place by a bound (Dog <: T) and a contravariant one by the opposite bound (sound, but it gives one-directional facts that are hard to read in an error, and no motivating example needs it); forbidding variance on any type with a refined variant (needlessly strict: unfixed places keep their variance soundly). Review with the user: whether bound refinement at variance places is wanted later.

  • Hidden type parameters are allowed, and compiled per pack. A variant parameter its result does not name is a fresh type in each arm, never leaving it; each list of hidden types the program makes a variant with has its own descriptor, and an arm on it is compiled once per pack and selected by the descriptor. Why: a typed protocol (a request and its reply address agreeing on a type the message type does not mention) and a chained plan (Then[Mid]) need one, and the whole-program compiler already knows every pack, as it knows every implementer of a trait for dynamic generic methods, so nothing is boxed and the value-type fields stay unboxed. Alternatives weighed: refusing hidden parameters (the protocol could then only erase R behind a trait, losing the type the design exists to keep); boxing a hidden field behind Any (a run-time test where none is needed). Review with the user: code size, since an arm is copied per pack.

  • Equalities hold exactly where the pattern’s names are in scope, and nowhere outside. An arm’s result is checked against the expected type under them; with none expected, arms yield their types as written; an inference variable settled in an arm settles to the type as written; a hidden type in an arm’s result is an error. Why: a fact true only in the arm cannot leak to code that runs without it, and “as written” is the one reading that does not guess whether an int was meant as T. Alternatives weighed: mapping an arm’s type back through its equalities (ambiguous: int and T are one type there and two outside); inferring the result type of a refining match (needs a search the local inference does not do).

  • Only variants refine. Extractors and type patterns learn no equalities. Why: an extractor’s answer type is its signature’s; a type pattern’s could refine an invariant generic’s arguments by the same header argument, but it widens the feature to every generic type and every type test. Alternative weighed: refining by type patterns on invariant instances (sound; deferred). Review with the user.

  • A union in a result names no variant parameter, since a value would not say which member a parameter is; closed unions (-> Expr[int | string]) are allowed. Alternative weighed: deciding the parameter by normal-form order (arbitrary, and wrong for a value made at another member).

  • An arm no value can reach because its equalities contradict is an error, as every unreachable arm is, and coverage counts only the variants possible at the matched type, carrying each row’s equalities; a match on an instance with no possible variant is an error. Alternatives weighed: a warning for an impossible arm (Avin has no warnings for unreachable code); pruning per column without carrying equalities along a row (simpler, but demands arms for combinations no value has).

  • Bounds on a variant’s parameters are checked where a value is made and held in the arm, and an enclosing type parameter equated with a bounded one gains the bound there; a copy at a type without the bound compiles no such arm. Why: it is what makes a hidden type useful (Sendable for a reply, Ord for a sorted payload), and it costs one more test when an arm is decided at a copy. Alternative weighed: no bounds on variant parameters (the protocol could not name ActorRef[R], whose parameter is bounded by Sendable).

  • The nested-data-type rule is measured against the variant’s result, and a larger part made of a hidden parameter is allowed, since its instances exist only where the program makes a pack. Alternative weighed: measuring against the plain instance D[T…] (refuses First[A, B](pair: Expr[(A, B)]) -> Expr[A], which has finitely many copies).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-1, the declaration step): a refined variant’s parameters, the type’s included, are the variant’s own in the expansion check. An instance reaches them through the result (Expr[X] holding a Pair has X = (A, B), so A and B lie one level down), and a type argument of a field that names a hidden parameter adds no edge, since its instances are the packs the program makes, which step 5’s check of growing packs counts. A growing cycle through a refined variant names the field and the result it is measured against. Why: it is rule 6 exactly, and it reuses the one polymorphic-recursion check rather than a second one for variants. Alternatives weighed: a separate syntactic comparison of each field with the result (misses growth through a second type, which the flow check already follows).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-1): a variant’s own type parameter takes bounds and no variance and no lower bound, and a name reused from the type’s parameters or twice among the variant’s own is an error. Why: a variant is a constructor, a generic function, whose parameters take no variance; a lower bound asks of a call’s argument something a match could not hand back. Alternatives weighed: allowing >: (sound at the call, but it gives the arm a one-directional fact, the kind Variance declines).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-1): a result written as the type at its own parameters, If(…) -> Expr[T], with no parameters of the variant’s own, is a plain variant, the same declaration as one with no result. A data parameter a refined variant’s result does not name is hidden there like any other (IntLit(value: T) -> Expr[int] hides T). Why: the chapter says the type’s names are every variant’s parameters, and a written-out plain result changes nothing a value carries. Alternative weighed: treating any written result as refined (a type would lose its plain uses for a redundant spelling).

  • Settled on the user’s delegation 2026-11-15 (built on branches gadt-1 and gadt-2): a type with refined variants is named, made and matched like any other, and the code the derived templates write (Display, Debug, Ord, any walk) matches every variant, its copies compiled only for the variants possible at each instance, each arm at the arguments it reads back from the instance. The declaration step (gadt-1) and the values-and-layouts step (gadt-2) first refused the type’s uses with “yet” messages; patterns and field reads came with gadt-3, hidden parameters with gadt-5 and bounded parameters with gadt-6 (the entries below). Why: lowering lays out every variant at every instance, so the derived code needs only what lowering knows at a copy. Alternatives weighed: accepting patterns on plain variants before coverage over the possible variants existed (it would demand arms for impossible variants that gadt-4 then made errors).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-2): a parameter of the data type that a refined variant names in neither its fields nor its result is fixed in its signature (to Nothing, which nothing observes), so it is never inferred and never written: Pair[int, bool](…) writes Pair‘s A and B, Done[S] of Done -> Plan[From, From] writes From, and IntLit[int](1) takes no type argument. On the type, Expr[(int, bool)].Pair(…) names the instance the value makes: the variant’s parameters are inferred from it and the value is held to it. Why: the chapter says a variant is called as a generic function, and such a parameter is no parameter of that function; leaving it to inference would make every call of IntLit an unsolvable “cannot infer T“. Alternatives weighed: dropping the parameter from the variant’s list (its field defaults are functions of the whole list); reading T[A].V as written arguments of V (they are the type’s, and need not match V‘s own in number or meaning).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-2): a derived trait holds of a refined variant’s own parameter where the trait on the instance implies it: the parameter sits in the result under constructors whose trait needs their argument’s (a tuple’s, Vector‘s), tested by whether the constructor at the parameter has the trait where every other argument does and the parameter alone has none. Where it is not implied (Hold[A](x: A) -> Odd[Wrap[A]], with Wrap showing itself whatever A is), the field falls short and the type has no automatic Display, as any type with such a field. A hidden parameter is decided per pack, by the parameter’s bounds (step 5, branch gadt-5, the entry below). Review with the user: whether a refined type’s Display should rather be decided per instance, at the instance’s own arguments. Why: a derived impl is checked once, over its type’s parameters, and this is the most that check can know of a variant’s own; it is sound, since the trait at an instance gives it to the parameter read back there. Alternatives weighed: no trait for own parameters (every type with Pair would lose Display); the trait unconditionally (unsound for Odd).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-2, where refined variants meet higher-kinded types): a variant’s own type parameters are types, and a constructor parameter of the type keeps its place in a result: V[G[_]](…) is refused with "a variant's own type parameters stand for types, not type constructors: `G` of `V` takes type arguments; declare a constructor parameter on the type, as in `data D[G[_]]`", and W(…) -> D[Vector, T] with "a variant fixes no constructor parameter: `W` makes `D[Vector, T]`, and `F` of `D` is a constructor parameter, so its place holds `F`", while Y(x: F[int]) -> D[F, int], keeping F and fixing T, is accepted (step 1 refused it as “no type a match can take apart”, which was a mistake). Why: the gadt-1 entry below settles that no constructor parameter is fixed, and keeping one in its place fixes nothing. Alternatives weighed: refusing any refined variant of a type with a constructor parameter (needlessly narrow).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-1), for constructor parameters (higher-kinded types), the conservative reading: a variant fixes no constructor parameter of its type, its own type parameters are no constructor parameters, and a result’s argument never applies a constructor parameter (-> D[F, F[A]] is refused, since F[A] against a known instance cannot be taken apart where F is itself a parameter of the code matching). The declaration step enforces the last two through one rule: a result’s arguments are built of data types, classes, tuples, function types and the variant’s parameters, and any other form, a constructor or its application among them, is refused with "`F[A]` in the result of `V` is no type a `match` can take apart: the result's arguments are built of data types, classes, tuples and function types"; a constructor parameter among a variant’s own (V[G[_]]) is refused since the two branches met (branch gadt-2, the entry above). Fields name constructor applications freely, as any variant’s do. Why: refinement solves equalities by decomposition, which needs every parameter under a constructor that the instance’s head determines; an applied parameter is not one. Alternatives weighed: solving F[A] = X by matching X‘s head (unsound when F is a partial application, whose holes may sit anywhere among X‘s arguments). Review with the user: whether refinement over constructors is wanted.

  • Settled on the user’s delegation 2026-11-15 (branch gadt-3, the refinement step): each pattern on a refined variant gives the variant’s parameters fresh types of its own, so two Pair patterns, nested or one after the other, give two unrelated sets, and the equalities are solved with those fresh types first, then the enclosing code’s type parameters: Vector[A] = Vector[T] makes A the T around the arm, so a field reads as a type the code can name, and T = (A, B) keeps T as the pair of the fresh types. A union or a type constructor that names a type parameter is not taken apart and teaches nothing (T | string = int | string has two solutions); any other two different types, and a cyclic T = Vector[T], are a contradiction, which step 4 (branch gadt-4) makes an error at the pattern; the arm’s body is then checked with no equalities, and is not compiled at any copy. The equalities hold where a marker local the pattern declares beside its names is in scope, which carries them exactly where the names go: an arm, a clause, an is test’s branch, the right operand of && and ||, the rest of a block after an early return or a binding. At a copy where a pattern is impossible, lowering leaves out what holds its equalities: the arm, the branch an is test then cannot take, the right operand of && and ||, a while body, and the rest of a block whose taken branch never finishes. Why: the chapter’s “fresh types known only by these equalities”, and a substitution the arm’s code can read. Alternatives weighed: naming the fresh types by the data type’s own parameters (two nested patterns would share them); stopping with an error at an equality not taken apart (refuses sound programs).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-3): a variant’s own parameter that the equalities leave a fresh type never leaves its arm, as a hidden one does not (the chapter states it for hidden parameters only): with no type expected, an arm, a clause, an is branch or a block whose result names one is refused with "this arm's result is an `Expr[A]`, and `A` is a type `Pair` takes from the value it matches, which is not known outside its arm", and an inference variable made before the pattern settled to one with "a type declared outside this arm cannot be settled to an `Expr[A]`: …", reported at the pattern. Why: such a type is known only through the value matched, so no copy can compile code outside the arm that names it. Alternatives weighed: settling the escaped type as Nothing (lays out a value at the wrong type); allowing it (no copy could compile it).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-3): inside an arm a value of a type an equality fixes is used at what it is there for operators, members and comparisons (x + n with x: T and T = int is an int), the type expected of an expression is the one under the equalities (a literal where a T that is an int is expected is an int, a value where a T that is Any is expected is boxed), while an inference variable still settles to the type as written where it meets one. An arm that refines, with a type expected, is checked against it under its equalities and yields the expected type itself; one that does not fit it is refused with "this arm yields int, not the T expected of the `match`". Clauses with no declared result that agree on no type are reported as the chapter reports arms: "the clauses of `f` agree on no type: `IntLit`'s yields an `int`, which is `T` only inside that clause; declare the result type". Why: the chapter’s “a type and anything it equals are one type” and its “as written” rule for inference variables, each where it can apply. Alternatives weighed: rewriting every type in the arm to its refined form (would settle variables outside the arm to refined types, against the chapter).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-3): val V = x, where V is a variant of x‘s type and that type has refined variants, takes the value apart as the chapter’s val Refl = proof does; anywhere else val Name = x binds a name, as before. Review with the user: whether val V = x should take apart a value whenever V is a variant in scope, as a bare name in a pattern does. Why: the chapter’s example, with no change for any program written before refined variants. Alternatives weighed: requiring val V() = x (not the chapter’s spelling); the general rule (changes what existing bindings mean).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-3): a field of a refined type’s one variant is read by name where the instance says the field’s type: o.value on One[T] with Mk(value: int) -> One[int] is an int; an instance the variant cannot make is refused with "`One[bool]` has no values: no variant of `One` makes one", and a field whose type keeps a parameter the instance does not say with "the field `items` of `Hold` has a type a `Holder[T]` does not determine; take the value apart with `match`". Why: every value of the instance is the variant’s, so the read is the arm of a one-arm match, and only its result type must be one known outside. Alternatives weighed: refusing every such read (the chapter’s single-variant types would lose field access).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-4, the coverage step): coverage counts the variants possible at the type matched as the equalities in scope see it, splitting a column on a refined type’s variant only where the variant’s result has a solution with the column’s instance, the variant’s own parameters given types of their own for that split; the solution carries to the other columns, so a row’s equalities travel along it, and an instance no variant makes is a column with no values. Why: the chapter’s Coverage, and the same solving the checker does for a pattern, so the two agree on what is possible. Alternatives weighed: carrying the equalities as a substitution beside the columns (the same, with every function of the coverage check threading it; applying them to the columns at each split needs no more state).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-4): an impossible pattern is reported at the pattern, by the checker, with the chapter’s three reasons, chosen by re-solving: against the equalities in scope before its row alone it fails (`Eq` makes an `Expr[bool]`, and the value matched is an `Expr[int]`, or the empty-instance message where no variant is possible), a cyclic equality (`Wrap` needs `T` to be `Vector[T]`, which no type is), or the first equality of an earlier pattern of its row that leaves it none (`IntLit` needs `T` to be `int`, and `BoolLit` in the same pattern needs it to be `bool`). A row is an arm’s pattern, a clause’s arguments (in the same clause), an is test’s pattern, a binding’s pattern. The lead says what never happens: this arm is never reached, this clause is never reached, and this pattern never matches for an is test, a binding and one of a set of alternatives, which the chapter does not word. An impossible pattern on the right of &&, under the left’s equalities, is an error the same way. A match on an empty instance is an error at the value matched even when no arm names a variant (_ -> 0 on a Same[int, string]). Why: the pattern is where the contradiction is, and a test that can never succeed is dead code as an arm is. Alternatives weighed: reporting impossible arms from the coverage check (it sees rows, not which equality failed, and would say only “never reached”); leaving an impossible is test legal (it folds to false at every copy, which hides a mistake). Review with the user: the wording for tests, bindings and alternatives.

  • Settled on the user’s delegation 2026-11-15 (branch gadt-4): each alternative of a pattern matches on its own: the equalities an alternative learns hold neither in the alternatives after it nor in the arm, and lowering tests each alternative at what its own patterns read back from the value. A step-3 bug: an alternative’s equalities stayed in scope, so IntLit(_) | BoolLit(_) -> 5 on an Expr[T] was checked as if T were int, and its bool copy answered false for the 5; and an alternative was compiled without its patterns’ arguments, so Pair(IntLit(3), _) | … never matched. Why: the arm runs for whichever alternative matched, so only what all of them imply could hold, and alternatives bind no names. Alternatives weighed: keeping the equalities every alternative implies (sound, but needs a meet of substitutions the chapter does not describe; no program has needed it).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-4): two types that read the same in a message are named apart by the refining patterns that took them: expected Expr[A of `Pair` on line 4], found Expr[A of `Pair` on line 5], with the column too where both patterns are on one line, in the expected/found, operator-operand, cannot compare and declared-result messages. Only where the two names would otherwise be identical; every other message is unchanged. Why: two patterns on one variant give two unrelated sets of fresh types with the variant’s parameter names. Alternatives weighed: numbering the fresh types (A1, A2), which every message would show, even where nothing clashes.

  • Settled on the user’s delegation 2026-11-15 (branch gadt-5, the hidden-parameters step): a hidden parameter has exactly the bounds its variant declares, and a trait derived for its type holds of it only by them: Hold[A](value: A) gives Box no automatic Display, Debug, Eq, Hash nor Sendable, and Hold[A: Display](value: A) gives it Display. A parameter of the type that a refined variant hides (Hide(value: T) -> Tagged[int]) is the value’s own, so the impl’s bound on the instance’s T does not give it the trait either. The reason a type has no automatic trait names the variant, its field and the hidden parameter (`Tagged` has no `Display` because its field `Hide.value` names `T`, which the variant hides and a value may hold at any type; bound it, as in `[T: Display]`), and an explicit derives says the same. This settles step 2’s “the trait for now” per pack: the derived code’s arm is compiled once per pack, and only the bounds hold at every pack. == and the hash still compare and hash every value, a pack at a time. Consequence: the chapter’s Expr, whose First hides B, has no automatic Display unless First writes [A, B: Display & Debug]. Why: a derived impl is checked once and must hold wherever any value is, and a pack’s types are known only where the value is made; deciding by bounds keeps the type’s traits a fact of its declaration. Alternatives weighed: giving the trait unconditionally (unsound: a value of a pack without it reaches the derived code); requiring the trait of the hidden types where each value is made, whenever the type derives it (every Box made of a class without Display would be an error, though the program never shows one, and generic code could not know whether its instance derives it); rendering a hidden field through its type record (Display and Debug only, and a change to the derive templates). Review with the user: whether Display and Debug should rather render a hidden field through its run-time type, so Expr prints without the bound.

  • Settled on the user’s delegation 2026-11-15 (branch gadt-5): a bound on a hidden parameter is allowed, T: A & B included; a bound on a variant’s own parameter that its result names was left to step 6 (branch gadt-6, the entries below). A hidden parameter’s bounds are checked where a value is made, as a call’s are, and the fresh type an arm gives it has them. Why: the chapter states them for hidden parameters in their own section (“a fresh type, with the bounds its declaration gives it”), and the typed protocol needs Ask[R: Sendable]; what step 6 adds, an enclosing type parameter gaining a bound by equality, does not arise for a hidden one. Alternatives weighed: leaving every bound to step 6 (the protocol could not be written in step 5).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-5): an is test or a binding takes apart no field of a hidden type: if b is Hold(v, _) with value: A hidden is refused with "`Hold` hides `A`, and its field `value` names it: an `is` test or a binding takes apart no field of a hidden type; take the value apart with `match`, whose arm is compiled for each type the value hides"; b is Hold(_, _, t), testing or binding only fields whose type every pack shares, is accepted and tries each pack. A match arm, a clause, a match function and an actor’s or machine’s arm take any field. Why: an arm is one expression, compiled once per pack; an is test’s equalities reach the rest of a block after an early return or the right operand of &&, code that would have to be copied per pack as far as the names reach. Alternatives weighed: copying the reached code per pack (a block’s rest, an && chain and a while condition each need their own copying); refusing every hidden pattern in a test (the tag test and the shared fields are sound and useful).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-5): an arm on a variant with hidden parameters is compiled inline, once per pack, and chosen by comparing the value’s descriptor with each pack’s, not as a function called through the descriptor’s method table as the build plan said. Lowering finds the packs as it reaches the code making them; an instance compiled for fewer packs than the program has made by the end is lowered again, until none is stale, and such instances are not kept in the instance cache. Why: an arm compiled inline keeps return, break, continue, a var of the function and a tail call behaving as in any arm, which a separate function would have to pass back across a call; the run-time cost is one compare per pack before the arm, against a call through a table. Alternatives weighed: the plan’s function per pack through the table (each arm would need its locals captured and its exits returned as codes); boxing hidden fields behind Any (the chapter’s alternative, a run-time test where none is needed).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-5): in the polymorphic-recursion check, a refining pattern’s fresh types are its variant’s parameter nodes, a value made with hidden types reaches them, and a type argument holding a hidden type grows no parameter of the code that the value matched holds: so eval(First(p)) = … eval(p) at (T, B) is ordinary, as the chapter says, while a pack built from ever larger hidden types (Hold(v) -> grow(Hold([v]))), a generic function making a pack of its parameter whose arm calls it larger, and a parameter grown beside a hidden type of a value not holding it, are refused as polymorphic recursion naming the variant. Why: an instance at a hidden type exists only for a pack, which a value made somewhere holds, and a matched value holding the parameter can be of a larger pack only where the program made one; growth through the values made is counted by the construction edges. Alternatives weighed: counting every type argument as before (refuses the chapter’s eval); dropping every edge of an argument naming a hidden type (accepts pairUp((x, y), b), which never ends).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-6, the bounds step): an enclosing type parameter gains a variant parameter’s bounds only where an equality in scope equates the two as wholes: with Sorted[A: Ord](items: Vector[A]) -> Coll[A], T of smallest[T](c: Coll[T]) is Ord in the Sorted arm, a parameter equated in a tuple place (Conv2[A: Into[B], B](…) -> Conv[(A, B)] on a Conv[(X, Y)], where X gains Into[Y]) too; U of a Coll[Vector[U]] gains nothing, though Vector[U] is Ord. The bound holds where the arm’s equalities do: not among alternatives, not after the arm, not in the other branch of an is test. Why: the chapter states it for “a fixed parameter equated with a type parameter”, and inferring U: Ord from Vector[U]: Ord would invert an impl’s condition, which holds only where no other impl gives the trait. Alternatives weighed: inverting conditional impls (unsound wherever a type has the trait unconditionally); rewriting T to the variant’s fresh type in the arm (the arm’s result would then be checked as a type that leaves its scope).

  • Settled on the user’s delegation 2026-11-15 (branch gadt-6): a variant’s bounds do not prune coverage: a match on a Coll[Thing], with Thing not Ord, still needs a Sorted arm (or a wildcard), whose code is checked at Thing without the bound, as the chapter’s coverage rule counts equalities alone. Lowering does leave the variant out of the instance: Coll[Thing]‘s layout has no descriptor for Sorted, and an arm, an is test or the derived code on it is not compiled there, as for a variant whose equalities fail. Why: coverage stays a fact of the types’ shapes, unchanged by which impls the program declares (an impl added in another module would otherwise make a covering match incomplete). Review with the user: whether an arm on a variant whose bounds a concrete instance fails should rather be “never reached”, as an impossible arm is.

  • Settled on the user’s delegation 2026-11-15 (branch gadt-6): whether a refined type is sendable is decided at its instance: a variant’s own parameters are read back from the instance’s arguments, so Coll[string] is sendable though Sorted‘s A is bounded by Ord alone, and a variant whose result is another concrete instance holds nothing there (Msg[int] is sendable though Log, making only a Msg[string], holds a Buffer). Where generic arguments do not say what a parameter is, one bounded by Sendable is sendable, as a hidden one is, and any other may be any type. A hidden parameter is still decided by its bounds alone, per the gadt-5 entry: every pack the program makes was checked where its value was made. Why: before, a refined variant’s own parameters were read by position, so every instance of a type with Sorted was unsendable, and an actor could not receive one. Alternatives weighed: requiring Sendable on every own parameter (a bound the instance already decides).

  • Settled on the user’s delegation 2026-11-15 (branch ascription; ascription itself approved by the user 2026-11-13): Type ascription (value: T), written as an item of a parenthesized list (types). (1) Where it parses: a group, a tuple’s part or a call’s argument (a named one’s value included), never a bare value: T elsewhere. WHY: inside parentheses : has no other meaning (named arguments use =, a map literal’s : is inside braces, a field’s or parameter’s type is in a declaration), so the grammar stays unambiguous with no new token; at a statement’s level x: T would read as half of a declaration. ALTERNATIVES: bare value: T anywhere (collides with val x: T, clause signatures and a match arm’s type pattern n: int -> …); a keyword (value as T, a word read as a conversion, which this is not); parentheses only for a group, not for arguments (f((None: Option[string])) doubles every bracket). (2) What it accepts: exactly what val x: T = value accepts — literals taking T, None, empty collections and lambdas typed by T, a subtype’s value, a union’s member — and the expression is of type T. WHY: one rule a reader already knows, and no conversion hides in a form that looks like a type. ALTERNATIVES: also converting numbers ((n: long) of an int), which is the implicit widening the spec refuses; accepting narrowing as a checked downcast, which is a match‘s job. (3) The refusal says what to write: long(n) for a numeric conversion, BigInt(k) / T.fromInteger(k) for an integer variable to a type that takes integers, the explicit BigDecimal.fromReal… for a real, and is/match for a narrowing. (4) Ambiguities settled: (n: long) -> … stays a lambda; x: int -> body whose rest is not type-shaped keeps its hint “a lambda’s parameter with a type is written in parentheses”, while (f: int -> int) is an ascription to a function type; at the start of a block’s line name(x: T) followed by =, ->, an indented block or a clause line still declares a local function, and a clause signature now needs its next line to be a clause (followed by =, | or guards), so two show(n: long) calls on consecutive lines are calls; a parameter counts as typed only when a name precedes its :, so show(1: long) is never a declaration. (5) (_: T) in a placeholder lambda is a parameter of type T. WHY: it is the one place a placeholder’s type can be written. ALTERNATIVES: leaving _ untyped inside an ascription (the ascription would still constrain it, but a mismatch would read as the ascription’s error rather than the parameter’s). Review with the user: (1)’s rule that a statement-level retry(n: long) followed by an indented block is a declaration (write retry((n: long)) to call it).

Actor patterns (actors, branch actor-patterns)

  • Settled on the user’s delegation 2026-11-15 (branch actor-patterns): Routers are Router.pool(size, behaviour, routing, onFailure, executor), giving back a plain ActorRef[M]. The router is an actor of its own, the routees its children, so the lifecycle and supervision of actors cover it with nothing new: stop(router) ends the routees first, a routee’s onFailure is the router’s argument, a routee that ends leaves the pool and the router stops with the last one, and a routee’s escalation fails the router, which always escalates (the router’s own supervision is not a parameter). The routings are the data Routing[M]: RoundRobin (the default), AtRandom, SmallestMailbox, ByKey(key: @sendable (M) -> long). Why: one reference that accepts the routees’ own messages is what a caller wants, and asks through it work unchanged; a hop through the router keeps one sender’s order per routee and keeps the pool’s state in one actor’s turns, with no lock. Alternatives: a reference whose tell picks a routee in the sender’s thread (no hop, but the pool’s changing membership shared between threads); a Router[M] object with its own stop (a second lifecycle beside the actor’s); a supervision parameter for the router itself (rarely wanted: it holds no state worth restarting). Random was not taken as a variant name since avin.random.Random is a common import; Router shares its name with avin.net.http.Router, in a different module. Review with the user: the names (AtRandom, ByKey) and the router’s fixed Escalate.
  • Settled on the user’s delegation 2026-11-15 (branch actor-patterns): SmallestMailbox counts the messages waiting, and ByKey hashes by highest weight. A routee’s mailbox alone keeps a count (an atomic add on each send and take; other actors’ mailboxes pay nothing), the message being handled not counted, ties going to the next in turn. ByKey weighs each routee against the key by mixing the key with the routee’s number and takes the heaviest, so a key keeps its routee while it lives and a routee that ends moves only its own keys. Why: the count is exact and cheap where it is needed; the weighting needs no ring and stays consistent as the pool shrinks. Alternatives: counting every mailbox (a cost to every actor); counting a message until its handling ends (a second atomic per message); the key modulo the pool’s size (every key moves when one routee leaves); a hash ring (more state for pools that are small).
  • Settled on the user’s delegation 2026-11-15 (branch actor-patterns): A message a router finds refused goes to another routee. A routee that has begun to end refuses a message, and the router chooses again among the rest, before it has heard of the end; a message a routee accepted and then dropped as it stopped is lost, as with any actor that stops. Why: the window between a routee ending and the router hearing of it would otherwise lose messages for no reason. Alternative: dropping them.
  • Settled on the user’s delegation 2026-11-15 (branch actor-patterns): A Stash is a bounded object of the actor’s state, Stash(self, capacity), and adding to a full one traps. unstashAll puts its messages in front of every message waiting, in the order added, in a queue the actor’s turn reads before its mailbox, so a restart keeps them as it keeps the mailbox, while what is still stashed is lost with the state. Why: the actor’s own state is where an actor’s choices live, and a stash made from the actor’s own reference cannot be given another actor’s messages; a full stash means the actor’s design did not foresee the load, which is a bug for supervision to handle, and an actor that wants another policy checks isFull first. Alternatives for overflow: dropping the newest or the oldest silently (a lost question looks like a timeout with no report), add answering a bool (easily ignored); for the shape: stash(message) and unstashAll() on ActorContext with a capacity given to spawn (state outside the actor’s fields, and a parameter every actor carries); unstashed messages put at the back of the mailbox (behind messages that arrived later, losing order). Review with the user: trapping on overflow.
  • Settled on the user’s delegation 2026-11-15 (branch actor-patterns): A Topic[E] is a sendable object, not an actor. publish tells each subscriber in the publisher’s own thread, so one publisher’s events reach each subscriber in order with no hop; subscriptions live in one atomic value; a subscriber’s end is watched through its ended() future from its first subscription, which drops it. An actor is subscribed once, by its number, the later reference (an adapter, say) replacing the earlier in its place. Why: any thread may publish, nothing needs stopping, and no actor’s mailbox sits between publisher and subscriber. Alternatives: a topic actor that subscribers and publishers message, watching subscribers with watch (an extra hop per event, a lifecycle to manage, and a count that is only known by asking); topics named in a global registry (shared mutable state by name).

Higher-kinded types (generics, branch hkt-design)

  • Settled on the user’s delegation 2026-11-15: a constructor parameter is spelled F[_], F[_, _] for two holes, and a partial application of a type writes _ for each argument left open: Result[_, ParseError], Map[string, _]. Why: the same mark at the declaration and at the use, the _ the language already uses for “something left out” in patterns and lambdas, and the spelling other chapters’ prose already used for “a Result of any value with this error”. Alternatives weighed: a kind annotation (F: * -> *, notation with no other use in the language); a type-lambda form ([X] => Result[X, E], general but a second way to write types, and lambdas make constructor equality undecidable in general); declaring the constructor by an alias only (every partial application would need a named alias). Review with the user: the spelling is the most visible choice of the design.

  • Settled on the user’s delegation 2026-11-15: holes are direct arguments of one nominal type; no nested _, no constructors of constructors (F[_[_]]), no tuple or function constructors. A generic alias whose parameters are each one direct argument of its expansion is a constructor too. Why: a constructor is then a nominal type with places left open, so equality is structural and inference has one answer, the core of the soundness argument; composition (Option[List[_]]) is a data type of the program’s own. Alternatives: general type lambdas (undecidable equality, inference with many answers); allowing any alias as a lambda (the same problem behind a name). Review with the user: whether composed constructors are wanted soon.

  • Settled on the user’s delegation 2026-11-15: a hole may declare variance (F[+_]) and bounds (F[_: Sendable]), a demand on the constructor passed: +_ lets F[Dog] be an F[Animal] inside the declaration and takes only constructors covariant there; a bounded hole is applied only to types meeting the bound, checked at each F[X] written, and takes constructors whose parameter’s bounds the hole’s imply. A plain _ is invariant and unbounded, and refuses a type with a bounded parameter at the hole (TreeSet). Why: each is checked at the definition, so no instance can fail; bounded holes are what let Future (Sendable) and sorted collections (Ord) be constructors at all. Alternatives: always invariant (loses F[Dog] as F[Animal] where code wants it, at no gain in simplicity); always covariant (unsound for Array); refusing bounded types outright (excludes Future from comprehensions).

  • Settled on the user’s delegation 2026-11-15: constructor traits are spelled with Self[…], the trait’s parameters being the holes: trait Functor[A] with map[B](f: (A) -> B) -> Self[B], bounds written [F[_]: Monad]. Why: it reads like every other Avin trait (Iterable[+A] with map[B]), keeps impl Trait for Type as the one form of conformance, and the common case (calling fa.map, writing impl Monad for Parser) needs no new notation beyond Self[B]. Alternatives: a type-class-style trait over an explicit parameter (trait Functor[F[_]] with map[A, B](fa: F[A], …), which puts the receiver in a parameter and makes every call F.map(fa, f) or needs a second rule for method syntax); marking constructor traits with a keyword (redundant: Self[B] already says it). Review with the user.

  • Settled on the user’s delegation 2026-11-15: a constructor trait is a bound and never a type, its parameters take no variance, and its static members name none of them. Why: no object of unknown constructor exists, so no dynamic dispatch over constructors and no existential is needed; every call is direct in a monomorphized instance. Alternatives: trait objects of Monad (need a run-time constructor witness and type erasure of the element, which reification refuses).

  • Settled on the user’s delegation 2026-11-15: an impl gives the trait the type’s parameters it leaves open (impl[T, E] Monad[T] for Result[T, E]), and both may be left off where all are open, in order (impl Monad for Option). Why: the partial application needs no new syntax at the impl, and the common one-parameter case reads as plainly as impl Ord for Money. Alternatives: writing the constructor (impl Monad for Result[_, E], which needs E declared somewhere); requiring the full form always (noise in the common case). The bare form is the only impl of a generic type without its parameters, a narrow exception.

  • Settled on the user’s delegation 2026-11-15: a type implements a constructor trait once, at one choice of holes, and the conformance is not inherited by subclasses or through traits. Why: coherence gives each argument one constructor; an inherited map answers the superclass’s type, so inheriting would be unsound. A subclass instance is matched as its nearest superclass with a conformance, then the one trait with one. Alternatives: a conformance per hole (Either a functor on both sides, at the cost of ambiguous inference); inheritance with a check that every method is overridden at the subclass’s type (a long tail of overrides in the library).

  • Settled on the user’s delegation 2026-11-15: a type’s own methods implement a constructor trait’s where the trait’s call is a call of them with no conversion, no extra bound, their own type parameters decided by the call (a lower bound by its bound) and a result conforming to the trait’s. Why: List, Vector, Option, Result and Either meet the family with their existing overloaded and lower-bounded flatMaps, so no collection method is duplicated or changed. This is still nominal: the impl declares the conformance, and the rule only says which declared method serves. Alternatives: exact signatures (forces a second flatMap on every collection, an overload clash); adapters generated per mismatch (hidden code and conversions). Review with the user: it is a looser meeting than a class’s override, which takes the parameter types exactly.

  • Settled on the user’s delegation 2026-11-15: inference of a constructor goes through its bound’s conformance; without a bound only a type of exactly the parameter’s arity is inferred, anything wider needs F written; the written-out arguments join by the type’s variance (Ok(1) beside a Result[int, E]); two different heads never join. Why: the impl is the one place that says which argument varies, and joining the fixed arguments keeps Nothing-typed literals pleasant. Alternatives: the last argument always the hole (wrong for Result, whose value is first); unification over every choice of holes (ambiguous, order-dependent).

  • Settled on the user’s delegation 2026-11-15: a constructor trait’s default bodies are compiled once per implementing constructor and may call its static members on Self. Why: Monad‘s map and map2 from flatMap and pure, so a program’s own monad gives two members. Alternatives: no defaults (every monad writes four members); defaults shared through a method table, as other traits’ are (no Self to call pure on).

  • Settled on the user’s delegation 2026-11-15: impls may add to applications of a bounded constructor parameter (impl[F[_]: Traverse, G[_]: Applicative, A] F[G[A]]), matched through the conformance, with the rules of impls adding to types built from parameters. Why: xs.sequence() reads as a method, and a package can extend every monad at once. Alternatives: free functions only (sequence(xs)).

  • Settled on the user’s delegation 2026-11-15: the standard traits are Functor, Foldable, Applicative, Monad, Filter, Traverse, and the sendable pair SendableFunctor/SendableMonad, in module avin, with Applicative‘s second member map2 and Foldable holding foldLeft alone. Why: Foldable is warranted because Option, Result and Either are no Iterables and Traverse needs a fold; map2 reads better than an ap over functions; Filter is the nominal home of a comprehension’s guard; the sendable pair is how Future, whose combinators need Sendable values and @sendable functions, meets a family. Alternatives: ap (the classic, harder to read); zip/product as the second member (zip already pairs sequences by position and product multiplies); no Foldable (no fold over an option in generic code); Future left out (breaks comprehensions over futures). Review with the user: the names, and whether the sendable pair should rather be a hole bound on the ordinary traits.

  • Settled on the user’s delegation 2026-11-15: which library types implement what: Option, Result[_, E], Either[L, _] and the immutable sequences (List, Vector, ArraySeq, Queue, Seq) the whole family, Filter except on Result and Either; LazyList all but Traverse; Array, Buffer, Deque and Set Functor, Foldable and Filter; Future the sendable pair; Map, the sorted collections, Iterator and Range none, each for the reason its signatures show. A sequence’s map2 is cartesian, as its flatMap. Why: each impl is lawful, and the laws are tested. Alternatives: Monad for the mutable collections (lawful, but pure making a mutable array surprises); Map as a functor over its values (its map takes entries, so it needs a method of another name).

  • Settled on the user’s delegation 2026-11-15: for comprehensions admit their sources by conformance: the last generator an Iterable or a Functor (or SendableFunctor), an earlier one an Iterable or a Monad (or SendableMonad), a guard an Iterable (through its lazy withFilter, whose views become Iterables) or a Filter (through filter); in generic code the bounds decide; the calls are then checked as written out, so mixed sources (for w in words, n in parse(w)) keep working through the collections’ own overloads. A type with map and flatMap and no impl is no longer a source: the error says which impl to declare. Why: the user’s rule that Avin is nominal; the structural rule admitted any type with methods of those names. Alternatives: keeping the structural rule (contradicts the rule); desugaring every comprehension through the traits’ members only (loses the collections’ precise mixed-source results and withFilter‘s laziness, a visible change in the order of evaluation). Built on branch hkt-8 (admitted_source in check.sysl; tests/run/for_yield_conformance{,_gc}.avin, tests/reject/for_yield_roles{,_more}.avin, tests/reject/for_yield_generator_mismatch.avin), with a definition a guard follows asking Monad of its source, as the collections chapter says, though its map and filter would need only Functor and Filter. Review with the user: it breaks programs whose own types relied on the structural rule, each fixed by one impl; and whether a guarded definition should ask only Functor.

  • Decided by the user 2026-11-14: a built-in type’s name in a pattern is a type pattern: x is int tests the type and an arm int -> matches an int, for every name in the table of built-in types, the sized integers iN included; generic forms stay _: Vector[int]; a name with a binding is n: int. Built on branch is-type-name, where x is int had bound a new int and was always true (tests/run/operands_for_traits.avin tested nothing). Proposed with it:

    • Such a name never names a value: a local (val, var), a function’s, a lambda’s or a class’s parameter, a data field, and a pattern binding it (int: T, int @ p, int + 1, a comparison pattern, int*) are errors, `int` is a built-in type, so it cannot name a value and …, so a pattern cannot bind it: alone it tests for the type, and `n: int` binds the value as one. Why: with the names type patterns, val (a, int) = p would test where val int = 3 binds, and int(x) in an expression would mean the conversion or the local by context; refusing them everywhere keeps one meaning per name. It also settles the hiding rule for built-in statics: val string = …; string.byteLength no longer arises. The library and tests renamed their locals (unit → identity/scale, the vector tree’s i1–i6 → d1–d6, long, real, int locals in tests). Alternatives: allowing them as val/parameter names and refusing them only in patterns (two meanings for one name, and destructuring differs from a plain binding); allowing only the eight word names and leaving iN free (the user listed the sized integers). Review with the user: i1, i2, … are common index names, and they are refused too.
    • Every type’s name in a pattern is its type pattern (the same decision, extended by the director 2026-11-14 after a is Cell was found binding too): a bare or dotted name with no parentheses that is no variant but resolves to a class, trait, object, data type, alias, Any, Nothing or type parameter is _: T. A variant wins where both exist, so data Cell(value: int)‘s Cell stays the variant’s pattern and every variant pattern is unchanged. A local, a parameter (of a function, local function or lambda) or a pattern binding named after a type in scope is refused: `Cell` is a type, so it cannot name a value: in a pattern it tests for the type, and `x: Cell` binds a value of it. Fields named after a user type are not refused (they are reached as members, and a data field’s pattern is positional). Why: one meaning per name in a pattern; a capitalised name quietly binding was the same defect. Alternatives: only refusing capitalised bindings that shadow a type (keeps the always-true test as an error rather than a feature); including field names (more renames for no pattern ambiguity).
    • A generic type’s name alone in a pattern is refused, `Box` is a generic type, and a type pattern names its type arguments, as in `_: Box[int]`. Why: a type pattern compares type arguments exactly, and the run-time test of “a Box at any arguments” would be a new kind of test with no sound meaning for variance and value-type arguments yet. Alternatives: testing the class at any arguments (needs a class-only run-time test and a binding type, Box[?], Avin lacks); inferring the arguments from the matched type (works only where they are known, and reads differently by context). Review with the user if a “any instance of Box“ test is wanted.
    • A type alias in a constructor pattern, P(a, b), stays refused as before.
    • Functions and methods may still be named so (cli‘s int(name) and string(name) options): a function is called, never matched, so no pattern can mean it. A missing-member witness still reads _: string, which is the same pattern.
  • Settled on the user’s delegation 2026-11-15 (branch fix-core-promises): the standard library’s Sendable promises are checked against the structure, except where @trusted_sendable("why") marks a class (actors). This replaces the 2026-11-05 settlement’s “the standard library’s promises are taken as made”, under which Map.withDefault(f) answered a sendable map holding a plain function and a thread raced on what it captured. The mark is a class annotation (it trusts the class whether its header or an impl makes the promise), takes one non-empty string saying why the class is safe, is refused outside the standard library, and is an error on a class that promises nothing. Seventeen classes carry it: Lock, Condition, Mutex, Atomic, Channel, Thread, and the futures’ Cell, Pool and Registry (synchronization the runtime does); the running Actor (its turns are serial) and Isolated (an atomic state arbitrates its objects); TcpStream, TcpListener, UnixStream, UnixListener, TlsStream and Child (one owner at a time, checked by every operation). Future, Promise, Executor and Once became sendable by their structure, Cell gained an impl[T: Sendable] Sendable and Lock a : Sendable for it. Why: the trust is greppable and each entry says its reason; trusting the innermost synchronized class rather than each composite keeps the list short and checks the rest. Alternatives weighed: a list of names in the compiler (invisible at the type, drifts from the library); trusting every class of avin.threads (too wide: it hid nothing here, but would hide the next DefaultMap); marking the composites (Future, Promise) instead of Cell (more entries, fewer types checked).

  • Settled on the user’s delegation 2026-11-15 (branch fix-core-promises): withDefault‘s function is @sendable, and the DefaultMap holds its default as a private MapDefault data value, Fixed(v) or Computed(f), so withDefaultValue(v) takes any value and the wrapper is sendable wherever the map and v are. Why: Map promises Sendable and every map is one, so the default must be sendable for the wrapper to keep the promise; most defaults (k -> 0, k -> k.length) capture nothing mutable and are unchanged. Alternatives weighed: Map not promising Sendable (every immutable map would stop being sendable); DefaultMap alone not being a Map (breaks val m: Map[K, V] = ….withDefault(f)); keeping a plain function and making the wrapper not sendable (a trait’s implementers cannot opt out). Review with the user: a default that mutated a captured local (a call counter) now uses an Atomic.

  • Settled on the user’s delegation 2026-11-15 (branch fix-core-promises): a TlsStream checks its owner before every operation, through a token handle as Child does, so a stream handed to another thread traps its previous owner at a read served from the bytes read ahead; before, only a read that reached the socket checked, and a buffered read raced. Why: the same rule a TcpStream keeps. Alternative: none sound.

  • Settled on the user’s delegation 2026-11-15 (branch cache-trim): the build cache keeps itself within a limit, least recently used first, with no index: an entry is a program’s build directory (build/, test-builds/) or one object or archive (units/, runtime/, shims/, cunit/), and its modification time is its last use, touched by every build that takes it from the cache (a program’s directory when its build starts and before each test avin test runs). Every command that builds sweeps the cache at most once in ten minutes, a stamp file in the cache shared by every process, and evicts the oldest entries until the cache is within AVIN_CACHE_LIMIT (a size with K/M/G/T, off for none, default 5G; a value that is neither is an error from every command). Why: builds run in many worktrees and sessions at once, so a shared index would need a lock Sysl’s library does not offer, while a touch is one system call and the existing unit-object trim already worked by modification time. Alternatives: an index file of use times (a lock, and a writer killed halfway through it); access times (noatime mounts, and macOS updates them lazily); a sweep after every build (the size walk on every build); an hourly sweep (24G had grown within hours). Review with the user: the 5G default and the ten-minute interval.

  • Settled on the user’s delegation 2026-11-15 (branch cache-trim): nothing used within the hour is evicted, and an entry is renamed aside, looked at again and put back if a build touched it in between, before it is removed. Why: no build reading or writing an entry loses it, without a lock; a cache whose fresh entries alone pass the limit stays past it until they age. Alternatives: lease files naming the process (Sysl’s library has no way to ask whether a process is alive); flock (not in Sysl’s library); no grace (a sweep could take the executable avin test starts once per test). A shim archive and the record of the libraries it needs beside it are one entry, the archive evicted first and a record newer than the sweep’s choice kept, so no build finds the record without its archive.

  • Settled on the user’s delegation 2026-11-15 (branch cache-trim): an entry gone from under a build is a miss, never a link error: every object and archive a build takes from the cache is touched first, and one missing (or a shim archive without its record) is built again; the link looks again at everything it takes from the cache before clang runs and after clang fails, answers an entry gone in between as such rather than as clang’s error, and the build then compiles again, which builds the entry anew, and links once more. Why: a cache emptied by hand, or by a disk being cleared, while builds ran made two gates fail to link a shim archive that had been there when the program compiled (2026-11-13). Alternatives: holding the entries open across the link (clang opens them by name); copying them out of the cache first (the copying costs every build).

  • Settled on the user’s delegation 2026-11-15 (branch cache-trim): another version’s cache is removed three days after its last use, judged by the newest time on it, its kinds and their entries, and only beside the default cache (never beside a directory AVIN_CACHE names), and only for a name that is a version’s. Why: no compiler of this version can read it, and three days spares a user switching back. Alternatives: removing every other version at once (an older installed compiler still in use would rebuild each time); never (the unreachable caches are what filled the disk).

  • Settled on the user’s delegation 2026-11-15 (branch cache-trim): fetched packages are outside the limit and never evicted by a sweep; a sweep removes only the debris of interrupted fetches, and avin cache clean --packages removes packages (with --older-than, those no build has read for that long; a build touches the package it reads). Why: a package is source pinned by avin.sum, small beside a build, and fetching it again needs the network and a tag that may since have been removed, so evicting one could break an offline or archived build. Alternatives: counting packages in the limit (evicted first, being rarely touched, for a few hundred kilobytes saved).

  • Settled on the user’s delegation 2026-11-15 (branch cache-trim): a sweep removes debris: anything in the cache whose name holds .pending- (a write that was never renamed into place) that nothing has written to for an hour, and in the temporary directory the directories a build works in (avin-link, avin-shims, avin-c-unit and the six characters make_temp_dir adds) that nothing has written to for a day, and the avin-test-builds ones the compiler’s tests left before their builds moved into the cache’s test-builds/. Why: a killed or out-of-space build leaves these behind, and on this machine its tests had left 8,673 such directories. A program’s own temporary directories are never touched, whatever they are called. Alternatives: every avin- directory (a program may name its own so); none (the debris is unbounded).

  • Settled on the user’s delegation 2026-11-15 (branch cache-trim): avin cache info | trim | clean: info shows the cache, the limit, each kind’s entries and size, the total with its oldest and newest use, debris, fetched packages and other versions’ caches; trim sweeps now; clean removes every entry, the debris and other versions’ caches, --older-than <n>m|h|d only what no build has used for that long, and --packages the fetched packages too. avin clean keeps its meaning (one program’s builds, or --all every program’s). Why: the user sees what the cache holds and can empty it without knowing its layout. Alternatives: folding these into avin clean (whose argument is a program).

  • Settled on the user’s delegation 2026-11-15: a marked parameter survives a function becoming a value only through its type (branch fix-fn-value-marks): a function, constructor or method whose parameter is @sendable, @isolating or @isolated is a value only where the value’s type gives that parameter a sendable type, which for a function is a @sendable function type; with no function type expected, the value takes that form of each marked function parameter (val sp = spawn[int] is a (@sendable () -> int, long) -> Thread[int]). A type that is a function (a class naming it, or an impl of it for a data type) has an apply that marks a parameter only where its function type makes that parameter sendable, and a @sendable parameter matches a @sendable function type’s. Why: function types carry no parameter marks, so val sp: (() -> unit, long) -> Thread[unit] = spawn ran a buffer-capturing closure on four threads, and Isolated/Mutex as values kept an object the caller still used. Alternatives: marks in function types ((@sendable f: () -> unit) -> unit; a second way to say what @sendable () -> unit says for functions, and for a non-function @isolating value a new kind of type); refusing every such function as a value, as a @threaded one is (also sound, but spawn and onExit could never be held or passed). A by-name marked parameter has no sendable type, so isolate and Future.apply are never values; an @isolated function parameter takes the @sendable form, which asks a little more than the mark (no captured var). Method values keep their own wording, from the call inside the closure they are.

  • Settled on the user’s delegation 2026-11-15: inside brackets a comma ends a match arm’s one-line body and the match (branch fix-match-arg): in call arguments, tuple, collection literals and with changes, the comma after an arm (indented arms included) ends the arm, the match and the item, so f(x match … _ -> 0, "a") passes two arguments; a tuple body there is parenthesized; a one-line yield value stops at the comma the same way. A comma after an arm when the next line at the arms’ depth reads as another arm (it starts with else or holds an -> outside brackets) is reported as a tuple that needs parentheses. Why: the indented arms were read as lines of a block, so the last arm’s body swallowed the following arguments as a tuple, a type error far from the cause; a return value, a lambda’s and a one-line if‘s bodies already stop at the comma. Alternatives: keep the arms a line context (the spec’s “an indented block starts a line again”), which makes _ -> 0, "a") a tuple and needs parentheses around the whole match; or end the match only on the arm’s own line, which would read a middle arm’s comma silently. The arm-shaped-line check can misfire on a lambda argument written on its own line at the arms’ depth after the match, a layout nothing writes. An indented arm body stays a block, where a comma list is a tuple (up to a last line that closes the brackets, below).

Higher-kinded types, kinds and written constructor parameters (build plan step 1, branch hkt-1)

  • Settled on the user’s delegation 2026-11-15: a type with a constructor parameter derives nothing through a template, and has no automatic Display or Debug: derives Eq on a class, Hash, Ord or a library trait is refused with the parameter named, and a value is shown by its type, as a value of no Display is. A data type keeps its built-in structural ==. Why: a template’s impl bounds each of the type’s parameters by the trait, a bound for types that no constructor parameter takes, and what displays an F[A] is unknown where F is any constructor. Reviewed once step 2 landed (branch hkt-2) and kept: a hole’s bounds (F[_: Eq]) say what F is applied to, never what an F[A] meets, so they give a derivation nothing to call. Alternatives: deriving through a bounded hole (unsound for the reason above: F[_: Eq] admits a constructor whose values have no Eq of their own beyond identity); requiring F[A]: Display per field (a constraint on applications, which impls over constructor parameters, step 6, are the place for). Review with the user: whether step 6’s impls over constructor parameters should now give a bounded hole’s types a derivation.

  • Settled on the user’s delegation 2026-11-15: F[-_] is parsed alongside F[+_], as the spec writes only +_. Why: variance is written the same way everywhere else, and a contravariant hole is the dual demand (Ordering-like constructors). Alternatives: refusing -_ until a use appears.

  • Settled on the user’s delegation 2026-11-15: a type whose parameter is bounded is a constructor only for a hole whose bounds imply that bound (step 2, branch hkt-2, replacing step 1’s refusal of every such type at any hole): a hole’s bound implies a parameter’s where it is the same trait or class, or one that is an instance of it (a trait requiring it, a subclass), as Ord implies Eq; Eq and Hash need no hole bound, since every Avin type has them (which is what lets Map[_, V] and Set be constructors for a plain _); a parameter’s bound that names the parameter itself is implied by no hole bound. A constructor parameter passed for another is held the same way by its own holes’ bounds. The check is made where the type arguments are held to their bounds, so a constructor written and one inferred are refused alike, with one message. Why: an F[_] may be applied to any type, so a constructor with a bounded parameter could otherwise be instantiated at a type its bound refuses; implication is the least the hole must promise. Alternatives: checking each application at instantiation (an instance could then fail, against the design); entailment through impls with bounds of their own (no case needs it yet).

  • Settled on the user’s delegation 2026-11-15: every F[X] a declaration writes is held to the bounds of F‘s holes where it is written, once per application, with the message “X does not conform to B, the bound of F‘s argument in F[_: B]“: a signature naming F[A] twice for an A without the bound reports both. Why: the spec’s rule is “checked wherever the declaration writes F[X]“; each place is a separate mistake to fix. Alternatives: one report per declaration (hides the second place).

  • Settled on the user’s delegation 2026-11-15: a hole’s variance is what makes F[A] variant (step 2, replacing step 1’s invariance of every applied argument): inside the declaration an argument of F[A] is at the position its hole gives it, kept at +_, flipped at -_, invariant at _, so +A in a field F[A] is accepted for F[+_] and refused for F[_]; F[Dog] is an F[Animal] only at +_ (and F[Animal] an F[Dog] at -_), where the arguments are references, as for any type. At each constructor passed, written or inferred, the type’s parameter at a +_ hole must be covariant and at a -_ hole contravariant; a constructor parameter passed must declare that variance on its own hole. Why: the subtyping assumed inside the declaration is then exactly what each instance grants. Alternatives: none sound that keep F[+_] useful.

  • Settled on the user’s delegation 2026-11-15: a constructor parameter has no Nothing default: one that is neither written nor inferred is an error, where a plain type parameter left unconstrained defaults to Nothing. Why: there is no “empty constructor” to default to. Alternatives: defaulting to a constructor of Nothing (meaningless as a constructor).

  • Settled on the user’s delegation 2026-11-15: with overloads, the first candidate’s type parameters decide which written argument is resolved as a constructor, before a candidate is chosen. Why: written type arguments are resolved once, before overload resolution, and overloads differing in the kinds of their type parameters are rare; resolving per candidate would need resolution repeated per overload. Alternatives: resolving the arguments once per candidate (correct for mixed kinds, more work in the hottest path); refusing overloads whose type parameters differ in kind. Review with the user if overloads of mixed kinds turn up.

  • Settled on the user’s delegation 2026-11-15: _ alone as a written argument at a call is read as a hole, so that the checker says what the argument takes (_ alone names no type, or _ is no type at a type parameter) instead of unknown type.

  • Settled on the user’s delegation 2026-11-15: a for loop admits its source by conformance to Iterable (branch nominal-for-in): besides a range written in place, a Range and an array, the source’s type conforms to Iterable at some element type through its class’s or data type’s parents and impls, a type parameter’s bounds, a built-in type’s impls, or, for a union, every member’s. A type with an iterator() method and no conformance is refused, the error naming the type and the impl to declare; Option and Either, which have iterator() but are not Iterables, are refused too, an option pointed at toList. Why: the user’s rule that Avin is nominal, and collections.md already said a class is iterable by conforming; the structural check admitted any type with a method of that name. Alternatives: admitting Option as a loop source (it is not an Iterable anywhere else, so a loop would be the one place it acted as one); refusing unions (each member conforms, and the loop’s iterator() call is answered by every member).

  • Settled on the user’s delegation 2026-11-15 (built on branch select): A select block’s syntax (Threads). select ending its line opens a block of arms written as a match’s: ch.receive() as P -> body, ch.send(x) -> body, after d -> body, and else body with no arrow; end select may close it. select is a contextual word, a name anywhere else, as actor and export are. Why: the arms read as the match arms they are compiled into, -> is Avin’s one arrow (=> is rejected everywhere), and else is spelled as a match’s is. Alternatives weighed: => arms as in the item’s sketch (refused by the lexer and by the settled rule on arrows); a reserved keyword (breaks every program naming something select, and the library’s own prose); a library function taking lambdas (no binding by pattern, no return/break from an arm, every arm a closure).

  • Settled on the user’s delegation 2026-11-15 (built on branch select): What a receive arm’s pattern means. Some(p) waits for a value and binds it by p, any irrefutable pattern a val takes; None waits for the channel closed and drained; a name waits for either and binds the Option; _ or no pattern waits for either. Any other pattern (a literal, a tuple, alternatives, a type pattern) is an error. So Some(p) alone is never ready on a closed, drained channel: a select whose only arms want values from closed channels takes its after or else, or waits for ever, as a select over a channel no one sends to does. Why: the pattern says what the arm waits for, so an arm never takes a value it then cannot match, and the common loop (Some(j) and None arms) reads as a match on what receive returns. Alternatives weighed: trapping where a closed channel’s None matches no arm (turns a finished producer into a crash), any pattern with an unmatched receive dropped (loses values). Review with the user: whether Some(p) alone on a closed channel should wait or trap.

  • Settled on the user’s delegation 2026-11-15 (built on branch select): Choosing and evaluating. Every channel, value sent and after duration is evaluated once, in the order written, before any arm is tried; the arms are tried in an order drawn at random each select (a Fisher–Yates shuffle from one shared split-mix sequence), so of several ready arms each is equally likely. after and else together are an error (a select with else never waits); two of either is an error. An after of zero or less tries the arms once, as else does. A send arm on a closed channel traps when it is tried, as send does. Why: the order of evaluation is the order of reading; a random order is the only fair one that needs no state per select site. Alternatives weighed: round-robin per select site (needs a hidden mutable per site, shared between threads); trying in written order (starves the later arms); a send arm on a closed channel never ready (hides the program’s mistake).

  • Settled on the user’s delegation 2026-11-15 (built on branch select): How a select waits. It waits on the very conditions a channel’s receive and send wait on: in one pass, each arm is tried under its channel’s lock and, where it cannot complete, a link of the select is enlisted on that condition’s queue before the lock goes; the thread then parks once. The runtime wakes a link as it wakes any waiter, and the select’s one token decides, by compare-and-set, whether a notification, the timer or a cancellation ended the wait; a notification reaching an ended select’s link is passed by to the next waiter. Woken through an arm, the select tries that arm first and, where it cannot complete while the channel still holds a value (or room), notifies the next waiter, so no notification is lost to a select that could not use it; every link is withdrawn when the wait ends. Why: a channel’s own operations are unchanged, a select costs one park, and a plain receive and a select share one queue in arrival order. Alternatives weighed: a list of selects on each channel woken on every change (wakes every waiting select for each value, a herd of thousands where workers share a channel); passing every unused notification on whatever the channel holds (idle selects hand one notification round for ever: two thousand workers ran forty times slower); a select polling with sleeps (latency and wasted work).

  • Settled on the user’s delegation 2026-11-15 (built on branch select): The library names a select is read into are public: avin.threads.SelectArm, SelectReceive, SelectSend, selectWaiting, selectOrElse, selectWithin, and Channel‘s offerReceive, offerSend and passOn. Their wait parameter is of a type private to avin.threads, so no program can call an arm’s operations. Why: the code a select is read into is checked in the program’s file, so what it names is public, as the actor’s ActorContext is; members have no module-wide visibility. Alternatives weighed: a member visibility private to the module (a language change of its own); intrinsics the compiler calls directly (the arms are generic, and the channel logic belongs in Avin).

  • Settled on the user’s delegation 2026-11-15 (built on branch timing): after and Ticker are channels holding a clock, not a timer (Threads). after(d) -> Channel[Instant] and Ticker(period) with its channel ticks give ordinary Channel[Instant]s whose next value’s due time is kept in the channel; the first receive, tryReceive or select arm that looks once it is due delivers it, a waiting receive waits on its condition until then at the most, and a select parks until the soonest due time among its arms’ channels, then tries them again. The value is the instant the time fell due (the wall clock, offset by the monotonic clock’s lateness), not when it was received. Why: an after nobody receives from, the common loser of a select, then leaves nothing behind (no timer in the runtime’s heap, no thread, no registration) and is collected as any object is, whatever its duration; a channel is what a select arm takes, so no new arm kind or receive-only type is needed. Alternatives weighed: a thread per after that sleeps and sends (lives for the whole duration, ten thousand hour-long afters holding ten thousand stacks); a runtime timer that sends when it fires (needs the runtime to run Avin code from its timer thread, and a timer to cancel by finalizer when the channel is dropped); a receive-only Timer type (a second kind of select arm for the same wait). Channel‘s wakeAt, startClock and stopClock, which the select and the clocks call, are public as the select’s names are, each taking a type private to avin.threads, so no program can call them.

  • Settled on the user’s delegation 2026-11-15 (built on branch timing): Nothing sends to a channel after or a Ticker made. A send, trySend, timed send or select send arm on one traps; close is allowed and ends it, no value delivered after. Why: the channel is the clock’s; a value sent into it would take the tick’s place or sit beside it, and Avin has no receive-only channel type to make the mistake a compile error. Alternatives weighed: letting sends through (a receiver could not trust a value to be a tick); a receive-only channel type (a language feature of its own, which a later decision could still add, making this a compile error). Review with the user if a receive-only view of Channel is wanted.

  • Settled on the user’s delegation 2026-11-15 (built on branch timing): A ticker drops the ticks a slow receiver misses, and stop drops a waiting one. The channel holds one tick; one falling due while it is held is dropped, and the ticker moves on to its first period after now. The held tick is the oldest missed. stop() also drops a tick fallen due and not received, so none is received after it; a period of zero or less traps; the first tick comes a period after the ticker is made; there is no reset. Why: a ticker paces work, and a backlog delivered at once to a receiver that fell behind is the opposite of pacing; after stop, a stale tick is a surprise. Alternatives weighed: an unbounded backlog; the newest missed tick held rather than the oldest (needs a write into a value the receiver may be taking); keeping the waiting tick after stop.

  • Settled on the user’s delegation 2026-11-15 (built on branch timing): Timed channel waits are receive(timeout: Duration) and send(x, timeout: Duration), overloads beside the plain forms, as Future.await(timeout) and Condition.waitFor(timeout) are. receive(timeout) answers Option[T]: None for a time that ran out and for a closed, drained channel alike (isClosed() tells them apart); send(x, timeout) answers whether it sent, and traps on a closed channel as send does. A timeout of zero or less is tryReceive/trySend. Why: the shape of Future.await(timeout), and a loop over a channel’s values ends the same way whichever ended it. Alternatives weighed: a three-way result (a value, closed, timed out), heavier at every call for a distinction rarely needed; a within: named argument (Avin overloads by type already, and no other timed wait is named so); a millisecond long overload (the migration below goes the other way). Proposed migration, not made here: the millisecond overloads Condition.waitFor(timeoutMillis: long) and Future.await(timeoutMillis: long) duplicate their Duration forms and could be retired in a release that breaks source, their callers moved to millis(n).

  • Settled on the user’s delegation 2026-11-15 (built on branch timing): A scope with a time limit is withTimeout(timeout, s -> …) -> Option[T], None where the time ran out. The body runs with a new scope on a lightweight thread of its own while the caller waits in a select with an after; when the time runs out the body’s thread is cancelled, which cancels its scope’s threads and all below them, and withTimeout answers once every one has ended. A result the body returned is kept, however close to the time; a timeout of zero or less runs nothing and answers None; nested timeouts end at the sooner time. Why: Option is what Future.await(timeout) answers, and a timeout is not an error the body made; running the body on a thread of its own is what lets it be stopped wherever it is, main included, whose thread no cancellation reaches, with no new runtime mechanism: a timeout is a scope’s cancellation. Its cost is that the body is on another thread: isMainThread() answers false there, and a lock or a condition’s mutex the caller holds is not the body’s. Alternatives weighed: Result[T, TimedOut] (a new error type for a case with nothing to say); scope(timeout = d, …) (an overload of scope whose result type changes with an argument); a deadline at an Instant (the wall clock moves, and a monotonic instant type does not exist yet; one could be added as withDeadline); cancelling the calling thread itself from a timer and catching it at the timeout (a new runtime mechanism, an un-cancellable main, and a cancellation that must tell its own timeout from an outer cancel). Review with the user: the body running on another thread is visible to code that asks which thread it is on.

  • Settled on the user’s delegation 2026-11-16 (built on branch request-context): The request context is ambient: it belongs to the running thread, not to an argument. Context.current() reads it (deadline, remaining(), value(key)); withValue(key, v, body) and withDeadline(t, s -> …) / withTimeout(d, s -> …) set it for a dynamic scope, and it is put back as the scope ends. Why: the API server and the pg driver need a deadline and request values to reach every call a request makes, and threading a parameter through every signature on the way (the explicit-argument design) taxes every library in between that does not care, and is lost the first time one forgets it; Avin already has a thread-shaped structure, the scope, that a cancellation follows down, so the context follows the same tree. Alternatives weighed: an explicit ctx parameter (the tax above); a general thread-local facility (wider than needed, and a thread-local does not say what a new thread takes, which is the whole question here). The context lives in one slot of the thread’s runtime context, marked by every collection. Review with the user: ambient state is invisible at the call site, which is its point and its cost.

  • Settled on the user’s delegation 2026-11-16 (built on branch request-context): What a new thread takes follows what can cancel it. A scope’s threads (s.spawn, and a withTimeout or withDeadline body) take the whole context, deadline and values, since a cancellation of their scope reaches them. A plain spawn, a future’s code (Future(…), map, flatMap, onComplete, executor.future) and an executor’s task (execute) take the values with no deadline: nothing cancels them when it passes, so a deadline there would be a number nothing keeps; a future’s callback takes the context of the code that attached it, not of the thread that completed the future. An actor’s turn takes nothing, from the code that told it or from a worker: an actor outlives any request, and its turns are not a scope’s threads, as for cancellation. A pool worker runs between tasks with none. Alternatives weighed: everything takes everything (a deadline readable where it is never enforced, remaining() reading zero in a thread still running); nothing but a scope’s threads takes anything (a request id lost at the first Future); an actor’s turn taking the teller’s values (a context then travels with a message, which no other message property does). Review with the user: the actor rule means a request id does not cross a tell, so tracing across actors needs it in the message.

  • Settled on the user’s delegation 2026-11-16 (built on branch request-context): A deadline is kept by cancellation, and its error is withDeadline‘s. withDeadline(t, s -> …) -> Result[T, DeadlineExceeded] is withTimeout with an instant: the body runs on a thread of its own and is cancelled when the time comes, so every existing cancellation point observes it (a socket’s accept, connect, read and write, a pool’s use and lease, a channel’s send and receive, select, sleep, a future’s await, a safepoint poll) and no blocking call gained a new error. Its error is DeadlineExceeded(deadline: Instant), an Error whose message is deadline exceeded. A nested deadline can tighten the context’s deadline and never loosen it: the context keeps the sooner one, and an outer deadline cancels an inner later one with its body. The wall clock is read once, as the scope opens; the deadline then runs on the monotonic clock, and deadline reports the instant asked for, remaining() the monotonic time left, never below zero. Why: a deadline is a cancellation at a time, and the cancellation machinery already reaches every wait, unwinds with deferred statements run, and gives pooled resources back; Result because request code returns Result and ?s it (withTimeout keeps its Option). Alternatives weighed: each blocking call checking the context and answering an error (every wait’s signature and every caller change, and code that computes is never stopped); cancelling the calling thread itself (rejected for withTimeout above). Review with the user: inside the body the deadline is never an error value, it is a stop; code that must tidy up (pg sending a CancelRequest) does it in a defer, whose waits are not cancellation points.

  • Settled on the user’s delegation 2026-11-16 (built on branch request-context): Keys are typed and told apart by identity: Key[T](name). withValue[K: Sendable, T](key: Key[K], value: K, body: () -> T) takes only a value of the key’s type, and value[T](key: Key[T]) -> Option[T] answers that type; the value is held as an Any and recovered by a type pattern inside the library, which reification makes exact, so no lookup casts. Two keys of one name are two keys, so a module’s values are reached by its own key alone. The value must be sendable, since the threads a scope starts read it. Alternatives weighed: string keys (a lookup that must name its type and can be wrong); keys compared by name (two modules’ "id" would collide).

Higher-kinded types, inference without bounds, hole variance and hole bounds (build plan step 2, branch hkt-2)

  • Settled on the user’s delegation 2026-11-15: an unbounded constructor parameter is inferred from the type an argument or the expected type gives F[X], named bare: a data type, class or trait with exactly as many type parameters as F has holes, a subclass by its own name (Crate[A] passed as F[A] is Crate, not its superclass), or another constructor parameter in scope applied to as many arguments. Once F is known, the rest of the argument is held to the type it makes with that type’s own variance, so a covariant argument still widens (both(Some(dog), Some(cat)) for both[F[_], A](x: F[A], y: F[A]) takes A as Animal, since Option is covariant). A type of more parameters, of fewer, a type whose parameter takes a constructor, or one that is no data type, class or trait decides nothing and is reported as “cannot infer F from T: …; write it, as in f[…](arguments)“, the example leaving open the arguments that match the application’s own known ones (Either[string, _] for an F[int] given an Either[string, int]), else the first ones. Why: the spec’s rule (“a type of more is an error asking for F to be written”); the example is the likeliest constructor meant. Alternatives: always leaving the first arguments open in the example (wrong for Either[string, int]); holding the arguments invariantly once F is decided (refuses calls every instance accepts).
  • Settled on the user’s delegation 2026-11-15: a function’s or method’s type arguments taken as a value (k.pick[Dog]) are held to their bounds, as at a call (a fix found in step 2: a method value checked no bound at all, so a bounded method could be instantiated at a type its bound refuses, a constructor at a hole it may not fill among them).

Higher-kinded types, constructor traits and their impls (build plan step 3, branch hkt-3)

  • Settled on the user’s delegation 2026-11-15 (branch hkt-3): a constructor trait’s default bodies are compiled once per implementing constructor: each instance of a constructor trait’s method takes the constructor after its type arguments, and Self stands for it there (the static members Self.pure and F.pure come with step 5, the entry above). Why: a body shared by every conforming type sees Self as an object, but a Self[B] may be an option or another value laid out as no object is, and a shared mapTwice built that way crashed at run time. Alternatives: refusing default bodies in constructor traits (needlessly narrow, and Monad‘s map and map2 come from them).
  • Settled on the user’s delegation 2026-11-15: the methods that meet a constructor trait’s are the type’s own: those its declaration and its impls declare, never a superclass’s. Why: the spec’s rule names “the type’s own methods”, and a superclass’s method answers the superclass’s type, the reason a subclass inherits no conformance. Alternatives: also meeting with inherited methods whose results happen to fit (a foldLeft would; a map never does). Review with the user if a class hierarchy wants an inherited foldLeft to meet Foldable.
  • Settled on the user’s delegation 2026-11-15: two overloads that both meet one trait method are an error at the impl, naming the method. Why: a call through the bound would have two methods to call, and choosing the more specific is a second overload resolution no call site shows. Alternatives: the more specific overload, as a written call would pick (more code, and a choice the reader cannot see); the first declared (arbitrary).
  • Settled on the user’s delegation 2026-11-15: the meeting decides a method’s own type parameters from where they first appear in its parameter types, against the trait’s, then in its result; one still undecided takes its lower bound, and one with none is an error naming it. Every parameter and the result are then checked with what was decided, each seen as the other’s with no conversion (a reference seen as a supertype, as a covariant part is; never a box). Why: the spec’s “whose own type parameters that call decides (a lower bound by its bound)”; the order makes List‘s flatMap(f: (T) -> Iterable[U]) take U from the trait’s List[B] seen as an Iterable. Alternatives: full inference by the call checker (heavier, and its tiers of defaults would decide what the trait’s call does not).
  • Settled on the user’s delegation 2026-11-15: a constructor trait requires only constructor traits, each at its own parameters in order; trait Shown[A]: Functor[A], Display is an error. (Widened by the settled entry of 2026-11-14, branch hkt-7: it may also require a trait for types that bounds constructors.) Why: a trait for types bounds what a value is, and the constructor trait’s Self is no value’s type, so what the requirement would promise is unclear. Alternatives: reading it as a bound on every application Self[A] (a constraint on applications, which impls over constructor parameters, step 6, are the place for).
  • Settled on the user’s delegation 2026-11-15: a constructor trait’s arguments are no position of a variance for the conforming type: List[+T] and Result[+T, +E] conform to Monad[T], an invariant parameter. Why: no value has the trait as its type, so Monad[Dog] and Monad[Animal] are never compared; the subtyping of F[Dog] is the hole’s (F[+_]). Alternatives: none that let a covariant type conform.
  • Settled on the user’s delegation 2026-11-15: a class may state a conformance to a constructor trait in its header, class Crate[A]: Functor[A], held as an impl’s is; the form leaving the trait’s arguments off is an impl’s only. A class’s methods meeting the trait’s need no override, and may write it. Why: a header conformance is one an impl could state, and the meeting methods are the class’s own, which override nothing. Alternatives: requiring an impl for constructor traits (no reason a header could not say the same).
  • Settled on the user’s delegation 2026-11-15: the conformance’s errors are reported at the impl, a meeting’s at the method where the impl declares it and at the impl otherwise: a library type’s method that does not meet is reported where the program’s impl names the trait. Why: the impl is what the program wrote; the library’s method is not the mistake.

Higher-kinded types, inferring a constructor through its bound (build plan step 4, branch hkt-4)

  • Settled on the user’s delegation 2026-11-15: the spec’s third place to look, “the one trait among those it conforms to that has one”, is left out, since no type can reach it. An impl is never for a trait, and a trait that requires a constructor trait is itself one, so a type conforming to it conforms to what it requires at the same holes, as its own; a type conforming to it at fixed arguments (class Digits: Bag[int]) is refused at the declaration. A type is therefore matched as itself, then as its superclasses nearest first, and a type with no conformance there is an error naming the bound and the type. Why: code for a case no program can write would be untested. Review with the user: it returns, with its “several such traits” error, if traits come to implement constructor traits by impls (impl Monad for Seq), which the spec’s pairUp[Seq, …] example presumes and the library step will want.
  • Settled on the user’s delegation 2026-11-15: with several constructor-trait bounds, each conformance the type (or the superclass matched) has decides; two that leave different arguments open are an error naming both (Pair implements Mappable as Pair[int, _] and Lefty as Pair[_, int]), and a bound the type lacks is reported as for a written constructor. Why: the bounds are one demand on one constructor, so the nearest type with any of them is the answer the others are checked against. Alternatives: the first bound written decides (order-dependent); the nearest type with all of them (skips a subclass’s own conformance for a superclass’s, which the spec’s no-inheritance rule forbids).
  • Settled on the user’s delegation 2026-11-15: an argument written out of a constructor joins only where the type’s parameter is covariant and the argument a reference type known at that argument; the expected type, checked first, fixes it. second(dogs, cats) makes F Result[_, Animal]; with val r: Result[int, Dog] = second(dogs, cats) the expected type has made F Result[_, Dog] and the cats are refused. Why: the expected type decides type arguments before the arguments do for every generic call. An argument the first argument leaves unknown (Ok(1)‘s error type) is decided by the next, as an invariant one is.
  • Settled on the user’s delegation 2026-11-15: inference sees a subclass as its superclass, or a type as a trait, only where a value is read out (a fix found in step 4, which matching through a superclass’s conformance meets): at an invariant argument or a function’s parameter, inference held a Box[TallShelf[int]] to be a Box[Shelf[A]], and a (Dog) -> int an (Animal) -> B, so generic code could store a Shelf in the box or pass a cat to the function, reading memory that was never a TallShelf‘s or a Dog‘s. Both are now refused; a type that is the class itself is still taken there.

Higher-kinded types, static members on constructors (build plan step 5, branch hkt-5)

  • Settled on the user’s delegation 2026-11-15: a constructor named bare, or with _ for the arguments it leaves open, has as its static members those of the constructor traits it implements at exactly those holes, each conformance held as a constructor argument’s is (the holes the impl leaves open, the arguments written out meeting the impl’s bounds): Option.pure, Result[_, E].pure, Parsed.pure for an alias that is a constructor, and Box[_].pure, the same as Box. Result[int, _].pure is an error saying Result implements the trait as Result[_, E]. Why: a static member of a constructor trait names no parameter of the trait, so the constructor is all a call needs, and the conformance says which constructor it is. Alternatives: look the member up on the type at any arguments (would let Result[int, _] reach a member of the conformance at the other hole).
  • Settled on the user’s delegation 2026-11-15: a static member of a type’s own conformance to an ordinary trait is not reached on the type named bare: Box.make() for impl[T] Make for Box[T] is an error asking for the type arguments (Box[A].make(…)), as before. Why: that member’s types name the type’s parameters, which a bare name leaves unknown. Alternative weighed: inferring them from the call as a generic function’s are (a separate feature, not part of constructors).
  • Settled on the user’s delegation 2026-11-15: a constructor trait’s static member still takes no default body, as every trait’s static member does: defaults that call Self.pure are its methods’. Why: the rule for static members is one rule for every trait; the per-constructor compilation would allow it, so it can be added later without changing anything written now. Review with the user if the library wants a derived static member (a Monad.unit from pure).
  • Settled on the user’s delegation 2026-11-15: two bounds that each declare a static member of one name and parameter types make a call of it on the parameter ambiguous, by the ordinary overloading rule, rather than one bound being preferred. Why: nothing says which constructor’s member is meant beyond the bounds.
  • Settled on the user’s delegation 2026-11-15: a static member called on a value of F[X] is an error pointing at F.pure(…); on a value of a known type, Some(1).pure(2), the existing message names the type. Why: the member is the constructor’s, and the constructor is what the call writes.
  • In each instance a static member called on a constructor is compiled once per constructor: the type’s own member at Nothing for the holes, which it never names, so Option.pure and F.pure at Option are one instance.

Higher-kinded types, impls over constructor parameters (build plan step 6, branch hkt-6)

  • Settled on the user’s delegation 2026-11-15: an impl adding to F[A] belongs to the trait bounding F: written in the module of one of F‘s bounds (or in the core library) it is that trait’s own and seen everywhere, and written anywhere else it is an extension. With F[G[A]] it is F‘s bounds, the head’s, that count. Why: such an impl adds to every type the bound’s conformance reaches, as impl[T] Seq[T] adds to every sequence, and that impl’s home is the trait’s module. Alternatives: always an extension (would make the library’s own impl[F[_]: Monad, A] F[A] need an import of its own module); any module of any bound named in the impl (blurs which module owns it).

  • Settled on the user’s delegation 2026-11-15: such methods are found after the type’s own, wherever the impl is written: a type’s own method, or the bound’s, of the name and parameter types is called, and a call that sees only the bound, in generic code, calls the added one. Why: the impl adds to a family of types as an impl adding to a trait does, and that is the trait rule; the rule for impls adding to one type built from parameters, which makes a clash with the type’s own method ambiguous, would make every type that has, say, its own twice unusable once the library adds one. An extension adding a method the bound already declares is an error where it is declared (map on Mappable).

  • Settled on the user’s delegation 2026-11-15: the constructor parameter need not be bounded: unbounded, F is matched as inference matches it without a bound, a type of exactly as many arguments as F has holes, named bare. Why: it is the inference rule, unchanged, and refusing it would add a rule; such an impl’s methods reach nothing of F[A] but can pass it on. Alternative: require a constructor trait bound (an error naming the bound to add). Review with the user if the unbounded form should rather be an error.

  • Settled on the user’s delegation 2026-11-15: a receiver whose type no such impl matches is told why: twice on a Plain[int] says the method is for F[A] where F implements Mappable and that Plain does not implement it, the reason inference gives; an F[int] whose F lacks the bound says its constructor is bounded by no Pointed. Of several such impls adding the name, only one is named, since every generic type is an instance of each; an impl adding to a type the receiver is an instance of, Option[Option[T]], is named first.

  • Settled on the user’s delegation 2026-11-15: a function value of an extension method the file does not see, or of a private added method, is reported as a call of it is (“shout is added to string by module extras, which this file does not import”), where it said only that the type has no member. This holds for every extension, not only those over constructor parameters.

  • No impl of a trait is for F[A]: a conformance is a type’s, stated once for it, and an application of a constructor parameter is no type of its own. The impl declares no static member, as no impl adding to a type built from parameters does.

  • Settled on the user’s delegation 2026-11-15 (built on branch rendezvous): a rendezvous is Channel[T](0), and a channel with no capacity stays unbounded through a default of unbounded, a public val in avin.threads holding the largest int. This replaces the settled “unbounded at zero”. Why: zero is the capacity that holds nothing, so reading it as a hand-off says what it is; Channel[T]() keeps its meaning, so no program changes (none in the tree passed 0); and an unbounded channel is the bounded one at a bound it can never reach, so it needs no case of its own. Alternatives weighed: keeping zero unbounded and adding Channel.rendezvous[T]() or a rendezvous flag (a second spelling of capacity, and zero would still read wrongly); capacity: Option[int] = None (every bounded channel would write Some(n)); a negative sentinel such as -1 for unbounded (a capacity that is not one, and a negative one traps). Review with the user: it changes what an explicit Channel[T](0) means, from unbounded to a rendezvous.

  • Settled on the user’s delegation 2026-11-15 (built on branch rendezvous): a rendezvous hands values to waiting parties directly, and a select’s arm is a party that a partner claims. A plain sender or receiver waits on a condition of its own until a partner completes it; a select’s arm on a rendezvous stands on the channel while it waits, and a partner completes the arm only by first ending the select’s wait through that arm (select_claim in runtime/avin/rt/select.sysl), so no select runs two arms. A select can be claimed only once every arm of its round is tried and enlisted; a partner that meets one still trying its arms wakes it (a poke), and the select, trying that arm again, waits out a partner select still mid-round rather than missing it. Why: it keeps the one-lock-at-a-time select of buffered channels, and the claim is the one atomic step that decides an arm. The receiver “has the value” once a sender completes it, so a receiver cancelled after that stops with the value. Alternatives weighed: a sender depositing its value and waiting for it to be taken (a select’s send arm cannot deposit without committing to it); locking every channel of a select at once (a lock order across channels, and a different design for every select). The sender’s wait is its own kind in the thread dump and deadlock report, “waiting to hand a value to a receiver”.

  • Settled on the user’s delegation 2026-11-15 (built on branch hkt-9): a diagnostic’s article follows how a type’s name is read. A capital letter standing alone at the start of a name (F[int], T, X2) is read as the letter, so it takes an before A, E, F, H, I, L, M, N, O, R, S and X and a otherwise (an F[int], a T, a U); any other name takes an before a, e, i, o in either case and a before u (a unit, a usize, a Unicorn), one helper (article in check.sysl) for every message. Why: constructor and type parameters are single letters, and “a F[int]“ read wrongly; the type names that begin with u mostly sound a consonant. Alternatives weighed: treating u as a vowel, as three of the four old helpers did (“an unit“); reading every all-capital name as letters (an HTTP, but a NASA reads as a word, and no type name in the library is one).

  • Settled on the user’s delegation 2026-11-15 (built on branch c-void-ptr): a C binding’s void * or const void * parameter takes an array of any element type an array crosses as, or a ByteBlock, and its length counts bytes. The array’s elements go to C where they are, as for a typed pointer, with no element type checked against the header (there is none to check); the parameter marked length(p) is told the array’s length times its element size, a long, and an inout length C writes back is bytes too, bounded by the array’s bytes. None, or the word null, passes null. C writes through void * and only reads through const void *. Still refused: out or inout on a void * (C writes no value of a type through one), a void * result other than one discarded by a unit binding, and an array whose length no parameter carries, so memcmp‘s second pointer is refused. Why: the gap was met by marshal’s sysctlbyname, the shape of the C library’s every untyped buffer (read, write, getentropy, sysctl); an array and a block are already the binding layer’s memory, so this adds no new kind of value, only drops the element check, and counting bytes is what every such C function means by its length. Alternatives weighed: an Array[byte] only, decoded in Avin (sound, but reading an int or a long would need a byte decoder in every program, and no such helper exists); out int *p written in the prototype where the header says void * (breaks the rule that a prototype is the header’s, and needs a size for the length); a length in elements (wrong for every void * function, which counts bytes); a shared length(a, b) for memcmp-shaped functions (useful, but a separate feature). Review with the user: whether a shared length is wanted, and whether a callback’s const void * should lend a ByteView, which is still refused.

  • Settled on the user’s delegation 2026-11-15 (built on branch c-opaque-errno): a pointer to an opaque pointer is memory of no type: void **, and a pointer to a typedef the headers make void * or const void * (rusage_info_t *), take what void * takes, their length in bytes; C fills an array through out void * or out T * with T such a typedef, its length: counting bytes, rounded up to whole elements, the rest zero; and C fills a struct mirror through out void *, out void ** or a pointer to a typedef. The prototype is still the header’s: rusage_info_t *, held to the header exactly. Only the headers say what a typedef is, so the C unit checks an array’s elements through a pointer to a typedef as the typedef’s elements or the typedef being void *, and measures which, beside the integer measurements, for lowering to count the length in bytes or in elements; a mirror’s typedef is checked to be its struct or void *. Memory of no type C allocates (out void ** with array: or bytes:) is an Array[byte], since its length in bytes need not be a whole number of wider elements, and copying a rounded-up count would read past C’s allocation. Why: marshal’s proc_pid_rusage needed a process’s physical footprint, and every form it tried was refused; the typedef’s kind is decided where the spec decides every typedef’s, by the Avin type and the C unit’s check. length: counts bytes for memory of no type as length(p) does, so sizeof(struct rusage_info_v2) is written as the header says it. Alternatives weighed: a word in the prototype marking the pointer untyped, or a cast ((void *) rusage_info_t *buffer), which the C unit’s measurement makes unnecessary; a length: in elements for memory C fills (consistent with typed arrays, but the binding would divide the struct’s size itself); a mirror field for a fixed array (uint8_t ri_uuid[16]), which would make the struct mirrorable, left for when a program needs a field after one rather than the array form. Review with the user: fixed-array fields in struct mirrors.

  • Settled on the user’s delegation 2026-11-15 (built on branch c-opaque-errno): a binding marked errno answers Err of errno where C answers -1, Result[T, Errno] or Result[T, <integer>], its Ok split as a result that is not a status is (the C result kept as an integer or left out, then the out values). The bare word follows blocking‘s form. errno is read by the C unit’s glue straight after the call, written through a pointer the binding passes after the arrays’ lengths, so nothing — a length: expression, a blocking call’s return to the scheduler, a collection — runs between the call and the read; the binding is always called through glue. The failure is the -1, not errno (a function may set errno and succeed); a C result of an unsigned type fails at all ones. avin.c.Errno is a data type of the standard library with a case per POSIX error number both macOS and Linux define, named as C names them (ESRCH, ENOENT), and Other(code); its message is the number’s sentence, the same on every platform. The C unit measures each case’s value by its macro (<errno.h> is included for a program with an errno binding), and lowering compares the number against them. Why: the C bindings’ first decisions named an errno flag answering Result[T, int] from a -1 result as the likely form; named cases let a program match Err(ESRCH) without knowing a platform’s numbers, and C’s own names are what a reader of a man page looks for. Alternatives weighed: mapping to io.IoError (loses ESRCH and EPERM, which it has no kinds for); an enum mirror in the library (needs a C unit for every program and traps on a number no variant holds); PascalCase descriptive names (NoSuchProcess), which a man page does not use; a null pointer result as the failure too (not built: a handle or string answered with errno is still refused, the C result being an integer). Review with the user: the C names as variant names, and errno on pointer results.

  • Settled on the user’s delegation 2026-11-15 (built on branch c-opaque-errno): avin check builds the C unit, revising check-stops-early (2026-11-06) for C: a binding the headers refuse (a prototype the header contradicts, an array’s elements, a typedef’s kind, a constant) is refused by check as by build, run and test. Why: marshal met a binding check passed and test refused; the C unit is one clang compile, cached by its source’s hash, far cheaper than the shims and the lowering check gave up, and only C bindings make one. The Sysl shims stay behind --bindings. Alternatives weighed: keeping check silent and documenting it (the disagreement marshal met); moving the checks into the checker (impossible: only the headers know a typedef).

  • Settled on the user’s delegation 2026-11-15 (built on branch test-orphans): a program avin run or avin test starts watches its runner and ends when the runner does, even one killed with SIGKILL; and avin run contains its program too, closing the known limit of runner-orphans (2026-11-12). The runner names itself in AVIN_RUNNER_PID; the runtime, as a program starts, takes the variable out of its environment and, only when the process it names is the program’s parent, starts a thread that waits for that process to exit (a kqueue EVFILT_PROC/NOTE_EXIT on macOS; elsewhere a check of the parent every 100 ms). When the runner is gone the program sets its own SIGTERM aside, sends SIGTERM to the group it leads (or to itself when it leads none), waits 200 ms, and sends SIGKILL. A program started any other way, or with the variable naming a process that is not its parent, watches nothing. avin run started away from a terminal now starts its program as the leader of a group of its own, passes SIGTERM, SIGINT and SIGHUP on to the group, kills it 2 s after the first if it is still running, exits with the program’s status, and stops whatever is left of the group once the program has ended. Started at a terminal as its foreground job, avin run keeps the program in that job, so the terminal’s Ctrl-C and Ctrl-Z and the shell’s job control reach both as before; it passes on SIGTERM and SIGHUP to the program alone and lets the program decide what Ctrl-C means. Why: four test programs of 0.0.21 runs were found alive after 37 h at PPID 1, one still holding a port another project’s tests then collided with: runners killed outright (a deadline, a stopped agent) cannot act, and avin run did not contain its program at all. Alternatives weighed: a thread in every program that polls its parent (a cost for programs nobody runs under a runner, and on macOS a kqueue waits for free); Linux’s PR_SET_PDEATHSIG (fires when the parent thread that started the child ends, and runners start programs from worker threads; macOS has none); keeping the terminal case in a group of its own given the terminal (foreground), which would leave a Ctrl-Z stopping the program alone while avin run waits for it, wedging the shell; a longer grace for the watch (the runner that would have waited is gone). Known limits: at a terminal, a program’s own children are not reached when avin run is killed outright, only the program; a program that ignores the runner’s death by leaving its group or session is beyond reach. Review with the user: the terminal case keeping the program in the shell’s job.

  • Settled on the user’s delegation 2026-11-15 (built on branch api-observe): a request knows its client’s address and its route (system library). ServerRequest gains remote (the peer’s IP address, numeric, without its port) and route (the pattern of the route a router chose, set by Router as it binds the parameters), and ByteStream gains remoteAddress, None by default, which TcpStream (accepted and connected) and TlsStream answer. Why: a rate limiter keys by client by default and a metric labels by route; a path as a label would grow without bound, and the address was being dropped at accept. The address is without its port, since a client opens many connections and is one client. Alternatives weighed: wrapping Routes in a metrics-specific function that knows each pattern (no help for the access log or a program’s own middleware); taking the address from X-Forwarded-For (anyone can send it; a program behind a proxy gives the limiter a key that reads it). Review with the user: whether remote should also carry the port.

  • Settled on the user’s delegation 2026-11-15 (built on branch api-observe): the access log. http.accessLog(sink, format, clock, ids) is a middleware, writing after the handler answers, in two formats, PlainLines and JsonLines, with method, decoded path (escaped so the line stays one line of fields), status, body length, duration, request id and address. No timestamp: whatever collects standard error stamps lines, and a test’s lines stay fixed. The query is left out, as it can hold secrets. A client’s X-Request-Id is kept when it is 1 to 128 characters of letters, digits and -._:+/=@, else replaced by 16 SecureRandom bytes in hex; the handler reads it from the request’s own header, which withHeaderReplaced sets, and the response echoes it unless the handler set one. A streamed body of unknown length logs -/null and not the bytes written, since the line is written when the handler returns, before the body is. Alternatives weighed: a common/combined log format (no request id, timestamp in brackets, request line quoted with the query); counting a streamed body as it is written (the line would wait for the stream to end); a request-scoped value in place of the header (that mechanism is a separate branch, api-request-values; the header is what clients and proxies already read). Review with the user: a handler that traps writes no line, since Avin has no unwinding; logging the server’s 500 would need a hook in serve.

  • Settled on the user’s delegation 2026-11-15 (built on branch api-observe): request metrics. Metrics holds per-(method, route, status class) counters and per-(method, route) histograms of fixed buckets in one Mutex, plus an atomic in-flight gauge, rendered as Prometheus text format 0.0.4 with the names http_requests_total, http_request_duration_seconds and http_requests_in_flight; times are whole microseconds, written as seconds without trailing zeros. Default buckets are the usual 5 ms to 10 s. A request with no route is labelled "". Why: one lock per Metrics is simple and exact, and a request does a few map updates under it; the format is what every scraper reads. Alternatives weighed: per-route atomics (route series are created on demand, so a map and a lock are still needed); a metrics registry of general counters and gauges (more than this item needs; observe covers counting another way); labelling by status code rather than class (more series for little gain). Review with the user: a handler that traps leaves the in-flight gauge one too high, for the same lack of unwinding.

  • Settled on the user’s delegation 2026-11-15 (built on branch api-observe): rate limiting. RateLimiter(rate, per, burst, key, maxKeys, clock, errors) is a token bucket per key, computed as each bucket’s next-token time in integer microseconds (the generic cell rate algorithm, exactly a token bucket), so a bucket is one long and needs no floating point. A full bucket equals a new one, so forgetting it loses nothing; at maxKeys, making a bucket forgets every full one, or where none is full the one nearest to full. A 429 carries Retry-After in whole seconds, rounded up and at least one. Alternatives weighed: refusing a new key when the table is full (a flood of addresses would lock every new client out); a periodic sweep on a timer thread (a thread per limiter; sweeping when room is needed bounds memory the same); a sliding-window counter (less smooth, more state). Review with the user: evicting a bucket that is not full forgives that client’s debt, which an attacker cycling more than maxKeys addresses can use; and the default key, the client’s address, puts every client behind one proxy in one bucket.

  • Settled on the user’s delegation 2026-11-23 (built on branch http-cors): CORS middleware. Cors(origins, allowOrigin, methods, headers, exposed, credentials, maxAge) with a middleware. Origins match exactly (a browser’s origin is serialized in lower case, and its own check is exact); * with credentials traps at construction; with credentials the origin is echoed, never *, and Vary: Origin is merged into the handler’s. A preflight is always answered 204 by the middleware, granting nothing (no CORS header) for an origin, method or header not allowed, which is how a browser is told to refuse; empty headers reflects the requested ones. Defaults are the safe ones: methods GET, HEAD, POST, no credentials, no max age. A disallowed origin’s actual request is still handled (it carries Vary: Origin so a cache keeps the answers apart). Alternatives weighed: forwarding a disallowed origin’s preflight to the handler (the handler would answer a route’s 405, a confusing signal and extra work); case-insensitive origin matching (not what a browser does); a wildcard that echoes with credentials (the Fetch standard forbids * there, and an echo of any origin with credentials is an open door, so allowOrigin must be asked for). Review with the user: empty headers reflecting any requested header is the common default but allows more than a closed list would.

  • Settled on the user’s delegation 2026-11-15 (built on branch resolve-blocking): which library bindings are blocking. Name resolution (sysl.net.resolve, which TcpStream.connect calls; since 2026-11-16 made on a helper thread instead, below) and connecting a Unix socket are, as are reading, writing and opening a file in avin.fs and avin.process‘s redirections (the whole-file calls, File‘s read, write and flush, and every open), and reading a time zone’s file: each can wait on a pipe, a FIFO, a device or the network. Asking about a path, listing a directory, creating, removing and renaming entries are not, nor are closing a file, spawning a process, reading the OS’s entropy or the in-memory TLS engine. A test in shim_tests.sysl names each waiting binding a program reaches and asserts it blocking. Alternatives weighed: binding every file-system call blocking (the metadata calls do not wait on another party, and each blocking call is copied across); only the calls that touch the network (a FIFO open or read held its worker and every collection, which tests/run/fs_fifo_blocking.avin shows). Review with the user: a directory operation on a network file system can also wait, and standard input and output, which the runtime reads and writes through intrinsics rather than bindings, are not yet safe for the collector while they wait.

  • Settled on the user’s delegation 2026-11-16 (built on branch resolve-cancel): a host-name lookup is a cancellation point. As a blocking call it was not: a withTimeout waits for what it cancelled to end, so a slow resolver held a connect’s time limit past its deadline (a 100 ms withTimeout around a connect whose lookup took 3 s answered after 3009 ms). The runtime (runtime/avin/rt/lookup.sysl) makes each lookup on a helper thread and the caller waits for a byte on a pipe as it waits on a socket, so a cancellation ends the wait at once; an abandoned lookup runs on to the resolver’s answer, which its helper throws away before closing the pipe. The host, port and answer are copied into a slot and out again under one lock, so nothing either thread holds is shared. Helpers are detached, take the oldest queued lookup, and end once none is queued; at most 64 run at once, which bounds how many abandoned lookups can still be running. Past the bound a new lookup waits in the queue, and a cancellation drops it from there. A numeric address is resolved inline. A lightweight thread waiting on a lookup shows in a thread dump as “looking up a host name”. Tests hold the helpers through a runtime hook (resolve_hold), since no resolver that never answers can be stood up without system configuration on every platform. Alternatives weighed: one detached thread per lookup with no bound (abandoned threads pile up without limit while the resolver is down); failing a lookup at once past the bound (fails lookups of hosts that would answer); the platform’s asynchronous resolver (getaddrinfo_a is glibc’s alone, and macOS’s is a different API); a resolver of Avin’s own speaking DNS (loses /etc/hosts, NSS and the system’s configuration). Review with the user: whether lookups of the same host and port in flight at once should share one helper, which would keep repeated retries during a resolver outage from filling the 64.

  • Settled on the user’s delegation 2026-11-17 (built on branch byte-writer, for the PostgreSQL package’s COPY … TO STDOUT): avin.io.ByteWriter is the byte sink beside Reader (ByteWriter): one method, write(bytes: Array[byte]) -> Result[unit, IoError], writing all of bytes. fs.File, every net.ByteStream (TcpStream, UnixStream, TlsStream), net.StreamWriter and http.BodyWriter implement it by the write they already had, so no call changes; ByteStream and StreamWriter now take write from the trait instead of declaring it. The name: the pair of Reader would be Writer, but the prelude’s Writer (module avin, seen by every program unqualified) is the text sink values render into, so avin.io.Writer would make Writer mean two things in any program importing it, and Display‘s display(out: Writer, …) would read as the wrong one. Alternatives weighed: Write (a verb, as Close is; but avin.net already has a Write case of how a socket is shut down, and Write/Writer side by side invite the wrong one); Sink (short, but avin.io‘s Source is a TEXT source, so Sink reads as its text pair); Output (says nothing of bytes, and reads as a command’s output); ByteSink. ByteWriter says what it takes and pairs with ByteStream. No flush(): files buffer and sockets do not, so a flush on the trait would be a no-op for most implementations, and TLS keeps a private flush of its own that a public one would collide with; whoever opened a file closes it, which flushes. Not a Close, as Reader is not: a BodyWriter is ended by its response, not closed; code holding a resource that is both bounds it by both. io.copy(from: Reader, to: ByteWriter) -> Result[long, IoError] copies in pieces of at most 64 KiB, answering the count or the first Err, closing, flushing and rewinding nothing. Standard output and standard error stay text-only Writers: they have no byte path to write through. No in-memory byte sink is added: a Buffer[byte] is filled by addAll, and a sink of the program’s own is a five-line class. Review with the user: the name ByteWriter (against Write or Sink), and whether standard output should gain a byte path and be a ByteWriter too.

  • Settled on the user’s delegation 2026-11-17 (built on branch cbind-gaps, for the libssh2 binding): a function pointer marked null is passed null (C bindings). libssh2_session_init_ex is the only way to make a session (libssh2_session_init() is a macro passing four nulls), and a function pointer without a userdata was refused with no way to pass null. The prototype word null, which already passed null for any other pointer, now takes a function pointer too; its parameters are read only as C’s types for the header check (named, no userdata or length, any result), since C never calls it. Refused: null twice, after out, on a struct by value or a scalar, and an unnamed function pointer. Alternatives: an Option[function] parameter with only None legal (a parameter whose one value is written at every call, and an Option that never holds Some); binding a header macro (libssh2_session_init), which the C unit cannot type-check as a function and which most hooks have no macro for.

  • Settled on the user’s delegation 2026-11-17 (built on branch cbind-gaps): a kept handle no C reference can hold is kept from the collector until its holder’s release has run (C bindings). libssh2 counts no references, frees every channel in libssh2_session_free, and reaches the session from libssh2_channel_free; a channel and its session found dead in one collection were finalized in address order, so the session could go first and the channel’s release free it again. kept: may now name a class with no retain (or with a kept: of its own): the holder pins the kept handle’s Avin object in a runtime table, a root of every collection, and lets go of the pin after its own release, by close() or its finalizer; the kept one is finalized in a later collection. Its kept: name is the kept handle’s pointer, or null once that handle was closed, so the release can tell (session ? libssh2_channel_free(self) : 0). A chain is finalized one link per collection, holder first. A cycle through a pin is never collected (a session keeping, as its Avin object, a channel that pins it): both are given back once either is closed. Why: the collector finalizes in address order and a finalizer cannot resurrect, so ordering can only come from keeping the kept object reachable until the holder is done; a root held per holder does that with no change to the collector. Alternatives: collector-ordered finalization (topological, as some collectors offer; the gc library has none, and Avin does not change it); the holder’s release given back without its kept object, on trust (the unsound state this replaces); a retain: of the package’s own (libssh2 has no count to take). Review with the user: that a cycle through a pin leaks until closed, rather than being refused.

  • Settled on the user’s delegation 2026-11-17 (built on branch cbind-gaps): a handle holds C integers for its release:, holds: on the class and hold: on a binding (C bindings). libssh2 is given the socket of an Avin TcpStream and writes to it in libssh2_session_free; a stream finalized first, or closed by the program first, gives its descriptor’s number to the next one opened, so the session’s farewell could reach an unrelated connection, and a release that sees only self cannot say which socket it used. A class declares holds: "int sock = -1", a C declaration of an integer and the value it starts as; a binding’s hold: "sock" makes the handle it answers, or its receiver, hold the value of that integer parameter when the call succeeds, replacing one held before; the release uses it by name. The value is an entry on the list the glue keeps of what the handle holds, beside its C references, so the layout of a handle does not change. The package holds a descriptor of its own, duped from the stream’s, which makes the session’s release sound whichever object the collector finalizes first and whether the stream was closed before. Refused: holds: on a shared class or one with retain: (one reference of many), a name release: does not use, self or the kept: name, a declaration that is no integer; hold: naming no integer parameter, or a name the holder’s class does not declare, or on a binding answering no handle and no method of one. Alternatives: the kept stream pinned until the session’s release, as kept handles now are (the release still could not read the descriptor from an Avin object, finalizers running no Avin code, and a stream the program closed first would hand the release a number already reused); holding the stream’s own descriptor without dup (the same reuse); a C handle over the descriptor (a handle is on a pointer). Review with the user: whether holds: should also take pointers.

  • Settled on the user’s delegation 2026-11-17 (built on branch cbind-gaps): free: frees a string C answers through an out pointer by an entry "name: how" (C bindings). libssh2_channel_get_exit_signal answers three strings freed by libssh2_free(session, p), and free: covered only a result. how is a C function of the string or a C expression in its name, compiled in a glue function per string that a method passes its receiver’s object: the expression may use self, the receiver class’s kept: name and the values it holds: (here the channel’s kept session). It is called once the copy is made, never for null, and on a failed status for each string C answered, unread. Refused: a name that is no out parameter answering a string or its bytes, inout (C may answer the copy it was passed), a name freed twice, an expression not in the name, and named entries beside arrays array: frees by position. Why the spelling: free: already says how what C answers is freed, and name: reads as the kept: "face: Face" entries do; a name is needed because a binding answers several strings. Alternatives: a separate key (frees:), a second word for one idea; any parameter of the call in the expression (the strings C was passed are freed once converted, before the outs are, so only the receiver’s own names are offered); copying the string in the call’s glue and freeing it there (a second copy of every string).

  • Settled on the user’s delegation 2026-11-17 (built on branch pool-check-cancel, for the PostgreSQL package’s pool under deadlines): a Pool call cancelled while validate checks a resource puts the resource back as one given back is put back (Pool): idle, or to the first call waiting, destroyed only where the pool was closed meanwhile or the resource has outlived maxLifetime. It was destroyed. A deadline (withDeadline, withTimeout) cancels a thread, and a function entry or a loop’s back edge is a cancellation point, so a deadline passing just as an idle resource was taken stopped its check even where validate never waits, and good resources were destroyed: up to 5 of a pool of 4 in a round of 100 calls under short deadlines. Why it is sound: every resource is checked before it is lent, one handed to a waiter included, so one a stopped check left in a bad state (a ping half sent) is caught and destroyed at its next lend. Alternatives weighed: running validate where cancellation cannot stop it (a check that blocks, a ping to a server that does not answer, would then hold the caller past its own deadline until the check’s own timeout); destroying the resource only where validate had begun to wait (the pool cannot see inside the check, and a resource cut off mid-exchange is caught at its next check either way). Of the pool’s other cancellable steps, a cancelled create already gives its place up, or keeps what it made, and a cancelled f already gives the resource back; destroying outlived and closed resources runs where nothing stops it.

  • Settled on the user’s delegation 2026-11-18 (built on branch static-link, for tend’s one self-contained binary): a program links its C libraries from their static archives when its manifest says static-c-libraries = true (C bindings). The user decided that static linking is avin’s own item; the shape is this branch’s. One top-level key of the root package, a boolean; a dependency’s is not read, since how a program is linked is decided once for the whole of it, and a library package deciding it would decide for programs it never sees (Sysl’s link key, root-only for the same reason). For every library a pkg-config module finds, of every package in the program, the build asks pkg-config --static --libs, which adds what the library links privately (Libs.private), and replaces each -l<name> whose lib<name>.a is in one of the answer’s -L directories by the archive’s path, the only spelling that reaches an archive on macOS, where the linker takes a .dylib over a .a in the same directory. A name none of those directories holds is the system’s own (libSystem, libz) and stays dynamic. A name whose shared library is in one of them but whose archive is in none stops the build with an error naming the shared library and the archive it lacks, where Sysl’s link = "static" links such a library dynamically and says so only under --verbose: a program asking for static libraries exists so that the machine running it needs nothing installed, and a silent .dylib is the very program the key is there to prevent. A library named by link is passed as -l as before. Alternatives weighed: a per-library static = true in c-libraries (the library’s author would decide for every program, and a program could not ask for a dependency’s library); Sysl’s link = "static" | [names] with a --link flag (a top-level link beside the link of a C library meaning -l names would read as one key with two meanings; a list of names and a flag can come later without changing this one); a --static-libs build flag alone (how the program must be linked is a property of the program, and a release built without the flag would quietly need Homebrew). Review with the user: the key’s name and its boolean shape against Sysl’s link; that it is stricter than Sysl’s "static"; that a library pkg-config gives no -L directory for counts as the system’s, which on Linux leaves a distribution’s /usr/lib libraries dynamic; and that the C libraries of a program’s Sysl packages (requires { pkg_config }) are not covered.

  • Settled on the user’s delegation 2026-11-18 (branch contra-infer): inference holds an argument to its parameter by each type argument’s variance, and a type argument named at a contravariant argument is decided as the type given there. take[T](b: Box[B, T]) for Box[-I, +T] accepts a Box[A, int] where B is an A and takes T as int, as the non-generic takeInt(b: Box[B, int]) always did; the same holds for a function type’s parameters ((A) -> int given for (B) -> T) and a constructor parameter’s contravariant hole. feed[T](b: Box[T, int], x: T) given a Box[A, int] takes T as A, the largest type the box accepts, and a later argument must be an instance of it; an earlier argument that widened T beyond it is an error. Why: the spec says constraints are subtype constraints, and the checker unified a contravariant argument for equality, refusing calls the same signature accepts without type parameters (it blocked the parsing library’s Rule[-I, +T]). Alternatives weighed: collecting upper bounds and solving to their meet, so two boxes of As and of Bs given for one Box[T, int] in either order take B (more complete, but needs a meet the checker has nowhere else; with the order as written the box of Bs first is accepted today, the other order is refused); deciding such a type argument from the other arguments only (would refuse the probe above whenever T is named nowhere else). A type argument named at a contravariant argument nested in another contravariant one is still held whole. Review with the user: whether the meet is worth adding when a program meets the order-dependent case.

  • Settled on the user’s delegation 2026-11-18 (branch stdin-serialize): threads read standard input one at a time, and each read is whole (system library). A readLine, an iterator’s step, a character and readAll each hold the input from their look at whether it has ended to their taking of what they read, so a line goes to exactly one reader, never split between two or given to both, and a reader past the end gets None, never a stray empty line. Found because nothing serialized the one buffer: two lightweight threads reading at once hung (both parked on the descriptor) or trapped out of range in the runtime. The lock is a runtime lock of the library’s kind (ParkLock, held across the reader’s wait for input): a lightweight thread waiting for it, or waiting for input while holding it, parks, so neither holds up a carrier; it is a region a trap is not contained in, as any lock’s is, so a contained trap never leaves it held. An iterator over standard input takes the line (or character) hasNext answers for and keeps it until next, since otherwise another thread could take that line between the two and next would fail on a hasNext that said true. On one thread this is seen only by code that asks hasNext and then reads by another way: the other read gets the line after the one the iterator holds. Alone, a reader pays two uncontended lock operations per read (2M lines: 0.136 s before, 0.139 s after). Alternatives weighed: a lock taken inside each runtime call only (the library’s look at the end and its take are two calls, so a reader could still get Some("") past the end); an OS lock (held across the wait for input it would block a carrier, and a thread parked holding it would resume on another carrier and let go of a lock it does not own there); a Mutex in avin.io (the same lock, with an object to keep alive and the module made to depend on avin.threads); an iterator whose hasNext takes nothing (racy across threads, as above). Review with the user: the iterator’s taking of its line at hasNext.

  • Settled on the user’s delegation 2026-11-18 (built on branch typaram-bound, for the parsing library’s Rule[-I: Reader, +T]): a function’s or a method’s own type parameter may be bounded by a type parameter declared before it, [J: I] (generics), the twin of the lower bound [W >: T]. A J is an I with no conversion and has I‘s bounds; each type argument must be the bounding one’s or be seen as it as a covariant part is (so a value type never stands for a trait there); the bound is a position where a value is passed in, so a -I may bound one and a +T may not; an override writes the overridden method’s bound or none. Choices this branch made: only a function’s or a method’s own parameters take one, as only they take a lower bound (a type’s own [A, B: A] would need its own variance rule, the opposite of a method’s, and no program needs it yet); the bounding parameter is declared before it (the enclosing type’s or impl’s, or earlier in the list), which rules out cycles by construction and makes [A: B, B: A] an error at its first bound, where lower bounds allow a later parameter and check for a chain leading back; one at most per parameter (two would be an intersection of two unknowns, which no instance needs); inference takes the narrower: a type argument decided where a value is passed in takes the bounding argument when that is a subtype of the type given and not the other way round (digit() | success(4) is a Rule[Input, long], not an error), and a bounding parameter nothing else decides is taken from the one it bounds. Alternatives weighed: refusing digit() | success(4) and making the caller write |[Input] (correct but unpleasant at the most common call shape); allowing a later parameter with a cycle check, as lower bounds do (more to say for no program that needs it); a type’s own parameters bounded too (sound only for a covariant or invariant bounding parameter, a rule that can come when a program asks). Review with the user: the declared-before rule, which differs from the lower bound’s.

  • Settled on the user’s delegation 2026-11-18 (branch contra-join, for the parsing library’s token streams): branches join at a contravariant argument to the meet of the two arguments, and a fully known expected type wins over a join that misses it (generics). In[A] and In[B] for In[-T] agree on In[B] (they fell back to a trait both share, Display where an impl gave one, and then missed an expected In[B]); a function type’s parameters join the same way and its result as a covariant argument, so (A) -> int and (B) -> int agree on (B) -> int (they agreed on nothing). Choices this branch made: the meet is one of the two arguments, the one that is a subtype of the other (Nothing included); where neither is, no type is named as the meet and the class join does not exist for the pair, so the fallback to a shared trait stands, as for two classes with no common superclass. Where the expected type is fully known (no inference variable left in it), a reference type, and what the branches agree on is not an instance of it while both branches are, the branches agree on the expected type: a Dog and a Cat that are Animals and Pets agree on Pet where a Pet is expected (they agreed on Animal and failed). Where neither the agreement nor a branch is an instance of that expected type, the branch (or match arm) is reported, “this branch yields Sink[string], not the Sink[B] expected of the if“, rather than the fallback trait at the result. Why: the expected type is what the program asked for, and a join that misses it while every branch meets it is a wrong answer, not an ambiguity; naming the branch says what to change. Alternatives weighed: the expected type always winning where both branches fit (testing a branch against an expected type still being inferred settles its inference variables, so the rule is held to fully known types and leaves inference as it was); a nominal meet of unrelated arguments, the greatest common subclass (none can be named in general, and an intersection type is not a type Avin writes); keeping the result-level message (it names a trait the program never mentioned).

Open

  • Whether constructor traits may carry parameters that are not holes (an error type fixed per trait, MonadError[A, E]), and whether composed constructors (Option[List[_]]) are wanted; both are left out of the higher-kinded design and need no change to it to add later.

  • Exporting a whole module as a member of another (export a.b), which needs modules as members.

  • Tooling for exports: completion after m. and in an import group listing a module’s exports beside its declarations, and the IntelliJ plugin’s resolution following an export to the declaration (go-to-definition, find usages, renaming through an export).

  • What a comprehension over a Map yields when its values are not pairs (it needs Iterable‘s own transformations).

  • Packages, where Sysl’s choice does not transfer (packages):

    • Whether a build should re-hash vendor/ on every run, catching a hand edit to a committed vendored package, or trust the hash recorded beside each package as it trusts the cache’s.
  • Lightweight threads, the open parts of the settled design above (cancellation is under Proposed): none is left open. Stack size and growth are settled above (branch lwt-stacks), and keeping user-interface work on the main thread is settled above as threads pinned to the main thread (branch main-lwt). The allocation chunk belongs to the carrier (proposed above), so thousands of parked lightweight threads hold no chunk each. The collector needs nothing new: its roots are what the runtime’s callback marks, so a parked lightweight thread’s context keeps its exact shadow stack and is walked as an attached thread’s is, and switching stacks happens only at the runtime’s own safepoints, so no collection sees one half done.

  • Settled on the user’s delegation 2026-11-06 (branch check-stops-early): avin check stops after type checking. Checking a program no longer lowers it, builds the shims of its Sysl bindings or builds its C unit: the previous check did all three and threw the result away, 4.9 s against 0.4 s of checking on a terminal-interface example. Two diagnostics came only from those later steps. A C declaration that names no header needs no C compiler to find, so check reports it. A Sysl binding Sysl rejects, and what clang rejects of the C unit (a constant that does not fit, a prototype the header contradicts) need the real tools, and stay behind avin check --bindings, which runs the whole pipeline up to the emitted code as check used to. Why: a type error is the common failure and should cost what checking costs; a binding changes rarely and build, run and test still report it. Alternatives weighed: moving the shim’s type-check into the checker (a second implementation of Sysl’s inference, certain to drift); keeping check as it was (the slowness this fixes); dropping binding validation from check with no flag (leaves no command that reports a bad binding without linking). The language server already stops at checking, so it matches the new check. Review with the user: whether --bindings should instead be the default for packages that have bindings. (Revised 2026-11-15, branch c-opaque-errno: check builds the C unit too, so what clang rejects of it is reported without --bindings.)

  • Settled on the user’s delegation 2026-11-15 (branch crypto-pbkdf2-uuid): avin.crypto gains pbkdf2HmacSha256 and pbkdf2HmacSha512, taking Vector[byte] or string for password and salt as hmacSha256 takes its key and message. Bound to sysl.crypto.pbkdf2_hmac256/512 through a runtime shim (avin.rt.digest_pbkdf2_*), since Sysl’s takes an unsigned count and an output slice; no OpenSSL involved, as the other digests. A count below 1 and a length below 1 or over 255 digests (8160, 16320) trap in Avin with the library’s message style, so the shim never sees them. Alternatives weighed: returning a Result (a bad count is the caller’s bug, as between‘s bad bounds are); OpenSSL’s PKCS5_PBKDF2_HMAC (adds a dependency for a digest Sysl has).

  • Settled on the user’s delegation 2026-11-15 (branch crypto-pbkdf2-uuid): Uuid lives in its own module avin.uuid (library/avin/uuid/uuid.avin), as avin.random and avin.crypto each have a directory; it is a data Uuid(high: long, low: long) so equality, hashing and sending come from the structure, with Ord implemented as the unsigned order of the sixteen bytes. parse and fromBytes answer Option (the input comes from outside); only the canonical text is accepted, because braces and urn:uuid: are other formats, not spellings of this one. The constants are Uuid.Nil and Uuid.Max, PascalCase like Duration.Zero, not nil. variant() answers 2 for RFC 9562’s layout (the value of its bits 10), 0, 6 and 7 for the others, as other platforms number them. FromParam is implemented in avin.net.http‘s params.avin, which imports avin.uuid (which imports nothing from avin.net, so no cycle). Review with the user: the Nil/Max spelling and the variant numbering.

  • Settled on the user’s delegation 2026-11-15 (branch real-bits-normalize): real reaches its IEEE 754 encodings through toBits -> long, real.fromBits(bits: long), toBits32 -> int and real.fromBits32(bits: int), and there is still no 32-bit float type (types). A binary protocol (PostgreSQL’s float4/float8) or file format needs the encodings, and a program that needs binary32 needs it only at that edge, so the 32-bit forms convert at the boundary rather than adding a type every arithmetic rule would have to cover. The members are parameterless accessors and statics, as isNaN and real.PositiveInfinity are; the encoding is signed (long, int) because there are no unsigned integers, so (-0.0).toBits is long.MinValue. Narrowing is the hardware’s conversion: round to nearest, ties to even, overflow to an infinity, and a NaN quieted with the top of its payload kept (ARM64 and x86-64 agree), so a signaling binary32 NaN does not survive a round trip; binary64 bits pass unchanged. Bound to sysl‘s FloatBits through four runtime functions (avin.rt.real_to_bits and its siblings). Alternatives weighed: a float type (the size of the language change, for an edge need); returning Vector[byte] (every protocol orders bytes its own way, and the integer is what shifting code wants); names doubleToLongBits-style (Avin names members by what they answer). Review with the user: whether toBits32 should trap rather than give an infinity on overflow.

  • Settled on the user’s delegation 2026-11-15 (branch real-bits-normalize): Unicode normalization is string.normalize(form: NormalizationForm) and isNormalized(form), the forms Nfc, Nfd, Nfkc, Nfkd (types). NormalizationForm mirrors sysl.unicode.Form, so the data is utf8proc’s Unicode 17.0.0, the database char‘s methods and avin.regex already answer from, and no table is generated or carried for it; a mirror’s variants must have the Sysl names, and Nfc is also how Avin spells an acronym in a name (Utf8Error, TlsStream), so the brief’s NFC became Nfc. A code point unassigned in 17.0.0 is left alone (utf8proc’s STABLE). A string of ASCII characters only is answered without crossing into Sysl, since it is in every form; isNormalized normalizes and compares rather than using the quick-check property, which utf8proc does not expose. Tested against every line of NormalizationTest.txt 17.0.0 (committed as tests/fixtures/unicode/NormalizationTest.txt, 1 MB with the character-name comments removed; the original’s SHA-256 is in the test) and every code point its part 1 does not list. Alternatives weighed: variants NFC … (refused by the mirror, and against the naming rule); four methods toNfc … (four names for one operation with a parameter); a table of Avin’s own (a second copy of the database to keep in step). Review with the user: the variant spelling Nfc over NFC, which every other platform writes in capitals.

  • Settled on the user’s delegation 2026-11-15 (branch real-bits-normalize): saslPrep(text) -> Option[string] in avin.crypto, RFC 4013 over RFC 3454’s tables B.1, C.1.2–C.9, A.1, D.1 and D.2 (system library). It lives beside PBKDF2 and HMAC because its one use is preparing a SCRAM password. The tables are generated from the RFC’s text by scripts/stringprep_tables.avin into library/avin/crypto/stringprep_tables.avin (8 KB of hexadecimal runs, decoded on first use into a sorted array searched by halves), since stringprep fixes them at Unicode 3.2 and the current database would answer differently. Unassigned code points are prohibited, as for a stored string (RFC 3454 §7), the stricter of the two forms, which PostgreSQL’s own SASLprep also applies; normalization is the current NFKC, which differs from 3.2’s only for the few CJK compatibility ideographs Unicode corrected since. U+200B, in both C.1.2 and B.1, is mapped to a space, the C.1.2 mapping being applied first; the two orders differ only for it. Prohibition and the bidirectional rule are checked on the normalized string, as RFC 3454 §3 orders the steps, so U+0340 (prohibited) normalizes to U+0300 and is accepted. None carries no reason, since a client’s only response is to fall back to the password as written. Alternatives weighed: Result[string, SaslPrepError] naming the step that refused (no caller acts on the reason); an allowUnassigned flag for the query form (no SCRAM use needs it); a generic stringprep(profile) (no second profile is wanted). Review with the user: whether a reason should be returned after all.

  • Settled on the user’s delegation 2026-11-16 (branch gc-pacing): AVIN_GC_PERCENT paces the collector (runtime). After a collection the heap may allocate that percentage of what survived before it collects again, and never less than the 8 MiB floor; the default stays 100, so the heap keeps within about twice what is live, as before. The value is decimal digits; one that is not, or is longer than 15 digits, is ignored; 0 paces by the floor alone, and anything above 100000 is taken as 100000. Measured on a program keeping 200k small objects (37 MB live) while discarding ~800 bytes per element: collection time falls from 3.79 s to 2.06 s at 200 and 1.12 s at 400, for a heap 1.2× and 1.5× as large. The pacing itself was already proportional to what is live, so the cost per element allocated levels off once the live heap passes the floor; what remains is that every collection traces the whole live heap (about 30 ns an object) and walks every block the sweep can reach. Alternatives weighed: a larger default (faster, but a program’s memory would grow with no setting of its own; left for the user); a library call to set it at run time (no program needs to change it mid-run yet); a floor that scales (it only matters below 8 MiB live). Review with the user: whether the default should be above 100, since the collector stops every thread and marks on one, so the trade favours memory less than it would for a concurrent collector.

  • Settled on the user’s delegation 2026-11-16 (branch read-alloc): a stream’s read(max) allocates what it answers, not max. A TCP, Unix or split socket read receives into a buffer the runtime keeps per operating system thread (on its carrier), grown to the largest read asked for up to 256 KiB, and copies out exactly the bytes that arrived; a read asking for more than 256 KiB answers at most that much, which the contract (“up to max“) already allows. A TLS read decrypts into a plaintext array the connection keeps, of max bytes up to one record’s 16 KiB, reused while reads ask for the same size and replaced when they do not. The contract and API are unchanged. Alternatives weighed: asking the kernel how many bytes are readable (FIONREAD; one more system call per read, and no binding for it); a buffer kept per stream on the Avin side (the binding still copies the whole buffer in and out at every call, and an idle server would hold one per connection); reading ahead into the stream’s buffered bytes (changes what a select’s descriptor says). Review with the user: the 256 KiB ceiling on one socket read. Each try at a receive ends its view of the carrier’s buffer before the thread can wait (branch pool-trap, 2026-11-17): a view held across a park was let go on whichever carrier the thread resumed on, changing the buffer’s count there while the buffer’s own carrier used it, which freed it under other threads (a crash in malloc, or corrupted bytes, with thousands of threads reading at once).

  • Settled on the user’s delegation 2026-11-23 (branch http-date): HTTP-dates live in avin.time as Instant.toHttpDate() and parseHttpDate(text[, now]). They sit beside the ISO 8601 text and parse, share TimeParseError, and avin.net.http imports them. Writing is IMF-fixdate only, drops the fraction toward the earlier second, and traps outside years 0000 to 9999 (the form has four digits; it matches date(...) trapping out of range, and no real header value is outside it). Parsing is exact: a day name that is not the date’s is refused (OutOfRange(text, "weekday")), names and GMT are case-sensitive as RFC 9110’s ABNF is, widths are fixed, extra whitespace anywhere is refused, asctime‘s day under ten must be space-padded, a second of 60 is refused as in every other parse. A two-digit RFC 850 year follows RFC 9110’s fifty-year rule against now, which is an argument of the two-argument form so the rule is testable and the one-argument form reads the clock. Alternatives weighed: a lenient parser ignoring the day name or case (what some servers do; it accepts corrupt dates and hides client bugs, and a caller can always trim or fold case first); Option instead of Result (every other parse here says why); the format as a method on Zoned (an HTTP-date is always UTC, so an Instant method has no zone to get wrong). Review with the user: strict weekday and case checking on If-Modified-Since, where a lenient server would answer 200 instead of ignoring a malformed date, which RFC 9110 also allows.

  • Settled on the user’s delegation 2026-11-23 (branch http-date-header): http.serve sends a Date header on every response, switched off by date: bool = true. RFC 9110 section 6.6.1 requires it of an origin server with a clock in 2xx, 3xx and 4xx and allows it in 1xx and 5xx; it is sent on every status the server writes (5xx and its own 400/503 included, since a client or cache gains from the clock there too) and not on the 101 of an upgrade, which the protocol switched to has its own say on. A Date the handler set, in any case of the name, is kept, as Last-Modified and the like are the handler’s. The text comes from DateHeader(clock = now), a public class so its rollover is testable with a clock of the test’s own: one Atomic holds the latest second and its text, a read compares the clock’s second with it, and a thread that finds the second over formats and stores the next (two threads doing so store equal texts, and a store racing a later one is corrected by the next read, each answer being right for its own clock read). Alternatives weighed: a mutex around the text (a lock on every request’s path); a timer actor refreshing the text (a thread idling in every server, and a stale text if it is starved); formatting on every response (about a microsecond of calendar arithmetic per request); a Duration-valued setting naming a refresh period (the second is what the header can show). The switch is a bool named date, as the header is. Tests that read raw heads pass date = false.

  • Settled on the user’s delegation 2026-11-23 (branch http-cookies): cookies in avin.net.http (Cookie, SetCookie, SameSite, CookieError; ServerRequest.cookies()/cookie(name), Response.setCookie/cookies()). Choices: (1) reading a Cookie header is lenient and per pair: a malformed pair is skipped and the others kept (one bad cookie must not hide the session cookie), with a value read only if every octet is a RFC 6265 cookie octet (commas and spaces in values are skipped, not accepted as some servers do); duplicates are all kept in order. (2) Making a SetCookie traps on a bad name/value/domain/path, on a broken __Host-/__Secure- rule (prefixes compared without regard to case, as browsers do) and on SameSite=None or Partitioned without Secure — the library’s convention for a programmer-supplied header value (as withHeader), nothing escaped or cut; the secure default is that Secure is never implied, only demanded. (3) The SameSite variant for None is Unrestricted, since None is Option‘s and would make Some(None) ambiguous; it is written SameSite=None. (4) Max-Age of zero or less is accepted and written 0 (the grammar has no negative and the meaning is the same). (5) SetCookie.parse (client) is an Err for what a browser would reject (bad name/value, prefix rules, SameSite=None/Partitioned without Secure) and ignores attributes it cannot read; Expires is read only as an HTTP-date (via parseHttpDate), not by RFC 6265’s lenient date algorithm. Alternatives weighed: Result constructors (a second constructor path for every cookie a handler writes); quoting values that need it (mangling); treating a pair without = as an empty-named cookie (6265bis; no server needs it). A cookie jar (domain/path matching, expiry, public suffixes) is a later item. Review with the user: strict value octets on Cookie (a client sending a=b,c loses that cookie).

Search

Esc
↑↓ to navigate ↵ to open Esc to close