Skip to content

Release v0.2.83

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Dec 18:44

Patch release v0.2.83

Changes

Type checking

  • Breaking: try(expr) returns a failure from the enclosing body. try(r) gives the .Ok value of a Result, or returns .Err(e) from the nearest function, closure or io.async body; try(o) does the same for an Option and .None. An error of another type converts through From, and the early exit drops its locals and checks ensures. A non-Result/Option operand, no enclosing body, or a try in a test(...) body is the new E0934; an error type with no From is E0935. try is now a reserved builtin, so a binder named try is E0407 (#2223).
  • Breaking: a String lends its bytes as a &str that borrows it, and String.slice_copy is deleted. s.as_str(), &s.* (through impl(String, Deref(Target : str))) and the range &s(a .. b) give a &str over the string's own bytes with its clamping and rune-boundary rules; the owned copy is s.substring(a, b) or String.from(&s(a .. b)). The view is never static: it is rejected at every &(str, static) slot (E0923), an Option(&str) over it in an Rc is E0909, and a write to, move of or drop of the string while the view lives is E0911. String.slice_copy and slice_copy_inclusive are deleted. A projection lend under an annotation ((l : &(str, static)) = &s.*) skipped the annotation's origin check and was accepted (S3); it is checked now (#2207).
  • An Allocator built from a local's address can no longer outlive that local from safe code (S1). A store through a reference, a call that can store it through a &mut argument (xs.push(a), set(&mut dst, a), mem.replace), a module-level store of a parameter, and a read through a local reference now fail like a plain assignment did; placement (Box.new(v, alloc : .Some(c.allocator()))) stays accepted. The raw-pointer flowability gate judges the place each write lands in. Passing io or a closure that stores a parameter through a &mut capture or another &mut parameter (StreamTake.next, Mutex.with_lock, HashMapEntry.and_modify) is accepted, and every call that hands over or invokes a closure judges its arguments against what the closure's &mut captures reach; calling an Fn closure parameter, which writes no &mut capture, stores nothing (#2247, #2250, #2252).
  • A thread closure is checked through what it reaches by destruction and through std (S1 x3). Rule D1 now sees a value whose Drop reaches a non-Sync global, follows a user Eq/Display that std calls on the user's behalf (contains, println), and walks if conditions and match guards. Each is E0602 when unsound, and each raced on a global under TSan before. "Known Holes" in THREAD_SAFETY.md is now "None known" (#2241).
  • A fixed-origin impl no longer satisfies a bound whose reference argument elides the origin (S1, E0602). impl(Keep(p), Resume(&(T, p))) passed a Resume(&T) bound and let a reference outlive its origin. The comptime-call memo now rebuilds a trait called with a different origin spelling, so the bound is not read as if it spelled p. The rule rejects nothing in std/ or src/ (#2233).
  • A store between two reference fields of one parameter is E0923, and an inline constructor's &mut field takes the write-back of its sibling fields (S1). arg.out.* = .Some(arg.world) was accepted, and stash(Feed(w)(world : &w, out : &mut seen)) left seen holding w with no E0911 on a later read. Both read a dead stack slot under ASan (#2233).
  • A &mut held in a value reaches the mutation summary (S1, E0908). poke(.Some(x)) and poke(Holder(p)(r : x)) hid the write from f(x : &mut i32), so g(b : &Plain) { f(&mut b.n) } was accepted: a write through a &T parameter. Four gaps in the summary compose, and all four are closed. Two further ref-era S1s (a move-only element borrowed for a call, a forwarded walk over an inner collection) are confirmed fixed by earlier work and pinned with new rows (#2229).
  • A generic function item at a run-time slot is rejected at check time (S1). An argument, untyped :=, struct field or function result naming a generic fn (id(_len), h := _len) was accepted by check and failed in C. It is E0601 with the closure repair v => _len(v), or E0613 when T cannot be inferred; h :: _len is unchanged (#2246).
  • A member read off a bare trait is the new E0628 (S1). View.view(c) and Default.default() passed check and read an undeclared C type. The help names the implementing type, (C <: View).view(c), and the called form carries a repair (#2246).
  • A recursion at a growing instantiation stops after 128 levels with the new E1106. The error carries a first: and a now: note; YO_DEBUG_SPECDEPTH=1 traces the depths (#2246).
  • A static field read through a reference passes to a &(str, static) parameter (S2, regression from v0.2.82). take(s.src) for s : &S, &mut S, self or a local reference binding was a false E0923 ("the value holds s"). The E0923 at an argument now names the parameter and prints &(str, static), and the E0619 field message has its comma (#2225).
  • An associated-type binding Item := &T is a reference type, not a local borrow. Iterator(Item := &T), Item := &mut T and a Coroutine Yield := &T failed with "Expected identifier for associated type label, got: __yo_imm(...)"; the local-borrow rewrite now applies only to statements (#2222).

Standard library

  • Breaking: about 45 deprecated aliases are deleted. The module-prefix aliases (base64.base64_encode, json.json_parse and the rest of base64, csv, hex, html, percent, toml, utf16, json) and String's eight parse_* methods (s.parse_u64()) are unbound, with no forwarder: E0403 for a module field, E0610 for a method. Use the module's own functions (json.parse_string, toml.parse) and s.parse(T) (#2208).
  • Breaking: std/async's yield is deleted. It duplicated std/async/waker's yield_now; the name yield is free for generators. The "blocking await inside a task" panic now says await yield_now(io) (#2217).
  • An aborted TcpStream.connect or UnixStream.connect closes its socket and frees its address (S1). A timeout around a connect to an unanswering host leaked the descriptor and a 16- or 28-byte address buffer on every abort (the lowest free fd grew by one per abort, on both Linux backends). A thread whose io_uring is torn down with a cancelled operation in flight no longer leaks that operation's future. With these, the oldest open S1, the self-hosted-emit leak umbrella, is re-measured on Linux and closed: 41 of its 42 surviving corpus files were already leak-clean, and the 42nd was tests/net/tcp.test.yo (#2237).

Toolchain for agents (CLI, LSP, test runner, diagnostics)

  • yo fix --errors-as-values converts handler-style functions to Result-returning ones. It evaluates the files, resolves every call, turns an Exception parameter or IoExn row into Result(T, AnyError), makes throws return .Err, passes calls on with try(...) and turns catch handlers into a match at the call. What it cannot convert (trait members, contract clauses, more than one Exception parameter, -> never) is listed, and what it cannot adapt safely (a spawn of a now-fallible future, a handler named in a template string) is reported with rc 1. --callers <path> adapts calls outside the converted paths (#2238).
  • E0601 at a &String argument in a &str parameter names the repair. s.as_str() replaces &s, a field place or a &String value, and yo fix applies it; method calls such as u.push_str(&t), which said only Cannot unify incompatible types: "str" and "String", now carry it too. When the source does not spell the place as the help does, the help is given without a guessed edit (#2244).
  • yo context --path <std copy> evaluates the tree against itself. A tree holding a prelude.yo is its own std root, as for yo check ./std; before, 136 of a copy's 172 modules fell back to token-only docs against the binary's bundled std, and that degraded index then poisoned the cache for the plain bundled query. The cache key now names the evaluating std, so existing context caches rebuild once (#2221).
  • Docs. The manuals and about 45 std modules' doc comments no longer narrate history or pre-values-by-default spellings, and the docs check is a blocking CI gate. pack/context.md shrinks from 29,020 to 23,971 bytes under a 24 KiB cap, with the depth moved to SYNTAX.md and OWNERSHIP_AND_BORROWING.md in both languages (#2211).

Compile and codegen

  • A self-recursive generic function specializes once per instantiation (S1). The specialization cache was stored only after the body was evaluated, so a recursive call at the same instantiation minted it again without end: a SIGSEGV on develop and a hang on v0.2.82. A recursion at a growing instantiation is the E1106 above (#2224).
  • A generic body at T := &C calls impl(&C, ...)'s method, and a named fn at a &mut Impl(FnMut) slot is passed as the fn pointer (S1). Both emitted mismatched C pointer types (C const * against C *, and (void**)(&fn)) that clang rejected; the second also covers a call forwarded through a second slot (#2224).
  • An FnOnce closure whose body is a bare capture no longer leaks its environment (S1). It was already clean since v0.2.74; a regression test now pins the Rc, Box, String, Impl and Dyn shapes (#2224).

Async runtime

  • A function that takes Impl(Future(T, E)) by value is specialized per future type, and YO_DEBUG_AWAIT_GRAPH=1 prints the await graph. A function taking a future is emitted once per io.async instance, as one taking an Impl(Fn) is per closure, and its parameter has the instance's concrete C type instead of the erased __yo_future_trait_* pointer. The evaluator records the await graph (an io.await is an edge to the instance its operand resolves to, found through recursion too) and prints one line of counts plus one line per cycle; =2 also lists each non-static await site. The cycles and the =2 site list are sorted, so the output is the same from run to run (#2218, #2228).
  • An io.async future is its captures until it starts, so a future made and dropped costs no cell. The state machine or sync future is allocated when the future is first awaited, spawned or stored in an erased slot; a future dropped cold drops its captures once. A trait default awaiting a generic impl's io.async method through Self (Reader.read_to_end on BufReader) and a timeout result pending across a call that may unwind compile and drop correctly (#2240).

Build system and verification

  • Breaking: logic and lemma replace ghost_fn. A logic function is total and has a value; a lemma returns unit (or a labelled ghost value, below) and claims an ensures. The head decides the form, not the literal's shape, and reports name them logic@<file>:<row> and lemma@<file>:<row>. A logic function returning unit, a lemma with no ensures, and an unlabelled value from a lemma are E0930. ghost_fn is read as logic under std/ only and is the new E0933 elsewhere; yo fix renames it by shape. LSP hover marks the form, and the VS Code and Vim grammars highlight both words (#2226).
  • A lemma may return a labelled ghost value. ghost(k := lemma(args)); proves the lemma's requires at the use and learns its ensures about k. In verify+, a proof resting on an unproven lemma is capped at unproven, because a lemma never runs and leaves no assert behind; a lemma marked assumed() caps nothing (#2227).
  • yo verify proves a function's ensures at every exit. An early return(v), and so try(expr), is proved with v as the result and reported as ensures#N@row:col. A match arm is walked under its own pattern, where a true obligation in an arm was refuted with a counter-example the arm can never see (S2). A callee's Result over a user error enum no longer fails with a Z3 "unknown sort" error, and dyn(Box.new(e)) at an AnyError slot is an opaque value. Odd.Even for Odd :: enum(Odd, Even) was read as a payload form and reported "unbound runtime name" (S3); it resolves now (#2239).
  • The verify cache no longer re-proves every function below an inserted line. The key is the query with its generated names renamed by first occurrence and its sort and datatype declarations pruned to the ones it names, so source positions, the entry's path and earlier functions do not reach it; yo verify <file> and yo verify <dir> now give one function one key (#2216).
  • yo verify --jobs <n> runs the solver in parallel. Cache misses run as a pool of Z3 processes, one per hardware thread by default; yo compile passes its own --jobs, and the verdicts do not depend on the pool size (#2231).
  • The release's Z3 is fetched with the compiler, and a missing or broken solver is one line per run. Every release publishes the pinned Z3 as yo-v<version>-<triple>-z3.tar.gz (static musl on Linux, the static CRT on Windows; 8 to 14 MB instead of the official 157 MB). install.sh, install.ps1 (--no-solver / -NoSolver skips it), yo version install and yo verify fetch it, and yo build fetches it on first need; check, compile and the LSP never touch the network. The solver lives in <yo cache>/solvers/z3-<pin>-<triple>/ (on Windows %LOCALAPPDATA%\yo\cache, where it used to be ~/.cache/yo on every OS). A missing solver, a YO_Z3_PATH/--solver-path naming no file and a binary whose --version fails are one probe per process, one line instead of a SOLVER-ERROR block per function or a line per file; --require-solver / YO_REQUIRE_SOLVER=1 make it an error whenever proofs are to run, and the solver is in the artifact stamp (#2219, #2220).
  • yo check and yo compile print no verifier line for a function with no contract and nothing checked in its body. A project under pragma(Pragma.VerifyOrAssert); printed n/a ... outside the verifiable subset or ok ... no obligations for each, so it could not build silently. yo verify output is unchanged (#2214).

Compiler performance and memory

  • Re-verifying after a one-line insertion re-solves nothing. On a 70-function module (140 queries, Z3 5.1.0), the run after inserting a line re-solves 0 of 140 queries in 20 ms of solver time, against 140 in 9,458 ms; on 280 functions, 560 of 560 are cached in 129 ms (#2216).
  • yo verify --jobs 16 solves 5 to 6 times faster. A 280-function module (560 queries) takes 6.7 and 7.1 s of solver time instead of 41.4 and 42.5 s at --jobs 1; a 70-function module takes 2.0 and 1.9 s instead of 10.4 and 9.9 s. Wall time on the loaded box falls from 56 s to 20 s. No verdict differs, in 0 of 560 queries (#2231).
  • io.async futures that are dropped cold allocate no cell. The new cli case drops from 2.50 to 1.50 cells per task (2 state machines and 2 sync futures become 1 and 1); a mixed probe drops from 8 state machines to 7. src/main.yo's emitted C grows 147,035,669 to 147,109,470 bytes (+0.05%, 161 future values) and the C compile's RSS 1,943,960 to 1,945,004 KB. Per-iteration async-chain (instructions:u; chain / select / timeout / spawn / pingpong) under clang 21 is 1,447 / 1,923 / 3,835 / 214 / 3,402 to 1,436 / 1,939 / 3,821 / 211 / 3,402; under gcc 15.2 it is 1,180 / 1,439 / 2,964 / 179 / 2,552 to 1,210 / 1,446 / 2,972 / 188 / 2,539, so chain is +2.5% and spawn +5% (not profiled; AFA-3 replaces both paths at static sites) (#2240).
  • check ./src costs more memory and allocations. Rule D1's walk through std bodies takes check ./src from 2.290 GB to 2.457 GB maxRSS (+7.3%, the same in two rounds) with no measurable CPU change (user+sys 2188.7 s to 2206.7 s, then 2346.5 s to 2335.3 s) (#2241); the trait-instance restamp takes check ./std/collections from 96.9 G to 99.4 G instructions:u (+2.5%, spanning a develop merge) (#2233). Over the whole batch the evaluator work ratchet counts 5,537,718,364 allocation calls for check src/main.yo before and 5,912,245,043 after (+6.8%): +1.0% at abce3de78 (leaks, E-2, E-1v, AFA-2) and +2.8% at 3a218d061 (D1, S-0, cg3r, the flowability gate). The develop battery's check src/main.yo max RSS went from a 2,222,504 KB baseline to 2,447,372 KB (+10.1%) over the same batch. Both baselines were moved and the cost is not yet recovered (#2251, #2252).

Known open issues filed this cycle

  • issues/2026-11-30-a-call-through-a-local-closure-is-read-as-a-collection-element-by-a-match-scrutinee.md (S3: f(x) through a local closure as a match scrutinee is read as an indexed projection and fails with E0901)
  • issues/2026-12-01-a-generic-impl-never-matches-when-the-receiver-does-not-bind-a-trait-argument.md (S2: a forwarding impl over a parameterized trait never applies, so Box(C) or a user wrapper cannot forward one; fix scheduled for v0.2.88)
  • issues/2026-12-01-a-runtime-ensures-rejects-a-body-whose-every-path-returns.md (S2: a function with a run-time ensures whose body leaves through return(...) on every path does not compile; make the last exit a value)
  • issues/2026-12-01-std-http-ignores-https-proxy-so-yo-cannot-download-behind-a-proxy.md (S3: the compiler's own downloads (solver fetch, yo version install) ignore HTTPS_PROXY)
  • issues/2026-12-01-the-solver-spawn-does-not-quote-its-paths.md (S3: a Z3 under a path containing a space cannot run, as on a Windows user name with one)
  • issues/2026-12-01-yo-check-rejects-tests-internal-verifier-test-yo-with-e0928-in-a-helper-called-from-assert.md (S3: yo check of one compiler test file fails with E0928 while yo test of it passes)
  • issues/2026-12-02-a-closure-in-a-comptime-function-that-names-its-type-parameter-emits-the-parameter-unresolved.md (S2: passes yo check and fails in the C compiler)
  • issues/2026-12-02-a-fixed-origin-impl-called-through-a-spelled-bound-is-passed-the-address-of-its-reference-argument.md (S3: latent, the emitted C passes a T** for a T*)
  • issues/2026-12-02-a-frame-that-installs-a-handler-and-forwards-an-outer-one-hands-its-own-unwind-to-the-outer-installer.md (S1: a frame's own handler unwinds and the outer installer's frame returns early with an empty result, a wrong value with rc 0; retires with ERRORS_AS_VALUES E-5)
  • issues/2026-12-02-a-generic-binder-solved-only-by-a-where-clause-takes-the-argument-binder-type-when-declared-first.md (S3: with generic(A, I) the body reads A as I; the other order works)
  • issues/2026-12-02-a-method-call-on-an-impl-result-over-an-origin-parameterised-type-fails-in-codegen.md (S2: passes yo check, then an internal compiler error (E1301) in codegen)
  • issues/2026-12-02-a-mistyped-tag-is-reported-as-an-unfetchable-commit.md (S3: a tag = "v9.9.9" that does not exist says the commit could not be fetched)
  • issues/2026-12-02-a-one-element-array-literal-is-read-as-a-slice-type-with-no-hint-of-the-trailing-comma.md (S3: the diagnostic does not lead to [x,])
  • issues/2026-12-02-a-system-library-that-pkg-config-cannot-find-fails-far-from-its-cause.md (S3: empty flags and a linker error far from the cause, plus a stray 0.29.2 line in every build that links a system library)
  • issues/2026-12-02-a-type-nested-over-a-type-variable-costs-time-exponential-in-its-depth.md (S2: yo check stalls on a generic body naming a type nested over a type variable; depth 16 takes 27 s, depth 18 takes 94 s)
  • issues/2026-12-02-an-executable-is-not-relinked-when-a-static-library-it-links-changes.md (S1: yo build silently runs a stale binary after a linked library's source changed)
  • issues/2026-12-02-build-module-link-and-dep-module-propagate-nothing.md (S2: module.link is write-only, so a binding package cannot carry its system-library requirements to its users)
  • issues/2026-12-02-i64-display-passes-an-int64-t-to-percent-lld-and-every-program-that-prints-one-warns.md (S3: a C warning in every program that interpolates an i64)
  • issues/2026-12-02-std-build-doc-examples-and-stale-build-docs-do-not-match-the-code.md (S3: std/build.yo's module-doc examples use the removed record form, BUILD_SYSTEM.md misdescribes the .verified tree, yo init writes an unused import)
  • issues/2026-12-02-test-suite-target-is-declared-and-never-forwarded.md (S3: a build file asking for a cross-target test run silently tests on the host)
  • issues/2026-12-02-the-d1-walk-rejects-a-value-whose-generic-drop-reaches-no-global-when-it-can-die-on-another-thread.md (S3: over-rejection, a generic user Drop that reaches no global is E0602 in a thread closure)
  • issues/2026-12-02-the-deref-view-help-repeats-itself-for-a-reference-binding.md (S3: E0601's &r.* help repeats itself; the working form &r.*.* is named nowhere)
  • issues/2026-12-02-the-integrity-hash-gives-one-value-to-different-trees.md (S2: three ways make two dependency trees hash alike, so the store can serve the first package's bytes to the second)
  • issues/2026-12-02-unbounded-compile-time-function-recursion-hangs-yo-check.md (S2: yo check never finishes on a comptime recursion with no finite depth; the fix reuses E1106)
  • issues/2026-12-02-yo-build-locked-accepts-a-lock-that-does-not-satisfy-yo-toml.md (S2: --locked builds the old tree after a pin was edited without regenerating yo.lock)
  • issues/2026-12-02-yo-build-uses-a-modified-store-tree-and-trees-are-writable.md (S2: an edited file in store/sha256/<hash>/ is compiled and run with no diagnostic)
  • issues/2026-12-02-yo-version-install-leaves-an-empty-staging-directory-when-the-download-throws.md (S3: every failed download leaves an empty directory under ~/.cache/yo/versions/)
  • issues/2026-12-03-a-local-fn-definition-cannot-call-itself-by-name.md (S2: a block-level :: function that calls itself is E0401, though FUNCTIONS.md says a named function recurses by name)
  • issues/2026-12-03-a-local-fn-definition-silently-reads-a-shadowed-module-level-name.md (S2: a block-level fn naming an enclosing parameter reads the module-level binding of the same name, a wrong value accepted)
  • issues/2026-12-03-recur-in-a-capturing-closure-emits-a-call-missing-its-closure-context.md (S2: recur in a closure with captures fails in the C compiler, "too few arguments")
  • issues/2026-12-03-the-e0401-did-you-mean-help-suggests-operator-names.md (S3: an undefined k gets did you mean "?"?)
  • issues/2026-12-03-the-v0-2-83-batch-raises-the-check-allocation-count.md (S3: the +6.8% allocation count of check src/main.yo above; root cause not pinned)

Native bundles (bootstrap seed chain)

The yo-v*-<os>-<arch>.tar.gz assets attached below are this commit's
self-hosted compiler, built by the PREVIOUS release's compiler — the
seed (bin/yo + std/ + vendor/mimalloc/ +
pack + LICENSE). The
TypeScript compiler that used to build them was retired in P2.5 and
is frozen at the src-attic-final tag. See
plans/archive/SELF_HOSTING_COMPLETION.md Phase 2 for the trust chain and
plans/archive/BOOTSTRAPPING.md for the campaign record.