Skip to content

Latest commit

 

History

History
2407 lines (2237 loc) · 145 KB

changeslog.md

File metadata and controls

2407 lines (2237 loc) · 145 KB

C+ changelog

User-facing changes per release, newest first. The changelog starts at v0.0.14; earlier history lives in each version's archived plan.

Unreleased

Sealed C-ABI libraries, for ranges that count in their bounds' type, literal-only expressions that take their position's type, integer min / max / clamp, [package] vendor search directories, and an internal compiler error report for IR that clang rejects.

Upgrade notes

  • A for range counter has the type of its bounds. Two unsuffixed literal bounds are still i32, so existing loops are unchanged; a loop over a usize bound now counts in usize and indexes directly, and the 0..(n as i32) / a[i as usize] pair is no longer needed. Two bounds of different types are E0302, as before.
  • A literal-only expression (7 * 3, 1.0 / 255.0, -(3000000 * 1000)) takes the type of its position: a typed binding, argument or return, the other operand, or the other if / match branch. Code that spelled a suffix on every constant keeps working; a literal that overflows the width its position asks for is E0921. An as operand still has no context, so (1 << 40) as u64 is unchanged.
  • A [library] with sealed = true is consumed through its C header, never imported by a C+ package (E0896).

Language and compiler

  • for loops. The counter takes the type of its bounds (above). An inclusive range ending at the type's maximum ends: MAX-1..=MAX runs twice and 0..=255u8 visits every byte value, where the loop used to wrap past the maximum and never end. for _ in a..b discards the counter as let _ does.
  • Literal-only expressions take their position's type (above), and codegen computes them at that width: let a: u64 = 1 << 40 is 2^40.
  • An unsuffixed float literal inferred as f32 (take_f32(0.4), let v: f32 = 0.4) emits f32 bits; it used to fail the build with f64 bits in a float operand.
  • Tail calls. A C export returning bool, u8, u16, i8 or i16 that forwards to a C+ function, and a library function forwarding to an extern fn with such a return, failed in clang's backend ("failed to perform tail call elimination on a call site marked musttail") in debug and release. The tail call is a plain call when the two sides' return extension attributes differ.
  • 32-bit targets. Every array and raw-pointer index operand, the str hash loop's counter, both str == str length compares, slice_len's non-negative assumption and the Text triple in interpolation are spelled at the target's pointer width, so a program that indexes an array compiles for the ESP32 (it was rejected by esp-clang with "defined with type 'i32' but expected 'i64'"). Xtensa's backend has no tail-call lowering, so codegen never emits musttail for it.
  • ESP32: the sixth argument of a non-leaf function survives. In the Xtensa windowed ABI the frame-pointer register a7 is also the sixth argument register, and the "frame-pointer"="non-leaf" every function carried made esp-clang claim a7 one instruction before its rescue copy of the argument: every non-leaf function with six or more parameters read a stack address for its sixth (a seven-argument open(..., license, len) parsed garbage; a P-256 modular inverse received a wrong Montgomery constant). Functions compiled for esp32-xtensa keep no frame pointer now; every other target still carries non-leaf.
  • extern static declares C data. extern static NAME: T; is a static whose storage another object defines — C's extern T name; — read, written and addressed like any static, under the bare name or a #[link_name]. Codegen declares it as an external global; the C+ name is private to its declaring module, as an extern fn's is. A str-typed one is E0929. ESP-IDF's WIFI_EVENT and g_wifi_osi_funcs, environ and framework constants no longer need the function-shaped workaround. cpc bindgen emits one for every extern T name; a header declares.
  • A temporary built in an if or match arm (let t = if c { text::from_str("_${x}") } else { ... }) is dropped at the end of its statement, and its stack slot now lives that long. Its lifetime used to end with the arm, so a release build could reuse the slot before the drop and free whatever was there ("pointer being freed was not allocated"; debug builds were unaffected).
  • #addr_of(s[i]) on a slice is the element's bounds-checked address; it was a codegen panic.
  • A package is named by its manifest, not its folder. A dependency in a folder whose name differs from [package] name, typically reached through a vendor/ symlink, compiled under the folder's name in the consumer and the package's name in its own archive, and the link failed.
  • str literals inside a static. An array, fill or struct literal whose elements or fields are strings (static NAMES: [str; 2] = ["zero", "one"];) builds; it used to pass the checker and fail in clang with an internal compiler error. A str static on a 32-bit target (ESP32) had a 64-bit length in a 32-bit header and failed the same way; both are the target's pointer width now. E0911 on a const array or struct says to use a static and why, instead of a note about function names.
  • Slices. s[i] reads a slice's element, bounds-checked against its length; a slice is read-only (s[i] = v is E0305). Reading an element used to need #slice_ptr and a raw deref. An array LITERAL passes where a T[] parameter is expected (f(["a", "b", name])), as a view of a slot in the caller's frame that lives for the statement: the callee may read it, and keeping or returning it is E0513. An array value is still not a slice. A generic T[] parameter now infers T from its argument, so slice::prefix(s, 2) needs no ::[i32].
  • Diagnostics. A missing method on a builtin type names that type (no method foo on type u32, not str), and the stdlib/math hint appears for every numeric width math declares. The E0312 hint for iterating an array shows for i in 0..3usize { arr[i] }. E0337's raw-deref message names box::from_raw instead of an unsafe C+ does not have.

Toolchain and packages

  • [library] sealed = true. A closed C-ABI product: the archive keeps global exactly the package's export items. Everything the exports reach, the package's name-public functions, the stdlib slice, every dependency archive, bundled native archive and extra-objects object, is resolved into one relocatable object and made local there (clang -r with an export list on Mach-O, objcopy --keep-global-symbols on ELF); nm verifies the result and the build fails on any other defined global. target/<…>/<name>.sealed.txt lists the exports and the imports the consumer's link still resolves. A sealed cdylib exports the same set and is checked the same way. What sealing closes: a consumer object that defines a name-public function's mangled symbol, and a declaration of that symbol. What it leaves: the imports the closure cannot define (libc, the platform frameworks); a consumer who owns the process can define those or patch the bytes, and no link-time measure changes that. On Windows the DLL is the sealed form (kind = "cdylib"). Depending on a sealed package from C+ is E0896.
  • [package] vendor = [...] lists directories to find packages in, relative to the manifest or absolute, searched after <project>/vendor/ and before the sibling directory and the store. A missing entry is E0416 at the manifest; E0854 now lists every directory it searched. The sibling fallback is documented for the first time.
  • Prebuilding for a target that lacks part of the stdlib. The stdlib slice for an ESP32 target leaves out the modules the target excludes, so a project that depends on stdlib or espidf builds for esp32-xtensa from the vendor tree as installed (the prebuild used to fail on the first async fn in executor). The exclusion list now also names what stands on the excluded modules — future, date, bundle, fs_sys, the stdlib umbrella — and importing those on an ESP32 target is E0866.
  • --min-os on a macOS host build sets the deployment target (-mmacosx-version-min) for the program, its link and its prebuilt dependency slices. The slice fingerprint now includes the floor (from --min-os or MACOSX_DEPLOYMENT_TARGET), so changing it rebuilds them.
  • cpc build --print-packages prints <name> <version> <prebuilt|source> <directory> per dependency, the directory with symlinks followed: which copy of each package the build uses.
  • E0324 suggests the C+ name when a method is another language's spelling of one the receiver has (len → count, starts_with → has_prefix, push → append), or a near miss of one.
  • Archive builds report what they wrote. A library package, and an app built for iOS, Android or ESP32, prints ok: N modules -> <archive> like an executable build does, and adds the --print-link-args command for the same target and mode when the package has dependencies, since the archive holds only its own modules.
  • Android command-line programs link. An Android entry that defines export extern fn main (a test runner, a benchmark, a tool run with adb shell) builds to an executable, target/android-arm64/<mode>/<name>: the archive and its dependencies' slices, linked by the NDK clang with -lm -ldl and 16 KB page alignment. Other libraries come from the packages' [android.link]. An entry without main still stops at the archive.
  • Prebuilt packages and borrows through their headers. A free function whose return can carry a borrowed parameter keeps its body in lib/include/, as a method already did, and a stripped one returns none of its parameters. Before, every body-less function that turned a str into an owned value counted as keeping its argument: with stdlib prebuilt, args.append(text::from_str(value)) made the helper a keeper, and passing it an interpolation was E0513. A consumer no longer compiles the bodies a header keeps; it declares them and links the archive's code. Compiling them failed to link when the body called one of the module's private helpers.
  • -framework only on Apple link lines. A dependency's [link] frameworks no longer reach an Android, Linux, Windows, ESP32 or wasm link (--print-link-args for android-arm64 gave the NDK -framework Foundation). objc names Foundation and -lobjc in [macos.link] and [ios.link], so depending on it unscoped no longer puts -lobjc on an Android link.
  • Internal compiler errors. When clang rejects the IR cpc generated, cpc says so and that it is a cpc bug, not the user's code, and keeps the IR at <out>.rejected.ll. A link failure keeps its plain message.
  • facet_android: a still image no longer aborts a debuggable app. Every image mount asked its drawable to stop animating through Animatable, and a BitmapDrawable (any PNG or JPEG from a file or asset) does not implement it; CheckJNI aborted the process. The drawable is now asked whether it is Animatable first. Animated drawables start and stop as before.

Standard library

  • process::run(argv, cwd:) runs a child on this process's stdin, stdout and stderr and returns its exit code, so a tool driving adb or git streams their output without a read/write loop: process::run(["adb", "-s", serial, "push", src, dst]). 127 when the child could not start. Child.pid(), stdout_fd() and stderr_fd() take this (they read a field), so a let child can answer them.
  • fs::Metadata.is_file and fs::is_file(path): a regular file, after following symlinks. !is_dir was the only test, and it counted fifos, sockets and devices as files.
  • stdlib/math declares min, max and clamp for every integer width; clamp answers hi when lo > hi, as the float ones do.

Documentation

  • ffi.md no longer claims that only export is callable from outside. It separates the foreign interface from symbol reachability, states the executable and library cases, and names [library] sealed = true with its limit.
  • ownership.md, memory-model.md and skill.md state what drops behind a raw pointer: assignment drops the value it overwrites; *p = v and p[i] = v do not; (*p).f = v drops the old field; free runs no drop, and box::from_raw is how a pointee is torn down. #str_ptr of a sub-view or of a Text view is not NUL-terminated; c_str() is.
  • spec.md says ranges appear only as the iterator of for … in and states the counter rule.

v0.0.30 — 2026-10-16

This release brings WinUI 3 as the default Windows UI and agent backend, the appenv package and a single cross-platform asset staging rule in cpc, one hybrid_web page messaging contract across all five UI backends, Liquid Glass and Material 3 UI parity, compiler soundness and borrow-checker hardening, and security audit remediations across cplus-pm, agent_mcp, and CI.

Upgrade notes

  • facet_runtime::app_data_dir() and facet_runtime::cache_dir() are removed; use appenv::app_data_dir() and appenv::cache_dir(), which answer from the first line of main on every platform without waiting for a window.
  • On Windows, facet_runtime and facet_agent now select facet_winui and agent_winui by default. facet_win32 is deprecated and remains available as an explicit opt-out.
  • scroll now takes a @view block (scroll { ... }); attaching a @view block to a leaf control reports E1010.
  • hybrid_web uses one page API on every backend: JavaScript sends messages up with window.facet.postMessage(str) (available from document start), native delivers down by firing HybridWebViewMessageReceived on window with e.detail.message, and the C+ on_message callback reads the payload through hybrid_page::message(sender). The old per-backend window.facet.onmessage / window.facet.receive hooks are gone.
  • Discarding a call's Status return value as a bare statement now warns with W0009 (let _ = call(); silences it deliberately).
  • Value-producing functions across stdlib, cpc-bindgen collection bridges, and vendored packages now return either the complete result or an empty value on allocation or read failure, never a truncated prefix.

Language and compiler

  • Borrow checker and soundness hardening.
    • A method returning a view derived from a parameter ties that parameter's loan for the lifetime of the view, including calls through function values and interface methods on generic receivers (fn use_it[T: Picker](p: T)).
    • take of a view type (str, T[], or a view-carrying struct/enum) is checked as a borrow rather than a consuming move, and thread::spawn_with detaches its argument's borrow ties properly.
    • Type aliases (type S = str;, type Guard = Scope;) are resolved before borrow, move, and NLL drop analysis, so aliased views, non-Copy types, and Drop guards obey the same rules as their underlying types.
    • Deferred initialization (let x: T; x = expr;) runs partial-move (E0509, E0337) and wrapper move consumption checks on the right-hand side.
    • Same-block LIFO drop ordering checks E0514 against active borrows before releasing each local's own loans; cross-statement writes and ref borrows check overlapping sub-place loans (d.field, d[i]); nested variant patterns on borrowed scrutinees enforce E0337; and Send/Sync cycle detection tags struct and enum IDs in separate namespaces.
  • Diagnostics and attributes.
    • W0009 warns when a Status return value is discarded as an expression statement.
    • W0007 catches (1 << n) as u64 where a shift happens at default i32 width before widening.
    • E0310 diagnoses cycles in type aliases cleanly instead of recursing.
    • E0510 counts a helper as a release function only when its body actually releases.
    • #target_feature("avx2,fma") and the CLI flags --target-cpu / --target-feature control target code generation per function or per build.
  • Codegen.
    • gen_drop_in_place uses field_addr on planned structs (#[align(N)], #[packed]), fixing invalid GEP emission when an owning field sits at a non-zero offset.
    • Static arrays of empty strings emit a valid constant initializer, and enums carrying inner enums size their payload slot from the inner layout.
    • An interface default method body resolves imports from its declaring module.

Toolchain, assets, and package manager

  • One project asset rule (cpc build, cpc package, --print-asset-dir). Every app build stages <root>/assets/* flat into target/assets/<target>/<mode>/ incrementally and mirrors staged assets beside a self-linked binary (tracked by .cplus-assets and refusing any asset that would overwrite the binary). cpc build --print-asset-dir stages and prints the directory for external builders (Xcode, Gradle/aapt2, Iris), and cpc package bundles from the same staged tree.
  • One [package] app_id across platforms. cpc init writes app_id into Cplus.toml and every generated platform file, and cpc build validates it (E0415 on an invalid identifier, W0008 when a platform file drifts). A refused cpc init leaves no directory behind.
  • Windows DLL and link support. A [library] cdylib on Windows links against the standard Windows system libraries, writes <name>.dll and <name>.lib, exports the C ABI symbols declared in its generated header, and omits -rpath on PE links. [link] libs expands ${VAR} environment references like search-paths and extra-objects.
  • Doctests. cpc test runs ```cplus documentation fences, skips other language fences, and fails on unclosed fences.
  • Security hardening (cplus-pm, cpc, agent_mcp, CI).
    • cplus-pm keys cache slots and tag records injectively (audit F01), refuses to write or remove unstamped directories or follow vendor/ symlinks outside the project (audit F02), and verifies that fetched package directories resolve inside the repository checkout.
    • agent_mcp places local descriptors in a verified 0700 per-user directory /tmp/cplus-<uid>/ (audit F04), rejects cross-origin, foreign-Host, and non-JSON requests on the loopback HTTP transport (audit F03), and buffers partial non-blocking socket reads per client without stalling the UI loop.
    • GitHub Actions workflows run test jobs with read-only tokens, isolate release publishing into build-free jobs with provenance attestation, and pin all actions by commit SHA (audit F05).

Facet, WinUI 3, and the agent stack

  • WinUI 3 (facet_winui, agent_winui, winui).
    • Generated WinMD bindings and a complete native WinUI 3 backend: multi-window host, custom and blended window chrome, App::menu MenuBar, modal alerts and file/folder/save pickers, TabView, tables, lists, collections, WebView2 and hybrid_web, drag-and-drop on any node, gesture and keyboard bands, focus commands, light/dark theme tracking, per-window density observers, run_on_main from background threads, and adopt_native for hosting inside an existing WinUI window.
    • agent_winui and facet_agent_winui expose every live window over the MCP and in-app agent surfaces.
  • Cross-platform UI and mobile polish.
    • One hybrid_web page bridge (facet/hybrid_page): unified window.facet.postMessage up, HybridWebViewMessageReceived custom event down, and hybrid_page::message(sender) across AppKit, UIKit, Android, GTK, and WinUI.
    • iOS 26 Liquid Glass (facet_uikit): native UITabBar with floating and sidebar glass placement, scroll panes running under glass bars, native whole-window push navigation, action sheets for choose, and blur_effect.
    • Android Material 3 & Material You (facet_android): dynamic system palette tokens, Material 3 top and bottom tab bars with indicator pills, Material bottom sheets, Material dialogs (alert, choose, prompt), per-corner radii, and content:// URI reading/writing in FacetFiles.
    • Symbols and icons: bundled Material Symbols font compiled into the binary (facet/icon_font), button(symbol:) and icon_button(symbol:), and tab bar icons across backends.
    • Text roles: named_size resolves to each platform's native typography ramp.
    • File drops and save panel: allow_file_drop, dropped_files, and drag_over on any node, plus choose_save_path.
    • Agent & Inspector: every control property is readable and writable through generated inspector descriptors (window_width / window_height included); agents can press individual tabs, pick popup items and date/time pickers, read and answer iOS/Android alerts, and are refused when targeting controls on hidden screens or behind an active sheet.

Standard library and packages

  • appenv: cross-platform app_data_dir, cache_dir, no_backup_dir, exclude_from_backup, resource_dir, asset_path, read_asset, read_asset_text, and app_id, usable from the first line of main on macOS, Linux, Windows, iOS, and Android.
  • stdlib: added stdlib/template (Template unjoined string literals), stdlib/path (join, parent, file_name, stem, extension), and process::current_id(). File::read_to_end and File::lines never return a short read as whole.
  • flex_layout: added .basis / .basis_percent, ladder-range band rules (hide_up_to, hide_from, show_up_to, show_from, add_rule_up_to, add_rule_from), bands::default_set(), BandSet::first_match, and HIG layout presets (.readable_width(), .sidebar_width(), screen filling its viewport).
  • jni: mutf8 converts JNI's modified UTF-8 at every Java string boundary in jni, android_view, http, and filepicker, so astral-plane characters (such as emoji) and embedded NULs round-trip as valid UTF-8 without tripping CheckJNI.
  • filepicker and share: FileRef reads and writes both filesystem paths and Android content:// URIs; share::file works on Android; camera adds preview(fit:).

v0.0.29 — 2026-09-24

A compiler release: a bit-reinterpret intrinsic, four ownership and checking fixes in generic and enum code, and two toolchain defects that produced wrong output or failed builds without saying why.

Upgrade notes

  • fN::from_bits(uN) and a float's .to_bits() are removed; write #bitcast::[f32](bits) and #bitcast::[u32](x) (either signedness of the integer works). Both old spellings report E0324 naming the replacement. A SIMD mask's .to_bits() is a different method and stays.
  • A generic impl body is now checked where it is written, so a template that never type-checked reports its errors (E0302, E0324, …) at its own line instead of compiling.
  • An unbounded T inside a generic body counts as owning a destructor, so E0509 and E0337 apply to it as they do to Text: struct W[T] { v: T } with fn get(this) -> T { return this.v; } is now refused. Bound it [T: Copy], or take the payload with a consuming match.

Language

  • #bitcast::[T](v) reinterprets a float's bits. A float and an integer of the same width swap types with the bits unchanged: f32↔u32/i32, f64↔u64/i64, f16↔u16/i16. #bitcast::[u32](1.0f32) is 0x3F800000, where 1.0f32 as u32 is 1. An unsuffixed literal takes the partner type, so #bitcast::[f32](0xBF800000) is -1.0 rather than an out-of-range i32. NaN payloads, infinities and -0.0 come through unchanged, and that holds in const/static position too (const INF: f32 = #bitcast::[f32](0x7F800000);): a folded float travels as an f64, which drops an f32 signalling NaN or an f16 NaN payload, so the exact pattern rides alongside it and is what gets emitted. usize/isize, int↔int and float↔float are refused (E0302): the first pair's width depends on the target, and the others are what as is for. jni's JValue::of_float / of_double, which punned through a pointer for want of this, now use it.
  • #bitcast is the only spelling. The unsigned-only fN::from_bits / .to_bits() pair it replaces is gone (see the upgrade notes); a derived Hash over float fields now bitcasts too, with the same hash values.

Toolchain

  • A generic impl's method bodies now report their errors. Sema type-checked every generic impl body against its template and then discarded what it found, on the recorded belief that the body was checked again per instantiation. Nothing checks a method body after that pass, so a template could carry an unknown method or field (a compiler panic at codegen), a wrong arity or a plain type mismatch (compiled), or return 5 in a -> T body instantiated at bool (linked, as ret i1 5). The reports now land at the template's own line, with the codes a concrete impl gets. Measured first: zero new errors across stdlib, facet and the example apps, whose generic bodies already obeyed the rules.
  • A template's T may own a destructor. Inside a generic body a type parameter answered "carries no drop", so struct W[T] { v: T } with fn get(this) -> T { return this.v; } was not a partial move — and at W[Text] the field was returned and then dropped again with the shell, a double free written in the safe subset with no raw pointer in sight. An unbounded T now counts as owning, so E0509 and E0337 apply to it as they do to Text; a [T: Copy] bound keeps the bit-copy getter, and a consuming match stays the way to take a payload out. E0509 also names the type as spelled (W[T], (T, i32)) instead of the internal W__Param_T / __Tuple[T, i32].
  • A consuming method on an enum local is a move the drop scanner sees. e.into_inner() through a take this method left e classified as never-moved, because the scanner consulted struct methods only: a debug build of the compiler aborted on the guard that exists to catch exactly that, and a release build dropped the moved-out shell again at the caller's scope exit. That second drop had been cancelling a leak on the callee's side, below, so the counts looked right. The scanner consults enum methods now.
  • A take this method on an enum drops what it owns. The enum method emitter bound this and the parameters and registered no drop for either, so a consuming method on an enum leaked its payload and every take parameter (fn both(take this, take d: H) dropped neither); the struct emitter had always dropped both. Measured with a weighted counter across twelve receiver and parameter shapes, enum and struct, method and free function: each now drops exactly what it owns, once.
  • A static with no constant form stops the build. Codegen's fallback for an initializer it could not render emitted poison, on the belief that the IR would then fail to assemble. It does not: global float poison is valid, so such a static compiled and read garbage. The fallback now emits a marker clang rejects on that line (cpc-bug:static-initializer-has-no-constant-form). Reaching it is a compiler bug; no known program does.
  • Concurrent builds no longer break each other's prebuilds. Every cpc that found a package's prebuilt slice stale rebuilt it, and each rebuild began by deleting the package's shared object directory under the others' running clangs (unable to rename temporary …). Any two builds sharing a vendor/ tree could hit it, and it failed 2–4 tests of every e2e run that started with a cold stdlib. One process now prebuilds a package under a per-package lock while the others wait and reuse its slice, printing cpc: waiting for another cpc to finish prebuilding ``.

v0.0.28 — 2026-09-18

This release spans the language and toolchain, package management, the agent surface, Facet's application model, and native Windows, Linux, and Android support.

Upgrade notes

  • [[bin]] / [lib] are removed. Applications use entry (with src/main.cplus as the default), and C-ABI libraries use [library].
  • executor::block_on / executor::run are removed. Use async fn main, .wait(), or future::wait_or_cancel.
  • A guard let complement is else Pattern, without pipe delimiters.
  • facet/runtime and facet/agent moved to the facet_runtime and facet_agent packages. The application and navigation APIs changed with the split; the detailed migration table is linked below.
  • The raw SQLite import is sqlite/raw; sqlite_ffi is no longer a separate package. static-arena is now static_arena, and terminal/appkit is now terminal/backend.
  • Agent-surface reads and actions take an explicit capability grant, and multiple UI selection is represented as a set.

Async and concurrency

  • async fn main and async #[test] functions are driven by the compiler. Synchronous code consumes a future through .wait() or the cancellable future::wait_or_cancel path; the old executor entry points are gone.
  • Dropping a future destroys its suspended frame tree, the reactor owns detached spawned work through teardown, and thread scopes request cancellation before joining.
  • Async/thread bridges, sockets, and platform reactors gained deadline-aware operations. Windows socket and pipe waits are cooperatively cancellable.

Facet applications and navigation

  • Applications register windows with app.window(name, factory, chrome:) and start through App::run. Window instances are addressed by name and key.
  • Each window owns routes, default slots, and retained Back/Forward history. Screens receive instance arguments and navigation-state hooks. Window opening never falls back to content navigation on another platform.
  • Removed app.screen, Screen::chrome, the standalone runtime hosts and runtime::Window, global content navigation, and nav::Show modes. See the migration table.

Lifecycle

  • A component is told when it is on screen, whatever moved the tree. component::Attach::Foreground and component::Detach::Background now reach a boxed component (component::child) and a presented one (mount::set_content) from the tree itself, not only from the app event stream. One pass computes the answer — in a mounted window, and neither the node nor any ancestor Display::None or invisible — and announces the transitions; no mutating verb announces anything, so switch_to parking a pane, set_shown hiding one, an ancestor hidden twelve levels up and a band rule collapsing a column all arrive the same way. It is not occlusion: scrolled out of view, behind another window or under a sheet are not known and are not claimed.
  • The pass runs at the end of the frame (mount::sync, and again after layout through core::frames_settled, where band rules have resolved into display). A pane parked and restored inside one tick nets out to nothing, and everything leaving is told before anything arriving, so a device handed between screens is released on one side before the other asks for it.
  • A parked pane used to hear Attach::Mount again on every restore, and nothing at all on the way out. The node's single attach slot carries no reason, so component::child could say one word; the reason now rides the node's presentation record, the repair screen::ScreenBox already had. Mount keeps meaning what it meant — the application put this in the tree — and is said once per attachment. A component's own root is also no longer silently robbed of its lifecycle when the application sets on_attach on it.

Toolchain

  • This in a method body is the block's own type, whatever else the file impls. The self-type was bound while method signatures were collected and left set afterwards, so every method BODY in the build resolved This against whichever impl block came last. With two blocks in one file, let t: This = this; in the first one typed t as the second one's target: a compiler panic when that type lacks the field named next, and IR clang rejects when it has it. Signatures were unaffected, and swapping the two blocks made the same program build. Bodies now bind the self-type for themselves, structs, enums and blessed builtin impls alike.
  • A package's public static stays in its own archive. Splitting the library into one object per module placed data by reachability, and a static that nothing inside the package reads is reached from nowhere — so it was in no member of lib<name>.a and no export of the dylib, though it is made weak_odr for the express purpose of being kept. A global that its linkage says must survive the link is now defined in its own module's piece whether or not anything reaches it, while one the linkage says is discardable still travels only where it is used. Verified against the single-object build: the two now export the same data symbols.
  • A package archives one object per module. lib<name>.a used to hold a single object, so resolving any symbol from a package linked every module it had — a facet app on Android that imports stdlib/vec linked process and pty, and with them a posix_spawn API floor of 28 for code it could not reach. The library pipeline now partitions the emitted IR one piece per source file, compiles the pieces in parallel and archives all of them; a consumer links the modules it reaches. The Android gallery links at API 24 again. CPC_ONE_OBJECT=1 restores the single object.
  • A call to an extension method whose module is not imported reports one error: E0388 at the call site, naming the import to add. It used to be preceded by an E0312 per defaulted parameter, each located inside the extending module's file (.gesture(on_click: h) without facet/gestures: twenty errors inside vendor/, the real one last).

Packages

  • A bundled archive named lib<package>.a appears once on the link line. The default prebuild setting no longer causes the same author-supplied archive to be classified and appended a second time.
  • llama_cpp regenerated against llama.cpp b11003 (0.4.1), and regenerated from upstream's own headers from now on. The package used to carry a hand-curated upstream/llama_cplus.h mirroring llama.cpp's ABI; it had drifted badly — still declaring llama_model_params::use_mmap, use_direct_io and use_mlock after upstream deleted them, never having heard of load_mode, lazy_mode, load_mtp or llama_context_params::n_outputs_max_per_seq. Every field past n_gpu_layers read the wrong bytes. build.sh now runs cpc-bindgen directly on include/llama.h and tools/mtmd/mtmd.h, so layouts come from clang's record layout of the real header and the mirror is gone.
  • The facade gained a sampler chain (temperature/top_k/top_p/min_p/ seed on load, greedy at temperature 0), Session::tokens_for, describe, reset, train_context_size, parameter_count, embedding_size, vocabulary_size, bitmap_audio, and Bitmap dimension accessors. Three fixes rode along: sample no longer calls llama_sampler_accept after llama_sampler_sample (which already accepts — the double count skews every stateful sampler), model paths cross to C as a NUL-terminated CString rather than a bare str pointer, and generate clears the KV cache unless asked to continue.
  • llama_cpp gained an e2e suite (src/test_main.cplus) that loads a real GGUF and drives real inference, gated on LLAMA_CPP_TEST_MODEL and loud when it skips. The unit tests never reach a llama_* symbol, so this is the only half that can catch ABI drift — restoring the stale llama_model_params kills the test binary with SIGSEGV, which is what it is there to do.

Platforms and capabilities

  • Windows gained a complete host toolchain path, the standard-library platform layer, a broad native Facet backend, the agent/inspector transport, WinHTTP and filesystem watching, Media Foundation camera capture, Credential Manager storage, file picking, notifications, permissions, haptics, and related capability backends.
  • Linux gained a rebuilt GTK Facet backend and agent surface plus native process/PTY, terminal, HTTP, inotify, camera/V4L2 preview, location, secure storage, file-picker, and inspector paths.
  • Android gained a native Facet runtime and agent surface, recycler-backed controls, rich rendering and input, notifications, application links, secure storage, system file picking, and Maven/AAR dependency resolution.
  • iOS gained a much broader UIKit surface, device/simulator checks, multiwindow and keyboard behavior, context menus, agent access, notifications, application links, and camera/device capability integrations.
  • The capability layer now covers notifications, application links, camera, location, sensors, biometrics, secure storage, permissions, file picking, haptics, sharing, HTTP, and filesystem watching with native implementations or explicit unsupported results per platform.

Completion — one composed answer, three front doors

  • complete FILE:LINE:COL — the caret question, answered whole. The graph decides whether a caret follows a . (the receiver's fields and methods), a :: (a module's items or a type's methods and variants), or neither (everything in scope), filters by the word already typed, and ranks nearest-binding-first. scope-at / type-at / members remain the primitives; deciding which of them a caret is asking is C+'s rules, so it lives in the compiler rather than in each caller. Available as cpc query complete, as the complete_at MCP tool, and as the LSP's textDocument/completion — all three call one function in core.
  • cpc lsp is resident. It used to rebuild the whole project on every request (~2 s each on a large one), which is why it had no completion. The graph is now built once per project root and kept warm, with open buffers overlaid and rebuilds on a worker — the same session type cpc mcp uses, now shared from cplus-core::session rather than duplicated. Measured on a 185-module project: 3.7 s for the first answer, 3.7 ms for every one after it.
  • cpc lsp resolves dependencies. It loaded projects without their declared [dependencies], so every vendored import reported E0401 imported file not found, the graph never built, and the editor silently fell back to single-file behaviour on any real project. It now resolves the way cpc build does, and diagnostics for such a project are the program's own instead of a fabricated missing import.
  • The graph is indexed. CodeGraph carries by_id / by_name (symbol id and bare name to node indices), built once with it, so def, members, symbols, callable_ids and the completion walks stop scanning the whole node vector. Measured on a 43k-node project: find_members 1.63 → 0.29 ms, 2.67 → 0.43 ms on a 107-member type, file_symbols 0.12 → 0.07 ms. A symbol id can repeat (two impl blocks, one method name), so both maps hold a list — and answers stay in declaration order, so an indexed query answers identically to the scan it replaced. cpc lsp also stopped canonicalizing every file in the project on every request.

facet — Return in a prompt commits what you TYPED

  • The key equivalents landed and Return still "did not work", because the sheet committed the value it OPENED with. An NSTextField does not hold the text you are typing — the window's shared FIELD EDITOR does, and stringValue is only refreshed from it when editing ENDS. Clicking a button ends editing on the way, because the click moves first responder. Return does not: it arrives through performKeyEquivalent:, which fires the button before anything touches the responder chain. So a Rename kept the old name and a New File got an empty one. prompt_ok now sends endEditingFor: before reading, which is what every native dialog does.
  • The routing itself is now tested rather than left to hands. A real NSEvent through performKeyEquivalent: is what a window does with a key-down before the responder chain sees it, so driving it is the routing and not a stand-in for it. Setting keyEquivalent and asserting the property — which is all the previous change did — asserts nothing about whether AppKit delivers the key.
  • Also pinned, and NOT facet's doing: a prompt opens with the caret in the field and the old name selected. A selectText: call was added here on the assumption that it did not, and removed again when measurement showed it changed nothing — AppKit's initial-key-view behaviour already does both. The test stays, because a future change to the tree could take it away.

agent — wired was false for a gesture, and click acted then denied it

  • A regression from wired itself. It read appkit_ext's agent-click SLOT for every non-control — a slot facet never fills — so every gesture-bound container reported wired=false. That is the one CORRECT way to make a non-control clickable, and the very form the flag was added to tell apart from a dead button.
  • A framework swaps in a class that receives input only for a node that HAS input: facet leaves a plain container as a FlexFlippedView, which does not answer performClick:, and arms it into a FacetInput00, which does. So answering the selector IS the answer. The exception is appkit_ext's own two classes, whose performClick: reads the slot and does nothing when it is empty — for those, and only those, the slot is the question.
  • click no longer acts and then reports no_handler. The first version sent the click anyway on the reasoning that a report is not a refusal. That was worse than the bug it replaced: a verb that performs the action and says it did not cannot be trusted in either direction, and an agent retrying does the thing twice. It refuses without sending now, so a disagreement is inert.

facet_runtime — a screen is not freed while its jobs are running

  • App::run settles before dropping the primary screen. Two of the three paths that free a screen did not. pushed_closed calls on_detach, removes the entry and frees the box; presented_closed frees the tree — neither waited. A worker still inside that memory keeps writing, the next screen is allocated into it, and the fault surfaces in whatever was allocated next, which is why this family of crash never looked like the screen that caused it.
  • Both settle now, and the wait lives at the FREE rather than at a caller: close_all_pushed runs before App::run's settle, so a wait at the caller would still have been too late for pushed screens.
  • The bailout says so. spins > 100000 turns "teardown would wedge" into "teardown frees anyway", which is the same crash by another route. It is now a line on stderr rather than a silent break.

facet — the dialogs answer the keyboard, and open on a value

  • Return and Escape. A native alert gives a window a default button and a cancel button for free; a facet sheet is built out of facet controls — which is what makes it keyed and agent-drivable — and the cost is that everything the platform did for nothing has to be said. It was not said, so typing a name into a prompt and pressing Return did nothing, and the only way out of any sheet was the mouse. The primary button now carries keyEquivalent "\r" and the secondary "\x1b", which also draws the default accented. Return fires while the text field has focus, because a window's default button answers regardless of first responder.
  • A choose sheet binds neither, deliberately: its buttons are N options and none is "the obvious one", so binding Return would act on the user's behalf without being asked.
  • prompt opens on a value. initial: — the ledger's initialValue, which is NOT the placeholder: one is the hint shown while the field is empty, the other is what the field starts with and what a person then edits. Only the hint had reached facet's signature, so Rename opened on nothing with the old name greyed out behind the caret. Appended last, on the neutral base and both facades.
  • Guard 8: an implementation CLAIM accounts for the row's parameters. METHOD_DROPS says "facet says it as runtime::prompt" and that was checked at the METHOD level only — the verb exists, so the row is answered. A claim on a row with three or more parameters now has to say what each one is carried as, or that it is absent and why. It found two more the moment it ran: DisplayActionSheet's cancel and destruction — a choose sheet has no cancel button and no way to mark an option destructive, and neither absence had been decided. Nine unaccounted parameters print on every regen.

facet_uikit — a context menu, as the platform's own long press

  • context_menu is built on iOS: UIContextMenuInteraction + UIMenu / UIAction, in menus.cplus. A right-click and a touch-and-hold are one affordance — Apple's own framing — so the ledger's ContextFlyout maps 1:1 and facet's contract never says "right click"; each backend picks the gesture its platform has, the way swipeable is a menu on macOS and a pan on iOS.
  • The menu is built when it OPENS, not when it is attached. A UIMenu is immutable and arrives from a provider block, where AppKit mutates an NSMenu built at attach time — so the provider re-reads the nodes each time and enabled and the titles are current with no refresh path at all.
  • A UIAction is the sender. UIActionHandler is void (^)(UIAction *), so one block type serves every item. UIAccessibilityIdentification is not adopted by UIMenuElement, so the key rides UIAction.identifier — the slot that means the same thing — and the payload rides an associated object. component::key_of / item_of answer off a menu action exactly as off a row, and reading a sender that is not a view answers empty instead of raising, the same guard AppKit needed.
  • A separator is an inline group. UIKit has no separator element; the runs either side of a titleless item become UIMenuOptionsDisplayInline sub-menus, which is what draws the divider.
  • Inside a table the TABLE answers — tableView:contextMenuConfiguration ForRowAtIndexPath:point: — because UITableView intercepts the long press to arbitrate it against scrolling. The same split that made a context_menu in an NSOutlineView row unreachable on AppKit. Both paths end in one function.
  • The blocks are hand-built with a static descriptor rather than taken from the generated binding: Block_copy keeps the descriptor POINTER, and a UIAction is retained by UIKit for the life of the menu, so a descriptor on the frame that built the action is read after that frame is gone.
  • Six checks in selftest.cplus, run on a real simulator by tools/run_ios_tests.sh — 78 passed, 0 failed. Disabling the two lines in wants_view / create turns two of them red, which is what makes them checks rather than decoration.

facet — the payload half of a handler

  • item: at construction, on the eight controls whose ledger type declares CommandParameter — button, checkbox, icon_button, refreshable, menu_item, context_menu_item, swipe_item, toolbar_item. It sits on the shared band beside key, and the pair is the point: key is the ADDRESS a node answers to, item is the PAYLOAD its handler receives.
  • It had to be a constructor parameter rather than only core::set_item. A handler is fn(sender, ctx) and a bound method fills ctx with its RECEIVER (E0824) — the same pointer for every row — so the payload is the only thing that can say which one, and it has to be settable in the same expression that sets the handler. Reached only through a setter it forces a builder call into three statements, which is why an application that needed it encoded the payload into the KEY and parsed it back out instead.
  • Appended LAST in each signature, so nothing a caller already passes positionally moves; every existing call site compiles unchanged.
  • CommandParameter stopped being dropped as MVVM. It shared one regex and one reason string with Command — but Command is ICommand, which IS the view-model and is rightly dropped, while CommandParameter is the ARGUMENT the handler needs. facet had already rebuilt the concept from first principles as core::set_item / item_of, whose own comment reads "an item IS the payload half of a handler" — this row's definition. The map now points at where it lives instead of contradicting the code.

facet — the contract closes over TYPES, not only rows

  • Guard 7: a type the ledger renders must be decided. A row could not leave the ledger without a reason — an unmapped one fails the run — and a TYPE could. The existing type closure builds its work list from the rows a type declares, so a type whose surface is entirely INHERITED was never asked about, which is exactly what a marker type looks like: MenuFlyoutSeparator declares one member, its constructor.
  • The floor is the ledger's own definition of "this renders": every type it puts on screen has an I<Name>Handler. Each must be extracted, aliased, dropped by family, or UNBUILT — a fourth outcome the other three could not express, because ALIAS claims "already covered, nothing refused".
  • Three were claiming exactly that and were wrong: MenuFlyoutSubItem aliased to MenuFlyout (a submenu is not a flyout), MenuBar to MenuBarItem (the item is not the bar), SwipeItemView to SwipeItem. Six types now print each regen with the platform answer named: MenuBar, MenuFlyoutSeparator, MenuFlyoutSubItem, ShapeView, SwipeItemMenuItem, SwipeItemView.
  • The check runs from gen_contract, not from ledger_spec, because that is where it RUNS: ledger_spec.py has not been able to regenerate the spec for some time (check_type_closure fails on Matrix, NavigationProxy, Shape, TableModel and the GIF decoder, none of which have a family rule), so ledger-spec.json is a frozen artifact and a floor living only there would never fire. Repairing that tool is its own job.

facet — six gaps found building iris

  • A context_menu in a tree or list row can now open. A table or outline view handles right-click itself and asks its OWN menu, which facet never set — so a menu nested in a row was built, attached to the row's view, and unreachable. Both row hosts are facet subclasses now (FacetTableView / FacetOutlineView) whose menuForEvent: answers with the clicked row's menu, after calling super so clickedRow still draws the ring. swipeable/swipe_item was unreachable the same way and is reachable for the same reason.
  • A context_menu under an unkeyed container is no longer dropped. A node carrying one asks for a view exactly as one with a gesture or a background does — wants_menu joins has_gestures and wants_painting. Direct children only, so the rule agrees with attach_context_menu.
  • run_job answers whether it started, and refuses a second flight. Two workers inside one job's run() assign the same fields; where those are Text or Vec the second frees what the first is writing. It shipped as a SIGSEGV. A 64-slot table of job addresses, claimed before the worker spawns and released when the apply is done. job_in_flight is the question five services were each answering with a private flag.
  • The agent surface tells a wired control from a dead one. describe_ui reports wired beside actionable and clickable, and click answers no_handler — because an NSControl is driven by its target/action and ONLY that, so a gesture band on a button never fires. Made honest at the source: controls::arm_control installs an action when there is something on the other end and clears it when there is not, so lldb and Accessibility Inspector read the same fact.
  • The neutral runtime facade compiles, and keeps the facade's surface. runtime.cplus promises app code type-checks on every target; it had stopped compiling on all of them (Appearance::System never existed) and was missing eight members the real facades carry. Build it with cpc build --target android-arm64 — a platform-shadowed file is unbuilt by default on the platform you are standing on.
  • A context_menu_item handler can tell which item fired it. A handler is fn(sender, ctx) and ctx is the component — the same pointer for every row — so identity is read off the sender, and a menu item was the one control kind carrying neither half, because both bindings live in views::create and a menu kind never gets a view. bind_menu_identity gives it the key as its accessibilityIdentifier and the item pointer as an associated object, so component::key_of / item_of answer from a menu action exactly as from a button. swipe_item gets it too.
  • A sender that is not a view no longer raises. key_of and item_of walk superview when the first hop finds nothing, and an NSMenuItem does not answer it — so the natural line sent an unrecognised selector from inside a menu action. input::superview_of answers 0 for an object with no superview, which is what the walk's termination condition already means.
  • context_menu on iOS is an audible debt. Being a non-view kind was answered first and stopped the question, so declaring one produced no menu and no warning. It warns once now, like every other not-yet-built kind. facet_gtk's README carries the same decision in writing.

Language — a label names a parameter of the receiver's own method

  • Two types may share a labeled method name. Named arguments are rewritten into positional order by the LOWERING pass, which runs before types exist and so keys method candidates by bare name — every type declaring on was a candidate for s.on(v: 5), and the call was E1002 whenever those candidates disagreed. It now settles only what every candidate agrees on and leaves the rest to sema, which knows the receiver's type and arranges the call from that type's own parameter list. reload(then:, then_ctx:) on two stores no longer breaks either one's callers, and no method needs renaming to make a labeled call resolve.
  • Two identical declarations are one arrangement. The dedup that decides whether two candidates would lower a call the same way compared the spliced default expressions, and an Expr carries its span — so the 0 in one impl block never equalled the 0 in another, and any call omitting a shared default was reported as ambiguous between two declarations a reader cannot tell apart. Defaults now compare by VALUE.
  • A label that fits only another type's method was a MISCOMPILE, not an error. Given A::go(v, ctx = 0) and B::go(ctx, v = 9), the call a.go(ctx: 3) had exactly one candidate that accepted it — B's — and that arrangement was applied to an A receiver: the label ctx bound to A's parameter v, and B's default 9 was spliced into A's ctx. It compiled, and returned a value, for a call whose required argument was never given. Accepting is not belonging: with more than one candidate, a candidate rejecting the call is itself type-dependent information, so the decision goes to sema. a.go(ctx: 3) is now E0308, naming A's own v.
  • E1002 is left for the callees that really have no parameter names: a fn-pointer value (its type records parameter types, not names — a handler field included), and a method reached through a generic receiver, which is not one type until it is instantiated. Its message says which, instead of describing method-name matching that no longer decides anything.

v0.0.27 — 2026-08-14

From v0.0.26 (~677 commits, 2026-07-02 → 2026-08-11). Three strands: the language and memory model close enough for real C ABI and safe views; facet grows into a full app surface (lifecycle, async, theme, ownership, layout); and the binding/tooling stack reaches Linux (GObject/GTK), layout (flex_layout), data (sqlite), and live tooling (inspector).

Standard library

  • stdlib/slice — checked sub-views over T[]: sub returns Option[T[]] (None on an invalid range), plus clamped prefix/suffix/drop_first/drop_last. The free-fn spelling ships the semantics; the xs.sub(from:to:) method form waits on generic slice impls.
  • stdlib/flags — a Flags option-set over u64 bits, replacing the (dirty & MASK) != (0 as u64) texture with membership verbs: contains / intersects / with / without / toggled plus set algebra (union_with / intersect_with / minus). Bit values come from const masks (constant expressions fold) or repr-enum discriminants cast at the call site.

Language

  • Derive through the empty impl: impl Point: Eq {} — an empty impl block against Eq / Ord / Hash / Clone / ToText generates the memberwise implementation, extending the marker-impl idiom (impl H: Send {}) to code generation. Derived methods are synthesized as ordinary AST before sema, so they type-check, borrow-check and satisfy interface bounds exactly like hand-written ones — a struct with derived Hash + Eq is a valid HashMap key. Field rules: primitives and str direct (str orders via its blessed compare), nested structs recurse through their own methods, payload-free enums compare/hash by discriminant, generic targets carry their declared bounds (impl Pair[T: Eq]: Eq {}). Payload enums, arrays, slices and tuples are not derivable — E0920 names the field and the manual fix. Deriving needs a struct target (E0916 otherwise); Copy remains structural and is never written.
  • Function contracts v0 — #[requires(EXPR)]: machine-checked preconditions in the signature, on fns and methods (repeatable; full expressions over parameters, this fields, and consts — the attribute grammar takes real expressions now). Sema requires bool and PURITY (E0924 — no calls or assignments in a contract); codegen emits each through the assert path at entry, so a violation traps (and test builds report instead of aborting). v0 checks in every build profile; #[ensures] and doc/graph surfacing are follow-ups.
  • Interface default method bodies — an interface method may carry a body instead of a ;, and an implementor may omit it. The body is COPIED into every impl block that left the method out, in lower, before anything else runs: the same mechanism derive uses, and the reason this cost no new machinery. Downstream sees a hand-written method — no new method-instantiation source, no new dispatch kind, no dyn, and This resolving through the impl block the copy now lives in. A default body that calls a method the implementor lacks is diagnosed against THAT type at its own impl block; an interface whose methods all have defaults takes an empty impl (impl A: Greet {}) without tripping E0916. The cost is code size: N implementors get N copies, the trade every generic in the language already makes.
  • Scoped threads (thread::scope) — a set of threads that are all joined before the value goes away, which is what lets a worker BORROW a parent local instead of owning a copy of it. Scope::lend(ref data, f) hands data to a fresh thread; Scope::drop joins every worker it started, on every path out. No Arc, no copy back, no atomics for the common split-work case. What makes it safe is a borrow the checker can see: lend is #[keeps(this)] on a ref parameter, which now ties that argument to the receiver for the receiver's whole life (it used to tie view-typed arguments only — a str is a borrow written as a value, and a ref parameter is a borrow written as a borrow). Three mistakes became compile errors: the lent value dying while the scope lives (E0514), a write into it while a worker holds it (E0381), and lending the same place twice (E0381, two workers with exclusive access to one value). The last two closed real gaps in the borrow model that predate scopes: a mutating method call on a borrowed place was refused, but a plain field WRITE was not, and neither was passing the place as a ref argument. Both now are, for views as much as for scopes.
  • issue-10, the method-generic arm — the body-instantiation pass had two arms, generic free fns and generic-struct impls. A method carrying its own type parameter (impl Holder { fn lend[T](..) }) is neither, so its body was never walked under a concrete T: a generic type it mentioned never got instantiated, monomorphize left it as a TypeKind::Generic, and codegen panicked with "monomorphize did not rewrite this site". Method instantiations now ride the same worklist, so what their bodies discover is chased exactly like a free fn's.
  • #[ensures(EXPR)] — the other half of a contract. Same shape, same purity rule (E0924) and same emission as #[requires], plus the binding result: the value being returned. It is checked at EVERY return, after the value exists and before the scope-exit drops, so a function with three returns is checked three times and no path out skips it. A postcondition on a function that returns nothing is still useful and still allowed — it speaks about this and ref parameters, which is the half a precondition cannot express — but naming result there is E0928, as is a parameter that collides with the binding. A postcondition sits between the call and the ret, which musttail forbids, so a contract turns a tail call into an ordinary one. Still open from the original item: old() state capture, which needs a snapshot rule against the ownership model.
  • #[repr(C)] union: one storage, several typed views — the shape real C headers contain and bindgen could not describe without lying. Same declaration form as a struct (it rides StructDecl with is_union), C's layout rule (size = largest member, alignment = strictest, size rounded up so an array of unions strides correctly — verified field-for-field against clang), and field access at offset 0 with the load's type picking the member. Members must be Copy, the union non-generic and non-empty, and a literal names exactly one member — all E0925, and all consequences of a union having no tag: nothing can know which member is live, so no destructor could be run correctly. For an either/or VALUE in ordinary code the answer is still an enum with payloads, which has that tag.
  • Packed structs and bitfields — the other half of describing a C header. #[repr(C, packed)] removes the padding between fields (and the struct's own alignment with it); #[repr(C, packed = N)] caps each field's alignment at N, C's #pragma pack(N). #[bits(N)] gives an integer field a width and packs it beside its neighbours: a field that would cross its declared type's storage unit starts a new one, packing lets it straddle instead, a signed field sign-extends on read, and a write is a read-modify-write that preserves the neighbours sharing the unit. Every rule is C's and none of it is reasoned about — cpc/tests/ packed_layout_vs_clang.rs builds nine shapes under both compilers and compares sizes, alignments, the struct's BYTES after per-field writes, and each field read back. One consequence has a diagnostic: neither a bitfield nor an under-aligned packed field has an address, so a ref parameter, a ref this receiver and #addr_of are refused (E0927 / E0926). Passing a bitfield to a ref u32 used to take the address of a temporary copy and discard the write. Packed fields must be Copy (a destructor is handed the address of what it tears down); a bitfield needs #[repr(C)], an integer type, a width of 1..=its type's bits, and a non-generic, non-union struct.
  • cpc-bindgen emits both: a bitfield becomes #[bits(N)] with its own signedness, a packed record becomes #[repr(C, packed)], and C's alignment-forcing unsigned :0; becomes the padding width it stands for (computed with the compiler's own placement rule, which the generator now calls rather than re-deriving). What it emitted before was a _packed0: u32 storage slot and read-only accessors that assumed every bitfield in the record lived in that first slot — wrong for a second run, for storage wider than 32 bits, and for every signed field, with no way to write one. A record under #pragma pack(N) is now REFUSED with a comment saying why: clang's JSON AST records that a maximum field alignment applies without saying what it is, and a guessed layout is the failure a binding generator exists to prevent.
  • FFI enums — explicit discriminants + #[repr]: a payload-free enum takes C-style values (NotFound = 404, auto prev + 1 otherwise; any constant expression folds) and an integer representation (#[repr(u8)] … #[repr(i64)], C = i32), which is what it lowers to and crosses the C ABI as. Casts read the declared value; match switches on it. Wrong shapes — payload enums with values or an integer repr, out-of-range or duplicate values — are E0923. (The remaining FFI-completeness items — #[repr(C)] union and packed structs/bitfields — are tracked separately.)
  • Checked narrowing as?: n as? u8 evaluates to Option[u8] — Some(converted) when the value is representable, None otherwise. Integer source and target only (E0315 names the offending side); the infallible as keeps its truncating semantics for the cases where truncation is intended. Branch-free codegen: a 64-bit bounds check selecting the Option tag and payload.
  • Distinct newtypes: type UserId = distinct i64; — a nominal integer alias. Same representation and ABI as the base; not interchangeable with it or with other brands (E0302 with a cast-pointing message). Conversion is explicit as in either direction. Same-brand ==/!= and blessed hash/eq work, so a distinct type satisfies Hash + Eq + Copy bounds and keys a HashMap. Brands survive generics — Vec[UserId] is its own instantiation (mangled by the alias name) whose API takes and returns the brand — and erase to the base integer at the end of monomorphization, so codegen and the C ABI see plain integers. Base must be a plain integer type (E0922).
  • Const expressions: a const (or scalar static) initializer may be any pure expression over literals and other consts — const MASK: u64 = (1u64 << 40) - 1u64;, const CAP2: usize = CAP * 2; — folded in lower before sema. Evaluation is TYPED at the declared width: overflow, bad shifts, division by zero, mixed types without a cast, and reference cycles are hard errors (E0921); the wrap spellings +% -% *% wrap exactly as at runtime. Cross-const references resolve in any order. Array lengths and fill counts take the same expressions inline — [u8; CAP * 2], [0u8; 1 << SHIFT] — evaluated at usize. This retires the wrap-through-i32 mask-building dance.
  • Fixed: [T; CONST] in multi-file builds. The resolver qualified const declarations but never rewrote the array-length lens, so a cross-module (or even same-module, in a binary target) [T; CONST] failed with E0912 "not a known const". The lens (and [v; CONST] fill counts) now resolve like every other item reference.
  • == / != on payload-carrying enums is now E0302 ("match on the variants instead"). The shape previously escaped sema and died as invalid LLVM IR; payload-free enums still compare by discriminant.
  • ${p} interpolation of a struct with impl P: ToText no longer ICEs. Sema admitted the part but codegen's interp lowering only knew primitives / str / Text and hit its unreachable arm. Monomorphize now rewrites such a part into an explicit p.to_text() call, so "${point}" works — including derived ToText and nested structs.
  • guard var / if var / while var: the pattern-binding statements take var in place of let, making the bound value(s) mutable — guard var in the enclosing scope, if var / while var inside the body (fresh per iteration for while var). Previously pattern bindings were always frozen; mutating one meant an extra var x = v; copy. The let spellings and all pattern-let diagnostics (E0347/E0348/E0349/E0350/E0351) are unchanged; a guard var complement binding (else |Pat|) stays immutable, since it is scoped to the diverging else block.
  • Value-turbofish: f::[T] with no call following is a fn-pointer VALUE to the concrete instantiation. Bounds are enforced at the take site (E0502), arity at E0501; ::[T] on a non-generic name is E0821. This makes the type-erasing trampoline pattern expressible from generic code — the basis of facet's lifecycle registry and service runner.
  • Named arguments resolve through type aliases. type Color = vocab::Color; Color::adaptive(light: a, dark: b) used to die as E1002 (and omitted defaults as a bogus arity error) while the fully qualified spelling worked — the resolver qualified the alias by its own name, so the named-argument matcher never found the target's signature. The 2-segment path arm now hops the alias to its target, with the same cross-file visibility gates as the 3-segment arm.
  • Builder-DSL containers take constructor arguments (DSL.5): vstack(key: "body") { ... } inside an @ block is one element — the desugar passes the filled Builder first (ctx::vstack(__b, key: "body")), so every existing fn column(take b: Builder, key: str = "") finisher already satisfies the contract, and keys/config land on the element that has children. The { must follow ) on the same line. A bare { ... } in entry position — including name(args) with its block on the next line, which used to silently parse as two items — is now a parse error naming the fix.
  • Fn-pointer arguments infer generic fn-typed parameters: a parameter f: fn(take I) -> O now unifies structurally with a fn-pointer argument, binding I/O (previously E0302 — a generic fn could not take a fn-typed argument mentioning its own params).
  • Generic calls under await monomorphize correctly. Previously the awaited call site kept its template name and the build failed in codegen.
  • Generic-fn uses inside a method-generic method on a concrete struct are now discovered by monomorphization (previously a codegen panic).

Memory model — view-lifetime hardening

Nine ways a str/slice view of storage that dies at function return could escape unchecked (safe-code use-after-free) are now rejected. A view is tracked by its shape, not a method-name allowlist, through every form it can leak:

  • E0513 by view shape, not name. Returning a view of a local (return t.view(), an alias, or a leaf inside a returned aggregate) is rejected for any view accessor — Text::view, as_str/as_slice, or a user method returning str/T[] from a borrowing receiver — not just two hard-coded names.
  • take parameters / take this are dying roots. A returned view of a take parameter or take this receiver now fires E0513: the callee owns that storage and drops it at return (previously treated as a safe root).
  • Free-function views are traced. return head(local) where head(x) -> str returns a view of its parameter is rejected — the view is rooted at local.
  • Views of temporaries. let s = mk().view(); (a view of a statement-scoped temporary) is rejected; passing such a view as a direct call argument stays legal.
  • Escapes into long-lived places. Storing a view of a frame-dying owner into a static (or a static field) or a ref out-parameter is rejected — the owner outlives neither.
  • All the syntactic leak paths pin the owner (E0372/E0381). A view written into a field/index place, produced by an if/block/match expression, or moved out by a struct destructure now pins its owner exactly like the direct let s = t.view() form.
  • Generic containers are tracked. A slice view of a Vec[T] (or any generic Drop type) now pins it: moving it is E0372 and a mutating method such as append while a slice is live is E0381 (iterator invalidation). A read-only method alongside a live view stays legal — a shared read no longer spuriously conflicts with a shared borrow.
  • E0516 judges the write path, not the target's shape. A view stored through a raw pointer is undeclared-flow at the raw seam, but the rule had matched a bare *p = v target only, so (*sink).key = k — the same store one field deeper — walked through and dangled at runtime. A raw-pointer deref anywhere in the projection chain ((*p).f, (*p)[i], (*p).a.b) is now the same store, since the analysis knows nothing about what p points at either way. A store to a field of a plain local is unaffected. (bugs/str-field-outliving-its-text-is-not-caught.md)
  • A *u8 return no longer erases a view. Storing a view in a struct, boxing it, and returning into_raw()'s pointer used to compile and dangle: no rule fired once the type stopped naming the view. The body flow is now the summary — a raw-pointer-returning fn whose computed return flow carries a view-capable parameter gets that flow promoted to a return borrow, so the caller ties the pointer to the argument's owner and a dying owner is the same E0514 the unerased shape always was. Copying constructors (text::from_str) have an empty computed flow and tie nothing; self-referential carriers root at no parameter and are never promoted; #[keeps(nothing)] opts a declared boundary out. Closes the third and last route in bugs/str-field-outliving-its-text-is-not-caught.md.

facet — component lifecycle

  • interface Lifecycle { fn on_attach(ref this); fn on_detach(ref this); }. Hooks are fired FOR the component, never by it: run_component fires on_attach after the mount (the tree is live; initial routing belongs there) and on_detach when the loop stops, before teardown; teardown then drains the detach of every presented component. Breaking: run_component now requires Component + Lifecycle (empty hooks satisfy it).
  • Handle.present(component) — the component-aware set_child: mounts the component's tree, fires its on_attach, and registers an erased detach so that whichever verb later removes or replaces that content (present, set_child, remove_child, replace_child, teardown) notifies the outgoing component first. Nested outlets included.
  • Liveness: facet::attached(this) / is_attached(cp) answer for mounted components (staged components keep answering by attach state).
  • Handle.switch_to(component) — the outlet verb for siblings the user RETURNS to (tabs, inspector panes, pagers). Each sibling is built once on its first visit; switching parks the outgoing view tree and re-attaches the incoming one, so view state (scroll offset, in-progress input) survives the switch. on_attach fires on every switch-in, on_detach as a sibling parks; switching to the shown sibling is a no-op. The outlet handles its own eviction (outlet leaves the tree → attached sibling detaches, parked trees drop) and theme changes (set_theme drops parked trees; the next switch re-stages against the new palette). Rule of thumb: returning siblings → switch_to; a new screen → present; don't mix the verbs on one outlet.
  • stage / attach / detach remain the manual view-parking tier switch_to is built on. Staging now installs a frame-change observer on the parked root, so attached staged content re-lays its flex tree on ANY resize — window resize AND split-divider drag. (A staged subtree connects to its outlet natively, not in the parent flex tree, so the split-pane relayout walk never descended into it; before the observer a switch_to'd pane stopped reflowing on divider drags until re-attached.)
  • Backend host contract: run_window splits into open_window (mounts, returns) and run_loop (blocks), so hosts can act between mount and loop.

facet — services and async

  • interface Service { produce; apply } + load_service: the threading contract as an interface — produce (the slow read) runs on a worker thread, apply and the optional on_ready(ctx) run back on the main thread. A service conforms once and gets the whole pipeline.
  • run_on_main(work, ctx) — main-thread dispatch, backend-installed.
  • spawn_ui(task) — hand an async task to the UI: it runs eagerly to its first suspension at the call site and resumes on the main thread as awaits complete. The AppKit run loop pumps the stdlib reactor through a dispatch source on its kqueue, so timers and async fd I/O wake tasks with the tree addressable. block_on in a handler remains wrong (it blocks the loop).
  • on_worker(input, f) — awaitable blocking work: f(input) runs on a worker thread and the awaiting task resumes with the result.

facet — App, screens, and navigation

  • Screen — a component that also names its window: one conformance, fn chrome(this) -> Chrome, where Chrome is a plain record built with named parameters (title, size, minimums, titlebar flags, zoom). runtime::run_screen(screen) is run_component with the window read from the screen; it still returns the instance with its final field state.
  • App — the process tier: named screen routes (app.screen(name, factory), factory: fn() -> ScreenBox), an app-global menu-bar builder (default: the app name with Quit), on_launch / on_quit hooks, and app.run(initial, arg?) — one screen at a time as a blocking window; the sequential-window main loop as a type. screen_box(s) erases a screen to the heap so routes of different types share one registry.
  • facet/nav — go(route, arg?) replaces the current screen, push / pop open and dismiss a secondary screen window alongside it, quit() ends the app, arg() reads the argument the showing verb carried. go / quit also unwind a run_screen / run_component window.
  • App context — runtime::app_running / app_name / has_screen / register_screen: process-scoped reads from any handler, live while an App runs. register_screen adds a route at runtime (plugins); the first registration wins.
  • app.agent_mcp(path) + facet/agent — opt-in serving of the agent surface over a Unix socket (describe_ui / click / set_text); each shown screen's window is re-walked into the surface. A separate module so the agent packages stay out of apps that never serve.
  • run_component gains custom_chrome / unified_toolbar / hide_title.

facet — theme

  • Two-tier color names. Tier 1: the platform's semantic colors, extended (placeholder, link, selection backgrounds, fill_secondary, the full system palette). Tier 2: app-retintable THEME roles — primary/ on_primary, secondary/on_secondary, ink(a) (the mark family, alpha on the color), surface/raised/sunken, outline, success/warning/danger, plus the extended surface tiers IDE-grade chrome needs (content/toolbar/tabstrip/track/chip/recessed) — each independently retintable at runtime. An unset role falls back to the nearest Tier-1 color, so a themeless app is native in both appearances. Breaking: Color::primary()/secondary()/tertiary() (the label tiers) are renamed text()/text_secondary()/text_tertiary(); primary now means the brand role.
  • Theme + set_theme. A plain record built with named optional parameters, installed once. Calling set_theme again re-themes the LIVE app: the backend re-resolves recorded paint in place (same sweep as an appearance flip) — runtime theme switching with no extra machinery.
  • Color::adaptive(light:, dark:) — a light/dark rgba pair in one Color, resolved by the current appearance at paint time and re-resolved live on a flip. Replaces per-color is_dark() branching and the rebuild-on-appearance-change dance.
  • Fix: styled containers paint. A column/row/zstack/grid whose style operates on a view (background, gradient, border, corner, clip, opacity, hidden, shadow, transform, fade) now gets a backing view at mount and paints it; previously .background() on a container was a silent no-op unless something else supplied a view.

Standard library

  • Box::into_raw / Box::from_raw — surrender and reclaim a heap slot as a raw pointer across boundaries a Box cannot cross.
  • Reactor: the kqueue fd is exported and a non-blocking poll variant added, so an external event loop can drive spawned futures.
  • thread::JoinHandle's refcount-shared ctx field is marked opaque, removing a spurious W0002 warning from every build that links thread.

agent surface

  • describe_ui modes — the client chooses the view per request. {"params":{"mode":"full"}} opts into the whole walked tree (auto-keyed structural nodes included); the DEFAULT is now the curated exposed view — only developer-exposed nodes, lean fields (id, role, name, actionable, re-parented to the nearest exposed ancestor) via identity::Registry.describe(). Small, high-signal context for agents; the Backend vtable gains describe_exposed (all three backends).
  • Exposed nodes carry a tool schema: name + intent description. A node's name auto-derives from its widget's accessibility label, else its title/text; .accessibility_label overrides it (icon-only controls), and .accessibility_hint supplies the dev-authored intent ("opens the New Project wizard") — surfaced as description in the exposed describe JSON (omitted when empty). One annotation serves VoiceOver and agents alike. Registry gains set_description/description_of; NodeView and UiNode carry the field across all three backends.
  • The surface is lazy: it re-walks on request. It was a one-time walk taken when the window opened — content mounted afterwards (present()-ed screens, added rows, @ui-native mutations: how real apps build) was invisible to describe_ui and unreachable by click/set_text. Every MCP operation now refreshes the surface from its window before acting (marshaled to the main thread, waitUntilDone), so describe/click/set_text always see the tree as it is NOW; a view not yet mounted is simply absent and the agent asks again later. No mutation hooks to keep complete. Verified live in iris: exposed describe grew from the 4-node frozen shell to every launcher and recents control.

facet — the ownership hierarchy

  • process → app → window → node, in MAUI's own words: application.cplus holds Application (theme, Navigation, Windows) — reached through app::current(), MAUI's Application.Current — with open_window/close_window mirroring the MAUI verbs. runtime::App embeds an Application by value; running makes it current, quitting releases it, so a second app in the same exe starts clean. Windows are plural and simultaneous — mount opens one, sync and the key-only find walk the current app's windows. A node's presentation lives on its own Data and dies with it; the mount-module registry and both lifecycle hooks are gone. Statics remain only for what every app shares: the Renderer, the platform hook slots, the UI thread, the one current door. The earlier AppState name was dropped deliberately: paired with Component it reads reactive, which facet is not — the record is ownership, and nothing re-renders.

facet — the words facet owns (no MAUI row behind them)

  • symbol (symbol.cplus + icons.cplus): an icon-font glyph as a control — symbol(icons::GEAR, size:, fill:, color:) — with 4,268 constants generated from the bundled font by tools/gen_icons.py, plus the platform-set escape (named: resolves SF Symbols / freedesktop / Segoe on the backend). .gesture(…) (gestures.cplus): a behaviour that draws nothing is a modifier on Node, not a control — the 21 gesture rows (taps, drag, hover, swipe, drop) live here, and handlers decline by returning false to pass the event up the native chain. tree, split, window_buttons + .window_drag() round out the set; facet-origin kind tags run from 1000 so regeneration can never collide.

facet — the platform-free tier (Stage 3, first half)

  • The 23 tier symbols are back, as six hand-written modules ported from the pre-regen facet: nav (route verbs, byte-for-byte), services (run_on_main, after/Cancellable, spawn_ui, run_on_worker, Job/run_job/wait_for_jobs), component (Component/Lifecycle, sender verbs, component_at), screen (Chrome, Screen, app menus, the type-erased ScreenBox), theme (roles, set_theme, resolution tables, appearance hooks), and runtime (the neutral facade: Window, App + routes, dialogs, agent hook slots — every entry refusing loudly with no backend). Three reseams, everything else copy-paste: observe_size takes *Node, the presentation registry keys on the outlet KEY instead of the retired Handle, and the Color token model (two tiers plus adaptive light/dark pairs) now lives in the generated vocabulary.
  • Renamed on the way in, per the Stage 3 spec: Service.produce is Job.run (run_job(job, then:), wait_for_jobs — two of iris's three uses produce data, the third scaffolds a project, so Service was a lie on one in three); on_worker is run_on_worker, pairing with run_on_main. Chrome's six booleans collapsed to one bar: Bar enum (Native | Blended | Hidden | Custom) plus a separate close_button_only — 64 combinations for what was one decision. The spec's Cancellable-becomes-events::Subscription idea died on its own stated caveat: Subscription carries a *Bus its drop dereferences, which a timer handle must not want.
  • The mount seam is built (mount.cplus): Renderer — the small vtable a backend fills (create/apply/insert/remove/schedule plus a view_release paired with every created view) — a top-down mount walk that inserts each view into the nearest ancestor host and lets view-less containers pass children through, and a sync walk that applies exactly the dirty nodes and clears their bits. touch now requests a sync when unbatched (a batch stays silent until its closing C_FLUSH), asserts tree writes are on the UI thread, and node teardown releases the native view through the pair the renderer set. The seven mount decisions (M1-M7) are answered in the module header; a fake-renderer conformance suite proves the pipeline headlessly.
  • And the rest of the page, closed in one pass: eleven of the twelve deferred rows emit as fn+ctx pairs (shared-band on_focus/on_blur/ on_attach/on_detach on CommonProps — the mount walk fires attach/detach post-walk; the seven continuous observers as ordinary event pairs, the events-package premise having died with the Subscription caveat), and observe_size stays a backend registration returning Cancellable; set_content (the verb formerly present — build, only-child, force-fill, typed detach registry, fire on_attach) and switch_to (flex Display::None parking — nothing removed, no cursor invalidated); FontWeight (a hand-authored scale) + is_italic split from MAUI's one-enum FontAttributes across ~10 controls and TextSpan; guard 5 (every ADOPT row reaches a control, a tier owner, or a recorded exception — its first run named 75 unclaimed rows, now owned); the raw-key band (.gesture(on_key:) + key_code/key_named/consume_key and friends); find(key, within:) defaulting to the mounted tree; and MenuItem's default action agreeing with its own comment.

facet — the DSL namespace

  • elements.cplus: every element in one generated module, so the @ builder DSL resolves bare names again — the regen had moved constructors into per-control modules and orphaned the DSL. import "facet/elements" as ui; then @ui { vstack(key: "body") { button("Save", key: "save") } }. Containers forward facet core's (Builder-first, so DSL.5 arguments compose); the 38 generated controls forward from the same signature authority the constructors are emitted from; the four facet-origin controls (symbol, tree, split, window_buttons) forward from guarded literals — split(key: "sp") { pane pane } takes its panes as DSL children.

facet — addressing

  • find(key).component() / component_at[C](key) -> Option[*C] — the instance-level analog of the view Handle: recover the component present registered behind a keyed slot, so a bare-fn callback (a native widget's fn-pointer) can invoke a component method without a module static. Valid while the presentation lasts; eviction clears it. iris's EditorTabs — the last module-static component — became an owned Workspace field.

facet_appkit

  • Global find resolves a staged component's flex node. A switch_to (staged) panel's root is a subview of its outlet, so its keyed views are reachable by find_view_by_id from the OUTER component's host too — and the global (cp=0) find was resolving the flex against that outer owner, whose tree does not contain them, yielding a null flex. Structural verbs (set_child, add_child, …) then silently no-op'd on a staged panel. Global find now picks the slot whose tree actually OWNS the view's flex, so the Handle carries the right owner and a live flex. This is what made a facet::scroll inside a staged router child (iris Saves timeline) never establish its documentView; the canonical pattern — a plain keyed slot, set_child a fresh facet::scroll(content) into it — now scrolls under the staging router exactly as it did under present.
  • ui::list follows the tail through a resize. A narrower list re-wraps its rows TALLER, growing total height; the scroll view kept its point offset, so a list pinned at the bottom drifted UP on a narrowing (a split drag, a window shrink) — visible in iris chat as "narrowing the panel scrolls the transcript up." The debounced resize reload now records whether the viewport was at the bottom BEFORE it re-measures heights, and re-pins to the new end after if it was (widening already self-corrected via NSScrollView's clamp). Shared near-bottom / scroll-to-end helpers back both this and list_set_count.
  • Agent click on an expandable outline row toggles disclosure. A folder row's click is the disclosure gesture, not a selection: expand (or collapse) it so nested rows materialize — each already carrying its row_id agent key — and become clickable. A file row still selects and fires on_select. Completes the agent file-open drive: files tab -> click src (expands) -> click src/main.cplus (opens in the editor).
  • Tree rows are agent-addressable and click-selectable. ui::tree gains row_id: fn(item, ctx) -> Text (bound-method ready, like row): each MATERIALIZED cell is stamped with its dev key at build/recycle, so the agent surface exposes visible rows as children of the tree. And the agent's click on a row cell now SELECTS the row (selectRowIndexes: on the enclosing table, main-thread hopped) — the selection delegate fires exactly as a user click would, driving on_select. An agent can list the visible files and open one by its predictable id (click file-tree:row:/abs/path), verified end to end in iris: row click -> on_tree_select -> component_at -> EditorTabs.open -> the tab appears.
  • ui::tree / ui::list callbacks take component METHODS. Their callbacks were bare fn pointers in (ctx, payload) order, so row builders and selection handlers had to live as top-level free fns. Both now follow the bound-method thunk order (payload first, ctx TRAILING) with each fn param's ctx adjacent (on_select+ctx, row+row_ctx) — so on_select: this.open_file, row: this.file_row binds directly, the receiver auto-riding the ctx. Bare fns + explicit ctx still work. Breaking for existing bare-fn callers: flip callback params to (item/index, ctx). iris's files_tree callbacks are FilesTree methods now.
  • image(path) degrades a missing or unreadable file to a blank image view instead of aborting the app on AppKit's nil-image throw.
  • Screen windows: present_screen_window (a lifecycle-aware secondary window — retained slot keyed by the screen instance, per-window delegate records, on_closed fires on any close path, never counted against the shell-window total) + close_window(handle). The host pair under nav::push / nav::pop.
  • Application.stop is nudged with a no-op app-defined event when the last shell window closes: a close driven from a callout (a run_on_main step, an agent's marshaled click) is not an event, so the stopped loop would otherwise idle until the next real one — an agent-driven quit hung.
  • Repaint registry: views painted with dynamic colors (named tokens, adaptive pairs, theme roles) re-resolve their layer backgrounds, borders, gradients, and theme text colors IN PLACE on an appearance flip or set_theme — no rebuild, no relayout.

Layout — vendor/flex_layout

  • Pure-C+ Flexbox + CSS Grid engine (Yoga-parity): grow/shrink/basis, justify/align, min/max, percent sizes, absolute placement, measure callbacks. UI-kit-agnostic; 167 tests, ASan-clean. The Yoga C++ sources were dropped once the port stood alone.
  • @flex DSL — declarative layout blocks (row { box().grow(1.0) }) as a contextual builder, with a worked app-shell demo.

Bindings & new vendor packages

  • cpc-bindgen --gobject — GIR-driven GObject Introspection path (the Linux analog of --framework): functions, enums, class graph, signals, boxed records, out-params, upcasts, whole-package mode, cross-namespace --use.
  • cpc-bindgen --cpackage — pkg-config C package driver (Windows ABI hardening, dependency records, anonymous-union shims). Regenerated cblas/cuda and the Win32 path through it.
  • Generated GObject/GTK stack replaces hand-made GTK/Adwaita: glib, gobject, gio, cairo, pango, gdk, gtk4, adwaita, and peers — all cross-linked via --use.
  • vendor/quartzcore — auto-generated Core Animation binding so NSView.layer() is a real CALayer, not a methodless stub.
  • vendor/sqlite — idiomatic SQLite API and its raw bindgen module in one package.
  • ObjC block signatures — block argument and return types are part of the signature (no more “probably an 8-byte integer”); AppKit regen fixes 43 block callbacks.
  • #[repr(C)] union, packed structs, bitfields land in the language so bindgen can describe C headers without lying (see Language above).

facet — surface completion (post–Stage 3)

  • RTL reaches the flex engine (not only the native view flip); shared band goes responsive.
  • Collection as grid — set_columns(n) arranges items inside the collection, not only as a vertical list.
  • text_button — text-only button (link-style decoration, toggle, border described separately from draw).
  • Live-tree verbs that were never control-specific; band reaches flex constraints, absolute placement, bare Node, mount::find, nav params.
  • mount::remove(key) — keyed delete matching create/update; owned collections namable at construction.
  • Splits — panes report applied division; divider is one number flex owns; stylable; window buttons / traffic lights / window-drag fixed.
  • Nested scroll — axis forwarding for nested scrolls; horizontal content can exceed its viewport.
  • One context per handler across gestures, tree, pickers, list/ collection (ctx last); typed index in the item slot.
  • Focus / blur / is_focused; menu items can grey out, rename, find; shared-band background, shadow, clip; per-edge padding; adopt a native view as a node.
  • Appearance / theme paint — light/dark, derived ink, and the appearance-flip repaint path actually run (hook was written onto the wrong Application record).
  • facet_gtk freezes the contract as a second backend filling the same vtable; web/hybrid_web adopted onto webkit; titlebar leading/trailing slots.
  • Resources — REST verbs (get/post/put/delete) over a shared store, async off the main thread, change notifications to watchers.

facet_appkit — correctness pass

  • Tree rows: measure after realise; place without stretch/animate/reload; grouped bind/height; Escape exits a text field.
  • List: live drag keeps up without blue flash; tab order is document order; text area editor fills its box; predicted text is not rewritten.
  • Drag sources begin sessions and keep payload across the pool; gesture views answer performClick:; “call super” skips classes carrying our own imp.
  • is_enabled reaches every kind; collapsed panes restore; tree reports expansion; drag has ends; zero measurement is not a size.

Agent surface & tooling

  • vendor/inspector — live inspector for the mounted facet tree (declared vs computed props, structural edit, highlight overlay). Separate from the agent surface on purpose.
  • agent_inapp — same verbs as MCP, in-process (no transport, no auth — the binary already trusts itself).
  • Agent click splits permission from capability; control parts (e.g. search-field magnifier/cancel) are addressable; text writes and sheets reach the app.
  • Compiler lints W0824 / W0825 — declare that a handler takes (or refuses) a bound method / ctx slot at the declaration, not only at the call site.
  • cpc test --asan, --release, --timings; many borrowck/sema/codegen soundness fixes (match consumes scrutinee when it binds a name; raw-pointer assignment drops old value; noalias and TBAA fixes under -O2/+).

Docs & process

  • Vendor tutorial / guide / ref layout across packages; facet and facet_appkit docs closed Stage 4 / audit.
  • Repo working notes (CLAUDE.md): local cpc, symbol graph over grep, generated-source map, AppKit “check the old tree first”.

v0.0.26 — 2026-07-02

A bindings release. cpc-bindgen grows from a C-header FFI generator into a framework binding generator: it reads Objective-C and Swift framework interfaces and emits typed, idiomatic C+ packages, bridging C object and collection types to standard-library types on both sides of a call. A set of generated vendor packages ships with it, and the standard library gains set and map primitives plus reference-counting uniqueness. The language changes are additive — named arguments, default parameter values, and a fn(ref T) pointer mode — together with soundness and codegen fixes.

Framework binding generation

  • cpc-bindgen --framework generates a whole C+ package from an Apple framework: its umbrella header, subframeworks, and transitively imported headers. C and Objective-C frameworks are both supported.
  • An Objective-C front-end reads class, category, protocol, and enum declarations. Category methods merge into their class; NS_ENUM / NS_OPTIONS become C+ enums and constants.
  • --merge emits a framework as a single module with full cross-type chaining, so a method returning one framework type resolves to that type's wrapper instead of an opaque handle.
  • Typed object wrappers: object returns and arguments bind to the wrapping C+ type; nullable returns become Option; class factories return Self.
  • By-value structs: geometry and descriptor structs (MTLSize, NSRange, CGAffineTransform, CGVector, CATransform3D, …) bind as C+ value structs with a proven struct-return ABI; typedef aliases and enum-typed fields are resolved.
  • Collection bridging, both directions: NSArray<NSString*> ↔ Vec[Text], NSArray<id<P>> ↔ Vec[P], NSArray<NSNumber*> → Vec[f64], NSSet<NSString*> ↔ StringSet, and NSDictionary ↔ StringMap.
  • Delegate synthesis: a protocol becomes a C+ delegate whose callbacks carry scalar, struct, typedef, and collection arguments and non-void returns.
  • Blocks: usingBlock: methods, completion-handler (typedef'd block) parameters, and value-returning blocks bind to C+ callbacks.
  • SEL and Class bind as handles; BOOL ↔ bool; ** out-parameters bind; Objective-C lightweight generics erase to id.

Swift binding generation

  • cpc-bindgen --swift reads a Swift module's symbol graph. --swift-bridge emits a compiled @_cdecl Swift bridge rather than a classification, and --bridge-spec supplies human-declared copyability the graph cannot express.

SIMD and C vector types

  • C SIMD vector types and canonical function-pointer types map to C+; integer and unsigned lane-vector wrappers are added to the simd package.

Generated vendor packages

  • New naming-guideline-aligned packages: metal, appkit, uikit, accelerate, cblas, simd, win32, adwaita, android_view, jni, cuda, espidf, llama_cpp, coreai, log, uuid, arena, static-arena, rt, and rt_darwin.

Standard library

  • No-crash error model: fallible operations return Status / Option / Result instead of trapping. The whole standard library is converted.
  • Named arguments and default parameter values at call sites.
  • New primitives: HashSet[T], StringSet (a Text-keyed set), and StringMap (a Text-keyed owning map) with slot enumeration.
  • Rc / Arc uniqueness: is_unique, try_unwrap, and a scoped with_mut; MutexGuard gains scoped with / with_mut.
  • A Swift-style API pass across the standard library: value-centric method names, private (_) internals, and per-module tests. json migrates onto it.

Language

  • A function-pointer type can carry the ref mode (fn(ref T)): the callee borrows through the pointer, complementing the existing fn(take T).

Soundness & correctness

  • Narrow-integer extern arguments and returns are zero/sign-extended on both the import and export sides, matching clang; uint8_t and other sub-word scalars now round-trip correctly across the C ABI.
  • The sret return attribute is applied at a non-musttail objc_msgSend call site, so a struct-returning message no longer clobbers its receiver.
  • A chained receiver (a.b().c()) no longer evaluates the inner receiver twice.
  • Field privacy is resolved from a generic type's template origin, so an instantiation no longer loses its private-field marking.
  • Same-named extern functions with conflicting signatures are rejected (E0357).

Tooling

  • cpc fmt: unary + / - hugs its operand; bitwise-or | is spaced.

v0.0.25 — 2026-06-22

A platforms-and-UI release. It also breaks the language feature freeze: the freeze held through the v0.0.23 hardening and the v0.0.24 vocabulary release, but building real cross-platform UI needed a new binding form — struct destructuring — so the freeze did not hold and that feature is added here. Otherwise: Linux (GTK 4 / libadwaita) and Windows (Win32) join macOS, the x86_64 System V C ABI is completed, and the facet UI framework and the agent surface span all three platforms.

Platforms

  • Linux: GTK 4 bindings (vendor/gtk) and libadwaita 1 (vendor/adwaita).
  • Windows (x86_64-pc-windows-msvc): a native Win32 GUI binding (vendor/win32) and async socket I/O via a WSAPoll readiness reactor.
  • The x86_64 System V C ABI is completed for fn-pointer and extern-import calls (struct args and returns), so non-macOS targets pass the C-ABI suite.

UI & the agent surface

  • facet + facet_appkit: a cross-platform native UI framework. UI is written declaratively in @facet { ... } builder blocks (label / button / stack + an .on_click modifier) and rendered to native AppKit widgets (FACET.1, AppKit-only so far).
  • The agent surface gains Windows (agent_win32) and GTK (agent_gtk) backends alongside AppKit — describe-UI and authorized actions over a live native widget tree, reusing agent_core unchanged.
  • agent_mcp is backend-neutral: one MCP (JSON-RPC) bridge drives any AppKit / Win32 / GTK surface through a fn-pointer vtable.

Language

  • Struct destructuring in let / var: let TYPE { f1, f2 } = expr; moves each named field into its own binding (mutable with var). Sound where a bare field move is rejected. The field list must be exhaustive, and a struct with an explicit drop cannot be destructured (E0509). This is the feature that broke the freeze.

Soundness & correctness

  • Indirect (fn-pointer) calls now apply the sret return ABI to non-Copy aggregate returns — a fn-pointer that returned a drop-carrying struct by value crashed (SIGBUS); it now returns correctly.
  • A raw-pointer deref *p is a writable place for ref receivers and ref arguments, matching the existing (*p).field = v rule — (*p).mut_method() and f(*p) no longer raise a spurious E0328.
  • The executor no longer re-enqueues an already-parked spawn_local'd task — a spawned task plus a nested await, both suspended on reactor sources, could resume a completed coroutine and segfault (#11).
  • Pointer-typed static initializers emit as null / inttoptr instead of an invalid aggregate.

Tooling

  • cpc init / cpc pm / cpc skill — project scaffolding and package DX; cpc init pins the scaffolded stdlib dependency to the toolchain version.
  • A WASM browser-playground backend runs C+ client-side (scalar core).

v0.0.24 — 2026-06-20

A vocabulary release: the keyword surface was revised for clarity and for accuracy when LLMs generate C+ code. This is a breaking change to syntax (an exception to the language feature freeze): most programs need mechanical renames. Semantics are unchanged except for the fixes under "Soundness & correctness" below.

Vocabulary

  • Receivers and the self-type are this / This (were self / Self).
  • Parameter ownership is spelled ref (an exclusive, written-back borrow), take (consume / own), or a bare binding (a read-only borrow). The mut, move, and borrow markers are retired, as is the region-annotated borrow REGION T type.
  • Locals: let is an immutable local, var a mutable local. mut is gone everywhere: no let mut, no static mut (every static is a mutable, addressable global), and parameters bind immutably.
  • Interface impls connect with : (impl Type: Interface, was impl Type for Interface).
  • Visibility is name-based: an item whose name starts with _ is module-private, everything else is public. pub is retired; export marks the C-ABI / header / linker surface.
  • unsafe is removed; raw-pointer and other low-level operations are written directly.
  • A function-pointer type can carry the take ownership marker (fn(take T)), distinguishing a consuming callee from a borrowing one.
  • Struct literals can infer their type from context: { field: value }.
  • #addr(p) returns a raw pointer's address as a usize.
  • Text coerces to str at argument, binding, and return sites; the explicit Text::as_str is removed.

Soundness & correctness

  • Empty enums are rejected (E0361): a zero-variant enum is uninhabited yet was lowered as a plain i32 tag.
  • Integer literals are range-checked against their type (E0314): out-of-range values such as let x: i8 = 300 are rejected instead of silently wrapping. Explicit as casts and signed minimums (-128, -9223372036854775808) stay valid.
  • Same-scope shadowing is forbidden (E0363): redeclaring a name in one block silently swapped its type.
  • Closed three arithmetic UB holes in codegen: oversized shift amounts, out-of-range float-to-int casts, and INT_MIN / -1.
  • A Copy ref parameter writes back through a pointer, so fn bump(ref n: i32) updates the caller's value (verified C-callable in both directions); every export fn signature is checked for C-ABI representability (E0410).

Docs

  • SKILL, SPEC, MEMORY-MODEL, and the diagnostic catalog were rewritten to the v0.0.24 vocabulary; source comments were de-staled; the tutorial was retired.

v0.0.23 — 2026-06-17

First release under the language feature freeze: no new syntax or semantics. This is a soundness, correctness, and C-ABI hardening release. Code that compiled before still compiles; several programs that wrongly compiled (unsound) are now correctly rejected.

Ownership & Drop soundness

  • Closed multiple double-free / use-after-move holes: match now drops a consumed or wildcard-discarded owning scrutinee in every arm shape, and moving an owning payload out of a match on a place is rejected (E0337); array and tuple literal elements are consumed (closes the [p, q] double-free); whole-binding moves through value-transparent wrappers are consumed; constructing into an aggregate consumes the source; overwriting a Drop field or array element drops the old value first.
  • A move self method call consumes its receiver and is rejected on a borrow receiver (E0337); turning a borrow into an owned value is rejected, while sound shared-region borrows are preserved.
  • Fixed three Drop / ownership accounting holes (#6, #7, #8).
  • stdlib made sound for non-Copy element types: Box / Rc / Arc / Mutex (set drops the old value, get is Copy-only), HashMap[K: Copy, V: Copy], and the MutexGuard refcount (closes a guard-escape use-after-free).

Generics, methods & dispatch

  • Generic function bodies are now type-checked (closed the unchecked-generic-body hole).
  • Self nested in a compound or generic type (fn(Self), *Self, Self[], Pair[Self]) is substituted in interface/impl matching.
  • Method-level generics work on generic struct and enum impls (impl Box[T] { fn f[U](...) }); generic and enum associated functions work (Box[i32]::make::[U](), Maybe[i32]::make(), including self-returning factories).
  • Method-level generic bounds are enforced at the call site on generic struct/enum methods: fn f[U: Copy] rejects a non-Copy type (E0502), closing a double-free; impl-block generic bounds (impl Box[T: Copy]) likewise.
  • T::func() path-form associated calls through a bound resolve; a generic function's type argument is inferred from a generic struct/enum argument; Vec[Struct]::new() no longer panics.

unsafe & function pointers

  • Taking a fn-pointer to an unsafe fn requires unsafe (a safe fn(...) pointer cannot carry the unsafe-ness), closing a laundering hole.
  • Taking a fn-pointer to a borrow/mut-param function is rejected (ABI mismatch); indirect (fn-pointer) and generic-method calls consume their by-value arguments.

C ABI

  • Struct-by-value argument and return passing is unified onto the platform C ABI across native function definitions, direct calls, and fn-pointer calls, so a cpc function is C-callable and a fn-pointer is a real C function pointer (verified against clang in both directions).

interface / impl

  • Interface impls are written type-first: impl TYPE for INTERFACE.
  • Interface/impl signature matching compares the borrow / mut / move receiver and parameter conventions, not only the types (E0505).

Coroutines / codegen

  • for-in early break no longer crashes (SIGTRAP) and drops in-scope coroutine locals (leak-on-cancel); await/reactor destroy edges route to cleanup instead of trapping.

Text

  • A string literal coerces to Text at assignment, matching let / return.

Docs & tooling

  • Added the normative language specification (docs/SPEC.md), a single-source diagnostic catalog (errors.toml + generator), and MEMORY-MODEL.md. CI runs all workflows on release tags only.

v0.0.22 — 2026-06-13

Language feature freeze. v0.0.22 is the last release to add language surface (syntax or semantics). From here on the language itself accepts bug fixes only — no new keywords, expressions, or type-system changes. New capability goes into packages (vendor/) and tooling, never the core language. The contextual builder-block DSL below is the final language feature to land.

Contextual builder blocks (DSL.1–4: parser, lowering, lookup, containers + flow control)

  • New expression syntax @ctx { ... }: the contextual builder block. ctx is any module path (@view, @ui::view); the body holds item expressions, leading-dot modifier lines that apply to the item above them (.font = bigger, .on_click(f)), let setup bindings, and nested @ blocks. @ was previously an invalid character; no existing source changes meaning.
  • Modifier lines are line-oriented: a .name that starts a line attaches to the current item, while a same-line .name stays ordinary postfix access on the item expression. Inside call arguments, indexing, grouping parentheses, and nested blocks the rule is off, so wrapped subexpressions are unaffected.
  • Parse-time rejections with builder-specific messages: a modifier with no current item (including after an interposed let), and return / break / continue / yield / await / loops / defer / guard inside a block.
  • Blocks lower to the fixed builder protocol — ordinary package code, no macros: ctx::Builder::new(), one temporary per item with its modifiers applied (__i.font = v, __i.method(args)), add(item) per item, and finish() as the block's value. let entries splice through with ordinary block scoping; nested @ blocks compose when finish returns the item type; the empty block is new + finish. Any package that ships Builder (new/add/finish), an item type, and constructor functions becomes a construction DSL.
  • Synthesized nodes reuse the user's spans, so sema's ordinary diagnostics land on the DSL lines: a wrong item type reports at the item line, an unknown modifier field at the modifier line, a context module without Builder at the @ctx line.
  • Contextual name lookup: inside @view { ... } a bare item name (text(...)) and a bare context member used as a modifier value resolve through the context as view::text without qualification. Precedence is locals → same-file top-level → contextual, so a let binding or a same-file function of the same name shadows the package member; a bare name that is no member at all falls through to the ordinary located "undefined" error. Item field/method names in modifiers (.font, .boost(...)) are never contextual. Because the rewrite produces real view::text references before the graph builds, code-graph/LSP navigation resolves them to the package symbols automatically.
  • Container elements and item-control (DSL.4): a bare name { ... } inside a builder block is a container element of the same context (vstack { ... } builds view::vstack, its children resolve in view) — not a nested DSL. Containers take a filled Builder (fn vstack(b: Builder) -> Item), so the whole feature lowers to Builder::new/add plus a finisher (the root calls .finish(), a container calls ctx::name(builder)) — the compiler's output never names a collection type, so DSL packages work even on targets where Vec is gated. if/else and for are Flutter-style collection control flow: their items add into the same builder (if logged_in { logout_button() }, for row in rows { item(row) }), if needs no else. A nested different @-DSL block is rejected (write a same-context container without @); revisit if a real cross-DSL nesting use case appears.
  • cpc fmt keeps @ctx glued and round-trips builder blocks — containers and if/for included — unchanged.

Multi-backend consolidation

  • New --min-os VERSION flag (after --target): overrides the OS floor in versioned target triples — 13.0 default for the iOS targets, API 24 for android-arm64. Unversioned targets reject it.
  • New esp32c3-riscv32 target (RV32IMC, ilp32, ESP-IDF): 32-bit IR and RISC-V ELF objects through esp-clang, ABI pinned against an ilp32 probe (8-byte direct window, bare-pointer indirect, no byval). The object links into an ESP-IDF esp32c3 firmware. TargetSpec gains extra_clang_args (-march/-mabi for the C3).
  • Windows/Linux CI now also run on main pushes, not only release tags.
  • New recipe docs/examples/recipes/android_hello: C+ source to a signed APK (NDK link + script-assembled package), emulator-validated, with Gradle integration notes.

Android UI (vendor/android_view + vendor/jni)

  • vendor/android_view adopted and validated on the emulator: a C+-built View tree renders (nativeCreateView host contract), and Button taps reach C+ two ways — a host-shipped adapter class, or the self-contained android_view/listener, whose adapter ships in-package as a 976-byte pre-compiled DEX (#include_bytes), loaded with InMemoryDexClassLoader (API 26+) and bound via RegisterNatives; apps export one token-routed cplus_on_click hook.
  • vendor/jni covers the full 233-slot JNI 1.6 function table (verified against the NDK's jni.h; object arrays, RegisterNatives, ExceptionCheck, NewDirectByteBuffer bound) and models JNIEnv * as the double pointer JNI requires (the bare table pointer trips an ART abort).

Compiler

  • File-aware spans: every span carries its source file (stamped at lex time), so cross-file diagnostics route themselves, monomorphization's call-site records cannot collide across files by construction (the v0.0.20 (origin_file, span) compound key is gone), and #include_bytes-style relative paths resolve against the call's own file. Internal-only; no language-visible change.
  • String literals accept a bare $ (previously an error; $$ and ${...} interpolation unchanged) — JNI descriptors for nested Java classes (android/view/View$OnClickListener) need it.
  • Fixed an LLVM-redefinition error when a program both defines a C-ABI symbol (pub extern fn) and declares it as an extern import elsewhere (the app-provided-hook pattern): the import declare is now skipped for program-defined symbols.

v0.0.21 — 2026-06-11

esp32: heap types + the espidf package

  • Embedded package profile: a target can exclude stdlib modules whose mechanism it lacks. On esp32-xtensa, importing the POSIX half of stdlib (thread, mutex, channel, env, net, netsys, reactor, executor, time, fs) fails at resolve time with E0866 naming the target and pointing at vendor/espidf — instead of an IR verifier error after codegen. async fn on 32-bit targets is rejected at check time with E0867 (the coroutine runtime is 64-bit only). Heap modules (vec, text, box, ...) stay available; the host profile is unchanged.
  • The 32-bit heap runtime: fat pointers ({ ptr, usize }), string/Text/Vec lengths, pointer-arithmetic GEP indices, and the libc size_t surface (malloc / memcpy / memcmp / snprintf) now follow the target's pointer width, lifting the heap-type restriction on esp32-xtensa. Verified by esp-clang's IR verifier (kept as a regression gate in e2e) and on hardware: a Text and a Vec[i32] built on the ESP32's newlib heap print correctly from the device. 64-bit targets are byte-identical.
  • New vendor/espidf package: GPIO, esp_timer (now_us), task sleep (delay_ms via newlib usleep, tick-rate independent), and UART console printing. The gpio/timer externs are #[no_alloc]+#[no_block] leaves, so #[realtime] control loops can drive pins and read the clock under the contract. Entry convention: the app exports cplus_app_main; ESP-IDF's main component keeps a two-line app_main C shim. Validated on hardware with an all-C+ firmware (GPIO blink + #[realtime] PID + telemetry — no C beyond the shim).

Multi-backend: esp32-xtensa (first 32-bit target) + #[realtime] on-device

  • New esp32-xtensa target (rungs 3-4 collapsed: the local WROOM-32D spike proved esp-clang accepts cpc's IR, so 32-bit support and the Xtensa rung shipped together). usize/isize/pointers are 4 bytes: llvm_ty, ty_bit_width, static_layout, and #size_of/#align_of consult the target's pointer width (64-bit targets byte-identical). The Xtensa C ABI is pinned against an empirical esp-clang 20.1.1 probe: aggregate args ≤ 24 bytes coerce to arrays of align-sized chunks ([3 x i32], [2 x i64]), larger pass indirect byval; returns > 16 bytes use sret (argument and return classification now split); no FP-register HFAs. Heap/fat-pointer types (Text, Vec, str) are not yet supported on 32-bit targets and fail loudly at IR verification rather than miscompile.
  • esp-clang resolution: $CPC_ESP_CLANG > $IDF_TOOLS_PATH (set-but-wrong errors) > ~/.espressif, newest tools/esp-clang/ version, LLVM 19+ enforced; missing installs get the idf_tools.py install esp-clang hint.
  • Verified on hardware: a #[realtime] fixed-point PID (compile-time no-alloc / no-block / bounded-recursion contract) built as an esp32-xtensa staticlib, linked into an ESP-IDF firmware, runs closed loop on an ESP32-D0WDQ6 at ~1.84 µs (442 cycles) per step; the same contract rejects an allocating variant with E0901 at cpc check.
  • Fixed a musttail miscompile-rejection (host-affecting): a pub extern fn wrapper tail-calling an internal fn returning the same ≤16-byte aggregate emitted musttail across mismatched IR return types (the export's return is ABI-coerced, the callee's is the bare struct); clang rejected the module. musttail is now skipped when either side's return is coerced.

Multi-backend: target model + iOS + Android

  • New --target NAME on build / check / --emit-ll / --emit-ll-opt / --emit-asm / --emit-obj. Named targets: host (the default), ios-arm64, ios-arm64-simulator, android-arm64. An unknown name fails with the supported list. Omitting --target reproduces the previous host behavior byte for byte.
  • android-arm64 (rung 2: the first non-host external toolchain): emits aarch64-linux-android24 ELF objects and staticlibs through the Android NDK's clang, resolved from $CPC_NDK_CLANG, $ANDROID_NDK_HOME / $ANDROID_NDK_ROOT / $ANDROID_NDK_LATEST_HOME, or the SDK's default ndk/ directory (newest version). The resolved clang must report LLVM 19+ (NDK r28.2+); older NDKs and misconfigured variables fail with the setup hint. Staticlibs are archived with the NDK's llvm-ar (the host BSD ar cannot index ELF members). Verified end to end: a C+ staticlib linked by NDK clang ran on a Pixel 9 Pro XL emulator.
  • A TargetSpec (triple, pointer width, endianness, object format, ABI and intrinsic selectors, handoff mode) now drives codegen's per-target decisions. The former compile-time cfg! gates (HFA classification, Microsoft x64 size buckets, SysV register pairs, byval, spin-loop hints, NEON tbl1, the Windows binary-mode ctor) resolve against the selected target, so a cross build emits the target's ABI and intrinsics, not the host's.
  • External-builder handoff: the iOS targets stop at object emission — cpc never runs their final link (Xcode owns it). cpc build of a [lib] staticlib emits the object, archive, and C header into target/<target-name>/<mode>/; clang gets -target <triple> plus -isysroot from xcrun when available. [[bin]] builds, cdylib crate-types, cpc test, and single-file binaries are rejected for these targets with the supported flow named in the message.
  • An explicit target pins target triple = "<triple>" in the emitted IR, so handed-off .ll artifacts carry their target. Host IR is unchanged.
  • Bundled vendor artifacts resolve by the selected target's stable artifact triple (vendor/<dep>/src/lib/arm64-apple-ios/...); only the host target still consults clang -print-target-triple. E0862 now words the mismatch as a host or target triple accordingly.

Bindings

  • New vendor/uikit package: UIKit bindings mirroring vendor/appkit (ObjC-runtime FFI; Window, ViewController, View, Label, Color, Screen, app-delegate synthesis). Includes the cplus_app_main entry convention: a two-line C main shim in the Xcode target calls into the C+ staticlib, which registers the delegate and enters UIApplicationMain. Verified on the iOS simulator: a C+-driven screen (white window, centered label) renders on an iPhone 16 Pro simulator.
  • vendor/uikit expanded to the full binding surface (18 modules): controls (Button, Slider, Switch, SegmentedControl, ProgressView, ActivityIndicator, PageControl, DatePicker), text (TextField, SecureTextField, TextView, SearchBar), containers, data (TableView, CollectionView, PickerView), graphics (ImageView, Image, Font, BezierPath), dialogs (AlertController), toolbar/navigation/tab bars, pasteboard, Auto Layout anchors, events, notifications, navigation / tab / split / page controllers, custom-view synthesis (drawRect:), and ownership rules (owned wrappers release in drop). The umbrella module re-exports the set; the whole surface sema-checks for the iOS targets and links against the simulator SDK in e2e.

v0.0.20 — 2026-06-11

Agent surface (Theme B)

  • New agent_consent recipe: a reference consent middleware over agent_core's AuthGate. decide(rules_dir, mode, agent_id, prompt) resolves an agent in three steps — a remembered per-agent rule (persisted to disk), a standing Mode (allow-all / deny-all), else prompt the user and remember the answer — then maps the result onto a real AuthGate. Closes the "ask-user + persisted per-agent rules" residual; the gate itself stays a pure predicate.
  • agent_appkit actions (click / set_text / scroll_to) now marshal to the main thread when called off it, so an MCP bridge driven on a background connection can't message AppKit off-main. Closure-free (performSelectorOnMainThread: + an [NSThread isMainThread] fast path; scroll_to's NSRect rides a once- registered cplusScrollSelfVisible: NSView method). on_main_thread() is public.
  • New Surface::layout_diagnostics: per-node Auto Layout health (uses_autolayout, has_ambiguous_layout via -[NSView hasAmbiguousLayout]), so an agent can check a generated UI's layout without a screenshot. The tree walk guards the NSView-only selectors so the NSWindow root node is safe.

Compiler

  • Fixed a musttail miscompile on arm64: a tail call returning a by-value aggregate wider than 16 bytes (returned indirectly by AAPCS64) was marked musttail, which LLVM's arm64 backend rejects ("failed to perform tail call elimination on a call site marked musttail"). The >16-byte eligibility guard was x86-64-only; it now applies on all targets. Surfaced building the llama.cpp bindings (the 72-byte llama_model_params FFI return).
  • Closed the inferred-call half of the v0.0.19 monomorphization fix: an inferred (no-turbofish) generic call resolved its concrete type-args through call_monos, keyed by a file-less span, so two such calls at the same byte offset in different files could select the wrong instantiation. call_monos is now keyed by (origin_file, span). (Turbofish calls were already collision-free.)

Bindings

  • llama_cpp verified end to end: the llama_cpp_smoke recipe links against a current llama.cpp via ${LLAMA_CPP_LIB} and runs real text generation on the Metal GPU (gemma-4-E2B). Closes the loop with the env-var portability change and the arm64 musttail fix above.

Build / manifest

  • New W0003 warning: a [[bin]] package's own [link] libs/frameworks are ignored when building the binary (those are read only when the package is a dependency). The warning points to [[bin]] libs/frameworks, where a binary's own libraries belong. The build still succeeds.
  • [link].search-paths and [link].extra-objects now expand ${VAR} and ${VAR:-default} against the environment, so a binding can point at an external SDK without baking an absolute path into the manifest. An unset ${VAR} with no fallback fails at parse time with E0865 naming the variable, rather than an opaque linker error. vendor/llama_cpp reads ${LLAMA_CPP_LIB}; vendor/cuda reads ${CUDA_LIB:-/usr/local/cuda/lib64}.

v0.0.19 — 2026-06-09

The agent surface reaches the GUI: a macOS app can expose itself to an external agent — described, driven, and observed — over a consent-gated JSON-RPC bridge. Also the breaking intrinsic and string-method renames, a monomorphization fix, and bindings for llama.cpp.

Language / compiler (breaking)

  • Intrinsics use the #name(...) sigil; the legacy __cplus_*() call spelling is removed.
  • .to_string() / ToString are now .to_text() / ToText.
  • Naming an owned string via .to_text() or interpolation requires import "stdlib/text" (E0613); borrowed views (str) need no import.

Compiler

  • Fixed a monomorphization miscompile: a turbofish generic call now mangles its callee from its own type-args instead of the file-keyed call_monos, so two same-offset turbofish calls in different files no longer resolve to the same wrong instantiation.
  • Multi-file diagnostics render against the right file (GAP 3); static-init narrowing casts; clearer E0303 (suggests Text) and E0502 (names the real type) messages.

Agent surface — GUI side (Theme B)

  • vendor/agent_appkit: open(window) walks the live NSView tree into a Surface. describe_ui snapshot (Vec[UiNode]); authorized click / set_text / scroll_to through the agent_core authorization brain (exposure via set_agent_id, optimistic-concurrency text edits); notification-to-verb event translation.
  • vendor/agent_mcp: the MCP bridge. JSON-RPC 2.0 (describe_ui / actions / events) over Unix-domain sockets (serve_uds / serve_fd), every request gated by an agent_core consent AuthGate.
  • New appkit_agent recipe showing the whole flow.

vendor/appkit

  • Ownership into_raw / from_raw for parented view wrappers (GAP 2); SF Symbols, a layer-backed RoundedView, toolbar and text coverage (GAP 4/5); the correct NSImage symbol-configuration selector (GAP 6).

vendor/llama_cpp (new)

  • C+ bindings for llama.cpp's C API: raw FFI generated from the upstream headers with cpc-bindgen (build.sh), plus a hand-written safe facade (Session: load / generate / tokenize / decode / sample). Links libllama / libmtmd; the [link] search-path points at a local llama.cpp build. A llama_cpp_smoke recipe shows greedy generation.

vendor/coreai (new)

  • Swift bridge for Apple's CoreAI, adapted to the real API (Xcode 27 / macOS 27).

Tooling

  • cpc-bindgen emits safe pub fn wrappers over #[link_name] externs, pub records/fields, and pub type typedef aliases (the bindings llama_cpp needs).

v0.0.18 — 2026-06-08

The owned string is now Text — a single, fully-stdlib string type — and the compiler-blessed string is gone. One owned-string concept, with most of its API living in the standard library instead of the compiler.

Language — Text replaces string (breaking)

  • string is removed. Source-level string (and string::new / string::with_capacity) now error with E0303. The owned, growable string is Text, implemented entirely in vendor/stdlib/src/text.cplus and recognised by one compiler lang-item (#[lang("string")]). str (the borrowed view) is unchanged.
  • Import-required. A file that names an owned string or uses interpolation must import "stdlib/text". Single-file programs that only need views use str. (.to_string() / interpolation still work without the import via type inference, producing an un-nameable owned value; to name the type, import Text.)
  • Text API — all in stdlib, extensible without touching the compiler: new / with_capacity / from_str, push_str / clear / truncate / clone, len / capacity / is_empty, find / rfind / contains / starts_with / ends_with, slice / trim* / split -> Vec[Text], the unsafe as_str borrow escape hatch, and c_str -> Option[CString] for the C ABI. Text is Send + Sync (usable as a thread::spawn payload and in Arc[Text]).
  • Multi-line string literals """...""" — verbatim: no indentation stripping, no escape processing; the bytes between the quotes are the value.
  • String interpolation and .to_string() now produce an owned Text.

Language — unsafe fn

  • Functions can be declared unsafe fn; calling one outside an unsafe { } block is rejected (E0801). The grep-able escape hatch for operations whose safety the compiler can't verify (e.g. Text::as_str, raw FFI returns).

stdlib + vendor

  • Migrated off string to Text: stdlib cow / fs; vendor json, appkit (the Objective-C string bridge), uuid, and agent_core. The owned Text made the JSON deep-clone paths safe (Text::clone() instead of an as_str().to_string() round-trip), removing unsafe from them.

v0.0.17 — 2026-06-07

Foundations: an ownership-safe Vec, a compiler soundness fix behind it, the framework-agnostic core of the agent surface, and a scoped-down package manager.

Compiler

  • string value-param soundness fix: a string (or other owning value) passed by value and then stored or forwarded (e.g. self.v.push(s), self.field = s) instead of returned is no longer double-freed. effective_move now covers Ty::String alongside Ty::Struct/Ty::Enum. Repro in bugs/string-param-store-double-free/. (Requires a cpc reinstall from source.)

stdlib — Vec rewrite (breaking)

  • Vec is now ownership-safe: overflow-checked allocation sizing, null-checked malloc/realloc, and no silent out-of-bounds reads.
  • API changes: get is a bounds-checked vec::get::[T](v, i) -> Option[T] (Copy elements); at_copy(i) -> T asserts in-bounds; at(i) -> Option[*T] reads a non-Copy element in place; pop returns Option[T]; added set, swap_remove, truncate, shrink_to_fit, is_empty. iter stays a gen method. All in-tree callers (json, clap, agent_core) migrated.

Package manager (new: cplus-pm)

  • A standalone tool to manage packages in a project's vendor/: install / remove / update, with git-tag versioning, pubgrub resolution, SHA-256 content addressing, a shared cache, and a lockfile. No dependency on the compiler.

Agent surface core (new: vendor/agent_core, groundwork)

  • The framework-agnostic core for agent-controllable apps: the build-time-stable agent-id tree, curated describe, the all-or-none auth gate + exposure + affordance ceiling, bubbling events with {node,verb,role} subscriptions, and action/text-op authorization with optimistic-concurrency versioning. Headless and fully tested; the AppKit backend (GUI wiring) and MCP bridge are next.

v0.0.16 — 2026-06-07

The AppKit surface: full binding coverage, a leak-free ownership model, and event-driven drag-and-drop — plus a P0 calling-convention fix behind all macOS geometry, and a loop Drop/move soundness fix.

Language

  • # sigil for compiler builtins: the FFI/raw and byte-swap builtins (str_ptr, slice_ptr, slice_len, str_from_raw_parts, bswap32, htons, …) and println now require the #name(...) form, like the existing #size_of/#addr_of. A bare call is a fix-it error. This makes a compiler-known builtin self-evident at the call site (the library io::println is unchanged).
  • Infinite loop diverges: a function whose body ends in an infinite loop (no break can exit it) no longer needs a dead trailing return.
  • let _ = expr; is now a discard binding (evaluates and drops the value).

AppKit (vendor/appkit)

  • Event-driven drag-and-drop: a drag source can now start a drag from a mouseDragged: gesture (create_drag_source_view + begin_string_drag / DraggingItem / begin_dragging_session), alongside the existing drop destination. See the appkit_drag_drop recipe.
  • Leak-free ownership: every alloc/init widget wrapper now follows the "+1 normal form" (owns its object, releases once in drop) — controls, text, containers, toolbar items, panels, controllers, data views, and the base views. Factory/shared/top-level objects (windows, the app, status bar, shared panels, colors/fonts) correctly stay non-owned.
  • Full module coverage: every vendor/appkit module now has tests.
  • TextField::new_label is a real static label (non-editable, non-bezeled); it no longer behaves like an input field or accepts dropped text.

Fixes

  • Struct-by-value ABI (P0): NSPoint/NSSize/NSRect and other homogeneous float aggregates passed by value to objc_msgSend now go in FP registers per AAPCS64. Previously they were integer-coerced / passed indirectly, so every geometry argument (setFrame:, initWithContentRect:, moveToPoint:, …) silently received garbage coordinates on Apple Silicon.
  • Loop-body Drop: an owned value created inside a while/for/loop body is now dropped at the end of each iteration (and on break/continue). Previously it leaked every iteration.
  • Move across loop iterations: let y = x; on a non-Copy value now moves the source, and re-moving a binding declared outside a loop on each iteration is rejected (E0335) — previously an un-tracked move that, with the loop-Drop fix, would double-free. Re-initializing the binding before the move stays valid.
  • Negative float literals no longer emit invalid IR (double -5).
  • Slider value get/set used the wrong (float vs double) ABI; fixed to doubleValue/setDoubleValue:.

Infra

  • macOS CI: a cargo test --workspace job now runs on Apple Silicon (push-to-main + PRs), alongside the tag-triggered Linux and Windows CI.

v0.0.15 — 2026-06-05

Language hardening, a P0 ownership fix, the first Linux and Windows ports, and GPU/CPU BLAS bindings.

Language

  • Module-level global asm: #asm("...") at item scope lowers to LLVM module asm, for raw module-level symbols or directives. The function-body #asm(...) inline-asm form is unchanged.
  • #[no_alloc] drop glue: the check now also rejects owned drop-carrying parameters (move x, a move-by-default non-Copy struct, move self) and discarded drop-carrying temporaries, not just let locals.
  • if/else value typing: an if-expression sizes its result from the type codegen actually produces, so any value-producing arm shape (including a method call) is accepted; the previous hand-kept type predictor is removed.

Graph / LSP

  • value-refs precise scoping: uses resolve to the innermost in-scope definition (shadowing is handled correctly); match-arm payload bindings and for loop variables are first-class definitions; and a binding returned from a function records the caller-side bindings its value flows into.

Fixes

  • Ownership (P0): a heap-owning enum passed by value as a call or method argument (e.g. vec.push(v) where v owns a nested Vec) is now moved rather than borrow-copied. Previously the caller's scope-exit drop could free memory the callee had already stored, a use-after-free (surfaced by a vendor/json parse + stringify round-trip).
  • Borrow checker: a bare non-Copy concrete struct/enum argument used while its place is borrowed now reports E0372 (move while borrowed) instead of E0383 (read while borrowed), matching the move semantics.
  • Codegen: string interpolation frees its per-segment conversion buffers (previously leaked).
  • Use-after-move on generic-payload types: an enum or struct whose Copy-ness depends on a generic payload/field (e.g. enum W { A(Vec[i32]) }, a recursive Node { Branch(Vec[Node]) }, the vendor/json Value::Array(Vec[Value]) shape) is now correctly treated as non-Copy, so a use-after-move on it is reported (E0335). The move check is also now flow-sensitive: a move that happens only on a branch that returns/breaks/ continues no longer falsely poisons the value on the path where that branch is not taken.

Numerics / GPU

  • vendor/cuda: CUDA Runtime + cuBLAS bindings (NVIDIA GPU) — device management, DeviceBuffer (Drop = cudaFree), a cuBLAS Handle (Drop = cublasDestroy) with sgemm/sgemv (column-major). Plain C FFI, no kernel language; C+ stays a consumer of GPU SDKs.
  • vendor/cblas: reference CBLAS bindings (OpenBLAS / Netlib / MKL) — the cross-platform CPU path. Level 1/2/3 (sdot/saxpy/sscal/snrm2/sasum, sgemv, sgemm, plus d-variants).
  • [link] search-paths: a manifest [link] table may now list library search directories; each becomes both -L<dir> (link time) and -Wl,-rpath,<dir> (run time), so a library outside the default path (e.g. CUDA's lib64) resolves without LD_LIBRARY_PATH. Relative entries resolve against the manifest directory.

Platform

  • Linux/x86-64: first Linux bring-up of the toolchain (requires clang/LLVM 19+). cpc discovers a clang ≥ 19 on its own, links via GNU ld with -lm, selects *_linux.cplus stdlib overrides (epoll reactor), and ships a .deb. All changes are platform-conditional; macOS output is unchanged.
  • Windows/x86-64 (MSVC): the toolchain builds, tests, and runs on x86_64-pc-windows-msvc. cpc selects llvm-ar, links math from the UCRT (no m.lib), pulls f16 helpers from compiler-rt, applies the Microsoft x64 struct ABI (indirect for non-1/2/4/8 aggregates), sets stdout/stderr to binary mode so \n stays a single LF (not \r\n), and provides a Win32 reactor_windows async backend (timers + cooperative scheduling; socket/file IOCP is a follow-up). All changes are platform-conditional.
  • Coroutine codegen portability: llvm.coro.end is emitted in the return-type form the target clang expects (i1 on older LLVM / Apple clang 21, void on LLVM 22+), probed at build time. Previously a fixed form failed to verify on the other toolchain.

Tooling

  • Linux and Windows CI run cargo test --workspace on release tags and attach the prebuilt binaries (.deb; Windows .zip) to the GitHub Release, alongside the macOS tarball from the release workflow.
  • CI actions bumped to actions/checkout@v5 and upload-artifact@v5.

v0.0.14 — 2026-06-05

Language track. The headline themes are the completed ownership/Drop model, inline assembly, and code-knowledge-graph value depth.

Ownership & Drop

  • unsafe impl Send for T {} / unsafe impl Sync for T {} — a manual marker override. A nominal type that transitively hides a raw pointer is now !Send and !Sync by default (moving or sharing it across a Send/Sync bound is rejected, E0502); a bare *T used directly stays Send. The override re-enables a type you vouch for. Send/Sync impls must carry unsafe (E0860); unsafe applies only to those markers (E0861). Conditional generic form carries the condition as bounds: unsafe impl Send for Arc[T: Send + Sync] {}. Arc, Mutex, and Channel carry the right conditional impls.
  • #[no_alloc] drop-glue — a #[no_alloc] function now also rejects implicit destructors run at scope exit that would allocate/free (a string/Vec/Box local, or a type whose drop is not itself #[no_alloc]), reaching through fields, enum payloads, and array elements (E0901).
  • Container element drop — dropping a Vec[T] (and Box/Arc/Rc/HashMap) runs each element's drop exactly once before freeing the buffer.
  • Consumed-enum payload — matching an owned enum and binding a payload that is not moved out now drops it at arm exit (no leak), while every move-out shape still disarms the drop (no double-free).

Inline assembly

  • Tier 2 — operands + clobbers. Rust-style named operands: #asm("add {s}, {a}, {b}", s = out(reg) sum, a = in(reg) a, b = in(reg) b, clobber("cc")). in/out/inout set direction; reg lets the compiler pick a register (then {name} must appear in the template) or "x0" pins one. out/inout targets must be mut variables; operands are register-sized scalars.
  • Tier 3 — #[naked] functions. No prologue/epilogue; the body is inline asm that handles the ABI and returns itself (E0909 if the body is not asm-only). For trampolines, entry stubs, custom-ABI shims.

Code knowledge graph

  • type-at on inferred expressions. cpc query type-at FILE:LINE:COL (and LSP hover) now answer call results, field/index reads, arithmetic, and match/if values, not just annotated positions, rendered with concrete names (Result[Value, ParseError], Vec[i32]).
  • value-refs. cpc query value-refs FILE:LINE:COL returns a binding's value-flow: its definition plus every use classified as read / call / construct (re-wrap) / return / match / assign.
  • LSP dirty-buffer overlay. Hover, type-at, value-refs, goto-definition, references, and document-symbols reflect unsaved editor edits before save.

Fixes

  • Codegen: a match arm (or other value position) whose body is an if building a payload-carrying enum constructor no longer discards the value (previously a silent miscompile; surfaced by the json package migration).

Other

  • vendor/json parser migrated to a match-consumable result enum with recursive auto-Drop; accessors borrow and deep-clone.

Deferred to v0.0.15 (additive): module-level global asm, the if-result predictor refactor, value-refs precise scoping (shadowing), and the package side (AppKit → agent).