Skip to content

Release v0.2.82

Choose a tag to compare

@github-actions github-actions released this 01 Dec 08:42

Patch release v0.2.82

Changes

The values-by-default language migration is complete. str is unsized and has no value spelling: a string view is &str or &(str, static), a range of a str is a &str projection (str.slice_copy is deleted), and yo fix --migrate is gone. The soundness claim (S) is not made in v0.2.82: this release closes six S1s, but fourteen root-level issues/ docs still carry **Severity:** S1 at the release tip (seventeen at v0.2.81), none of them filed this cycle.

Type checking

  • Breaking: a value str is E0619. A parameter, result, field, element or type argument spelled str (s : str, -> str, ArrayList(str), Option(str)) is rejected. The help names &str for a lend, &(str, static) (a literal's type) for a result, field or collection element, and String for owned bytes. &s(a .. b) is a &str projection that carries s's origin (static when s is), through new Index(Range(usize)) and Index(RangeInclusive(usize)) impls on str that clamp as slice_copy did. str.slice_copy and str.slice_copy_inclusive are deleted; String's and the collections' stay. Copying a &str parameter into a &(str, static) result or field is now E0923, which the alias used to launder. markdown-yo needs v0.0.32 with this compiler (v0.0.31 spells a value str) (#2198).
  • A &mut payload reached through a & scrutinee is read-only (S1). In match(e, …) with e : &E, or match(&x, …), a binding of a &mut payload is now a & reborrow: a write through it, r.* = v, a pass to a &mut parameter and a store in a &mut field are E0908, naming "a &mut reference reached through a & borrow". They compiled and gave two &mut handles to one place, and derive(Clone) on an enum with a &mut payload copied the exclusive borrow; it now fails at the derive. A &mut field destructured from a & source ({ r } := h, h : &H) follows the same rule. A &mut or consuming match keeps the payload writable, and check ./src and check ./std found no new rejection (#2197).
  • A holder with a spelled origin holds what a &mut callee stored in it (S1). c.put(&xs(usize(0))) on c : Keep(xs) (and the same store through a free function or a trait method) now freezes xs(usize(0)) while c is live: growing xs is E0911, where it was accepted and read freed memory under ASan. A &mut lend's write-back also no longer drops the loans the holder held before the call, so a callee that stores into one tuple slot, or stores conditionally, keeps the old loan checked (S1) (#2191).
  • A borrow of a holder, and a value copied out of one, carry the loans the holder joined after its binding (S1). With d = .Some(&xs(usize(0))) assigned after d's binding, c := &d and copy_into(&mut c, &d) now freeze xs(usize(0)) while c is live (E0911 naming d); growing xs was accepted and read freed memory under ASan. A chain (e := &c) works, and a loan that a later whole-holder assignment ended is not carried (#2204).
  • In an AllowUnsafe file, a & borrow through a dereference stays read-only (S2). r := &xs.* registers no loan there, and the checker read the binding as &mut: a for over it took the mutable cursor and rewrote the caller's elements, and &mut r.* and match(&mut r.*, …) compiled. They are E0908, as in safe code (#2183).

Standard library

  • Breaking: append_to and the Format trait are deleted. ${x:spec} on a Display type is the one spelling: std/fmt/format.yo and its 26 impl(_, Format()) lines and Display's seven append_to members are gone, and std/fmt no longer exports Format (#2188).
  • Breaking: std/fmt/to_string.yo is std/fmt/display.yo. The file holds Formatter, Display and Debug; import it as import("std/fmt/display"), with no forwarder. import("std/fmt") is unchanged (#2189, #2200).
  • A spec'd interpolation no longer allocates a rune list. The spec scanner reads the spec's bytes in place: 40 ${n:>8} parts make 171 heap allocations instead of 291 (valgrind, system allocator), with byte-identical output and unchanged E0931 positions (#2185).
  • A compile-time - or ~ returns the trait's Output. The comptime dispatchers return comptime(_Self.Output) as the runtime ones do, so a ComptimeNeg or ComptimeBitNot impl whose Output is not Self works (n :: -CtV(x : i32(3)) is a CtW) (#2192).
  • derive(Clone) and derive(Hash) treat a Box, Rc, Arc or ArrayList field like any other. It is cloned as self.f.clone() and hashed as self.f.hash(hasher); a derived Clone over an ArrayList(R) field with a non-Clone R is now E0610 at the derive, naming R (#2186).

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

  • Diagnostics state their rule without citing internal documents. Compiler errors and help, the yo explain registry (en and zh-CN), yo verify --help and two runtime messages no longer point at plans/…, decision numbers, VERDICTS-N, plan sections, origin-rule ids or issues/…. Each message keeps its rule and its hint, and a stale promise ("until decision 43") now says what is true (#2201).
  • Docs. The manual (en-US and zh-CN), the pack and the instructions describe the language after values by default: no user doc sends a reader into a values-by-default plan, a string view is a reference (str leaves the Copy, value-type and thread-safety lists), SHARED_OWNERSHIP.md counts the borrow pin, and FORMAL_VERIFICATION.md's "Two lists" section takes &/&mut list parameters with requires(distinct(src.*, dst.*)) in a block that verifies (#2199).

Compile and codegen

  • Breaking: Rc and Arc release their count in a Drop impl, and source code cannot spell the compiler's drop. impl(Rc(T), Drop) and impl(Arc(T), Drop) decrement the count; Rc.from_raw(p) and Arc.from_raw(p) take over one strong count of a live cell, as in Rust, and replace __yo_rc_own; clone and Weak.upgrade build through them, and a raw __yo_cell/__yo_atomic_cell is inert storage. The compiler's drop is __yo_drop, accepted only in code the compiler synthesizes: it is rejected in an AllowUnsafe file, the prelude, a user macro and a derive rule's code string, with the help drop(x) or unsafe(drop_in_place(p)). ___drop(x) is an unbound name, drop_in_place runs on __yo_drop_in_place, and an error inside a derive rule's code string is located at auto-generated://comptime-string. The drop-glue label is __yo_drop_glue, and no ___drop/___dispose spelling remains (#2195, #2203).
  • A nested function's early return no longer frees a parameter twice (S1). A function defined inside another ((fn(xs : T) -> R)(body)) that returned from inside a for over its parameter, where the enclosing body later moved a local of the same name, received the enclosing body's early-return drop and aborted with an ASan double free. The early-drop walk now stops at an fn(...) -> R definition (#2193).
  • The dead effect-analysis code is deleted (about 1,850 lines: effect-analysis.yo, ExprInfo.effect_analysis, the evidence-parameter collection and three write-only context fields); the compiler's own emitted C is byte-identical (#2196).

Build system and verification

  • A run-time ensures is checked on every return (S1). An early return(v), including one from a cond/match arm or a for body, skipped the contract; each exit now binds its value, asserts the clauses and yields it, and verify+ strips a proved clause at every return site. A bare variant under an ensures (.Ok(...) at a block tail, return(.Err(e))) is inferred at the declared result type, where it failed (S2). An ensures on a function whose body installs an unwinding handler (an unwind(...) at function-literal depth 0 or 1, also through a macro expansion) is the new E0932, with the help to move the handler into a helper without an ensures (#2190).

Compiler performance and memory

  • Rc/Arc's Drop impls are neutral on the compiler. A/B against develop 0eace61eb, both stage-2 binaries built with clang -O2: stage-2 check ./src user-mode instructions 7,137,916,482,144 → 7,118,363,707,440 (−0.27%); stage-2 binary 21,464,384 → 21,460,792 bytes (−0.02%); the emitted C of src/main.yo 144,710,838 → 145,763,043 bytes (+0.73%) and 2,108,883 → 2,181,980 lines (+3.47%, mostly the Option(handle) NULL bracket, now three lines around the drop-glue call). Wall time on the loaded box was noise, and the bootstrap fixpoint holds (#2195).

The claim

Claim (L) is made: the values-by-default language migration is complete. Test 7 passes on this release's tree; the soundness claim (S) is not made: known S1s remain open in safe code. On a4083b16a, the commit the release was gated on (the tagged commit above it is the version bump, which changes only the version string): leg (a), the origins corpus, rejects G-B's 632 unsound programs, accepts G-A's 150 and leaves no origin rule without a sink; leg (b), the 2026-11-11 audit's probe corpus, rejects 1,734 of its 2,038 safe-code programs, crashes the checker on 6 (a loud failure, not an acceptance) and accepts 298, none of which leaks or runs dirty under ASan (280 run clean, 9 fail to compile in C, 9 exit non-zero); leg (c), the G-D borrow-program generator, finds nothing new in 291 programs (run 46530718762). The release G4: the compiler rebuilt from its own emitted C under AddressSanitizer and LeakSanitizer runs check src/main.yo with exit status 0, 0 AddressSanitizer errors and 0 leak blocks (4 h 30 min on a loaded machine, peak RSS 4.91 GB). This release closes the S1s named above (a &mut payload through a shared scrutinee, the spelled-origin holder lent &mut, the holder borrow that missed later-joined loans, the nested function's double free, the early return that skipped ensures, and the derive that copied an exclusive borrow); it does not close rule D1's thread-reach walk (issues/2026-11-11-the-d1-thread-reach-walk-does-not-see-drop-so-a-value-dropped-on-another-thread-races-on-a-global.md, issues/2026-11-11-the-d1-thread-reach-walk-trusts-every-std-body-including-the-user-impls-a-std-generic-calls.md) among the fourteen open S1 docs.

Retracted claims

  • v0.2.81's SHARED_OWNERSHIP.md said "a clone is one increment, dropping a handle is one decrement, and a move is free: the compiler adds no other count operation". A local borrow of a place behind a handle (r := &h.*.x) holds the cell for as long as the borrow lives, and Rc.strong_count counts it; the page now says so (#2199).
  • v0.2.81's FORMAL_VERIFICATION.md said "ArrayList is a reference type", and its "Two lists" example mutated a by-value ArrayList parameter, which is E0917. The section now takes &/&mut parameters, and its example verifies (#2199).

Known open issues filed this cycle

  • issues/2026-11-30-a-derive-rules-code-string-runs-raw-pointer-operations-in-a-safe-file.md (S2: a derive rule's code string launders the unsafe, private-member and __yo_ gates)
  • issues/2026-11-30-a-field-write-through-a-mut-match-binding-of-a-mut-payload-has-no-error-code.md (S3: r.n = v on a &mut match's &mut payload fails without a code)
  • issues/2026-11-30-a-lend-through-a-static-reference-is-second-class.md (S2: a -> &(T, static) function cannot return a static lend such as &G or &s(a .. b) of a static str)
  • issues/2026-11-30-a-return-in-a-function-literal-inside-a-reference-result-body-is-rewritten-as-the-results.md (S2: a nested literal's return is rewritten as the outer reference result's)
  • issues/2026-11-30-a-string-literal-cast-to-a-u8-pointer-is-emitted-as-a-bare-c-literal.md (S3: a literal cast to a u8 pointer emits a bare C literal)
  • issues/2026-11-30-in-an-allowunsafe-file-a-mut-borrow-through-a-shared-reference-field-is-accepted.md (S2: &mut h.r.* over a & field in an AllowUnsafe file)
  • issues/2026-11-30-the-element-drop-intrinsics-drop-nothing.md (S3: __yo_drop_array_element/__yo_drop_tuple_element lower to a comment)
  • issues/2026-11-30-the-reference-is-copy-read-rule-is-complete-only-for-str.md (S2: the &T-is-Copy read rule covers only &str)
  • issues/2026-11-30-the-str-operator-arm-stays-until-the-string-eq-str-twins-select.md (S3: the str operator arm waits for the String/&str Eq twins)
  • issues/fixed/2026-12-01-a-static-field-read-through-a-reference-is-e0923-at-a-static-parameter.md (S2, regression from #2198: passing a &(str, static) field read through &S or self : &Self to a &(str, static) parameter is a false E0923, so code that stores a static slice from a borrowed struct fails to build; fixed on develop by #2225 for v0.2.83)

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.