User-facing changes per release, newest first. The changelog starts at v0.0.14; earlier history lives in each version's archived plan.
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.
- A
forrange counter has the type of its bounds. Two unsuffixed literal bounds are stilli32, so existing loops are unchanged; a loop over ausizebound now counts inusizeand indexes directly, and the0..(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 otherif/matchbranch. Code that spelled a suffix on every constant keeps working; a literal that overflows the width its position asks for is E0921. Anasoperand still has no context, so(1 << 40) as u64is unchanged. - A
[library]withsealed = trueis consumed through its C header, never imported by a C+ package (E0896).
forloops. The counter takes the type of its bounds (above). An inclusive range ending at the type's maximum ends:MAX-1..=MAXruns twice and0..=255u8visits every byte value, where the loop used to wrap past the maximum and never end.for _ in a..bdiscards the counter aslet _does.- Literal-only expressions take their position's type (above), and
codegen computes them at that width:
let a: u64 = 1 << 40is 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 afloatoperand. - 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 fnwith 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
strhash loop's counter, bothstr == strlength compares,slice_len's non-negative assumption and theTexttriple 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 emitsmusttailfor it. - ESP32: the sixth argument of a non-leaf function survives. In the
Xtensa windowed ABI the frame-pointer register
a7is also the sixth argument register, and the"frame-pointer"="non-leaf"every function carried made esp-clang claima7one 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-argumentopen(..., license, len)parsed garbage; a P-256 modular inverse received a wrong Montgomery constant). Functions compiled foresp32-xtensakeep no frame pointer now; every other target still carriesnon-leaf. extern staticdeclares C data.extern static NAME: T;is astaticwhose storage another object defines — C'sextern 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 anextern fn's is. Astr-typed one is E0929. ESP-IDF'sWIFI_EVENTandg_wifi_osi_funcs,environand framework constants no longer need the function-shaped workaround.cpc bindgenemits one for everyextern T name;a header declares.- A temporary built in an
iformatcharm (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 avendor/symlink, compiled under the folder's name in the consumer and the package's name in its own archive, and the link failed. strliterals inside astatic. 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. Astrstatic 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 aconstarray or struct says to use astaticand 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] = vis E0305). Reading an element used to need#slice_ptrand a raw deref. An array LITERAL passes where aT[]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 genericT[]parameter now infersTfrom its argument, soslice::prefix(s, 2)needs no::[i32]. - Diagnostics. A missing method on a builtin type names that type
(
no method foo on type u32, notstr), and thestdlib/mathhint appears for every numeric widthmathdeclares. The E0312 hint for iterating an array showsfor i in 0..3usize { arr[i] }. E0337's raw-deref message namesbox::from_rawinstead of anunsafeC+ does not have.
[library] sealed = true. A closed C-ABI product: the archive keeps global exactly the package'sexportitems. Everything the exports reach, the package's name-public functions, the stdlib slice, every dependency archive, bundled native archive andextra-objectsobject, is resolved into one relocatable object and made local there (clang -rwith an export list on Mach-O,objcopy --keep-global-symbolson ELF);nmverifies the result and the build fails on any other defined global.target/<…>/<name>.sealed.txtlists the exports and the imports the consumer's link still resolves. A sealedcdylibexports 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
stdliborespidfbuilds foresp32-xtensafrom the vendor tree as installed (the prebuild used to fail on the firstasync fninexecutor). The exclusion list now also names what stands on the excluded modules —future,date,bundle,fs_sys, thestdlibumbrella — and importing those on an ESP32 target is E0866. --min-oson 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-osorMACOSX_DEPLOYMENT_TARGET), so changing it rebuilds them.cpc build --print-packagesprints<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-argscommand 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 withadb shell) builds to an executable,target/android-arm64/<mode>/<name>: the archive and its dependencies' slices, linked by the NDK clang with-lm -ldland 16 KB page alignment. Other libraries come from the packages'[android.link]. An entry withoutmainstill 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 astrinto 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. -frameworkonly on Apple link lines. A dependency's[link] frameworksno longer reach an Android, Linux, Windows, ESP32 or wasm link (--print-link-argsforandroid-arm64gave the NDK-framework Foundation).objcnamesFoundationand-lobjcin[macos.link]and[ios.link], so depending on it unscoped no longer puts-lobjcon 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
imageno longer aborts a debuggable app. Every image mount asked its drawable to stop animating throughAnimatable, and aBitmapDrawable(any PNG or JPEG from a file or asset) does not implement it; CheckJNI aborted the process. The drawable is now asked whether it isAnimatablefirst. Animated drawables start and stop as before.
process::run(argv, cwd:)runs a child on this process's stdin, stdout and stderr and returns its exit code, so a tool drivingadborgitstreams 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()andstderr_fd()takethis(they read a field), so aletchild can answer them.fs::Metadata.is_fileandfs::is_file(path): a regular file, after following symlinks.!is_dirwas the only test, and it counted fifos, sockets and devices as files.stdlib/mathdeclaresmin,maxandclampfor every integer width;clampanswershiwhenlo > hi, as the float ones do.
- ffi.md no longer claims that only
exportis callable from outside. It separates the foreign interface from symbol reachability, states the executable and library cases, and names[library] sealed = truewith its limit. - ownership.md, memory-model.md and skill.md state what drops behind a raw
pointer: assignment drops the value it overwrites;
*p = vandp[i] = vdo not;(*p).f = vdrops the old field;freeruns no drop, andbox::from_rawis how a pointee is torn down.#str_ptrof a sub-view or of aTextview is not NUL-terminated;c_str()is. - spec.md says ranges appear only as the iterator of
for … inand states the counter rule.
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.
facet_runtime::app_data_dir()andfacet_runtime::cache_dir()are removed; useappenv::app_data_dir()andappenv::cache_dir(), which answer from the first line ofmainon every platform without waiting for a window.- On Windows,
facet_runtimeandfacet_agentnow selectfacet_winuiandagent_winuiby default.facet_win32is deprecated and remains available as an explicit opt-out. scrollnow takes a@viewblock (scroll { ... }); attaching a@viewblock to a leaf control reports E1010.hybrid_webuses one page API on every backend: JavaScript sends messages up withwindow.facet.postMessage(str)(available from document start), native delivers down by firingHybridWebViewMessageReceivedonwindowwithe.detail.message, and the C+on_messagecallback reads the payload throughhybrid_page::message(sender). The old per-backendwindow.facet.onmessage/window.facet.receivehooks are gone.- Discarding a call's
Statusreturn value as a bare statement now warns with W0009 (let _ = call();silences it deliberately). - Value-producing functions across
stdlib,cpc-bindgencollection bridges, and vendored packages now return either the complete result or an empty value on allocation or read failure, never a truncated prefix.
- 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)). takeof a view type (str,T[], or a view-carrying struct/enum) is checked as a borrow rather than a consuming move, andthread::spawn_withdetaches 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-Copytypes, andDropguards 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
E0514against active borrows before releasing each local's own loans; cross-statement writes andrefborrows check overlapping sub-place loans (d.field,d[i]); nested variant patterns on borrowed scrutinees enforceE0337; andSend/Synccycle detection tags struct and enum IDs in separate namespaces.
- 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 (
- Diagnostics and attributes.
- W0009 warns when a
Statusreturn value is discarded as an expression statement. - W0007 catches
(1 << n) as u64where a shift happens at defaulti32width before widening. - E0310 diagnoses cycles in
typealiases 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-featurecontrol target code generation per function or per build.
- W0009 warns when a
- Codegen.
gen_drop_in_placeusesfield_addron 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.
- One project asset rule (
cpc build,cpc package,--print-asset-dir). Every app build stages<root>/assets/*flat intotarget/assets/<target>/<mode>/incrementally and mirrors staged assets beside a self-linked binary (tracked by.cplus-assetsand refusing any asset that would overwrite the binary).cpc build --print-asset-dirstages and prints the directory for external builders (Xcode, Gradle/aapt2, Iris), andcpc packagebundles from the same staged tree. - One
[package] app_idacross platforms.cpc initwritesapp_idintoCplus.tomland every generated platform file, andcpc buildvalidates it (E0415 on an invalid identifier, W0008 when a platform file drifts). A refusedcpc initleaves no directory behind. - Windows DLL and link support. A
[library]cdylibon Windows links against the standard Windows system libraries, writes<name>.dlland<name>.lib, exports the C ABI symbols declared in its generated header, and omits-rpathon PE links.[link] libsexpands${VAR}environment references likesearch-pathsandextra-objects. - Doctests.
cpc testruns```cplusdocumentation fences, skips other language fences, and fails on unclosed fences. - Security hardening (
cplus-pm,cpc,agent_mcp, CI).cplus-pmkeys cache slots and tag records injectively (audit F01), refuses to write or remove unstamped directories or followvendor/symlinks outside the project (audit F02), and verifies that fetched package directories resolve inside the repository checkout.agent_mcpplaces local descriptors in a verified0700per-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).
- 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::menuMenuBar, modal alerts and file/folder/save pickers,TabView, tables, lists, collections,WebView2andhybrid_web, drag-and-drop on any node, gesture and keyboard bands, focus commands, light/dark theme tracking, per-window density observers,run_on_mainfrom background threads, andadopt_nativefor hosting inside an existing WinUI window. agent_winuiandfacet_agent_winuiexpose every live window over the MCP and in-app agent surfaces.
- Generated WinMD bindings and a complete native WinUI 3 backend: multi-window
host, custom and blended window chrome,
- Cross-platform UI and mobile polish.
- One
hybrid_webpage bridge (facet/hybrid_page): unifiedwindow.facet.postMessageup,HybridWebViewMessageReceivedcustom event down, andhybrid_page::message(sender)across AppKit, UIKit, Android, GTK, and WinUI. - iOS 26 Liquid Glass (
facet_uikit): nativeUITabBarwith floating and sidebar glass placement, scroll panes running under glass bars, native whole-window push navigation, action sheets forchoose, andblur_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, andcontent://URI reading/writing inFacetFiles. - Symbols and icons: bundled Material Symbols font compiled into the
binary (
facet/icon_font),button(symbol:)andicon_button(symbol:), and tab bar icons across backends. - Text roles:
named_sizeresolves to each platform's native typography ramp. - File drops and save panel:
allow_file_drop,dropped_files, anddrag_overon any node, pluschoose_save_path. - Agent & Inspector: every control property is readable and writable
through generated inspector descriptors (
window_width/window_heightincluded); 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.
- One
appenv: cross-platformapp_data_dir,cache_dir,no_backup_dir,exclude_from_backup,resource_dir,asset_path,read_asset,read_asset_text, andapp_id, usable from the first line ofmainon macOS, Linux, Windows, iOS, and Android.stdlib: addedstdlib/template(Templateunjoined string literals),stdlib/path(join,parent,file_name,stem,extension), andprocess::current_id().File::read_to_endandFile::linesnever 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(),screenfilling its viewport).jni:mutf8converts JNI's modified UTF-8 at every Java string boundary injni,android_view,http, andfilepicker, so astral-plane characters (such as emoji) and embedded NULs round-trip as valid UTF-8 without tripping CheckJNI.filepickerandshare:FileRefreads and writes both filesystem paths and Androidcontent://URIs;share::fileworks on Android;cameraaddspreview(fit:).
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.
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
implbody 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
Tinside a generic body counts as owning a destructor, so E0509 and E0337 apply to it as they do toText:struct W[T] { v: T }withfn get(this) -> T { return this.v; }is now refused. Bound it[T: Copy], or take the payload with a consumingmatch.
#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)is0x3F800000, where1.0f32 as u32is1. An unsuffixed literal takes the partner type, so#bitcast::[f32](0xBF800000)is-1.0rather than an out-of-rangei32. NaN payloads, infinities and-0.0come through unchanged, and that holds inconst/staticposition 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 whatasis for.jni'sJValue::of_float/of_double, which punned through a pointer for want of this, now use it.#bitcastis the only spelling. The unsigned-onlyfN::from_bits/.to_bits()pair it replaces is gone (see the upgrade notes); a derivedHashover float fields now bitcasts too, with the same hash values.
- 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), orreturn 5in a-> Tbody instantiated atbool(linked, asret i1 5). The reports now land at the template's own line, with the codes a concreteimplgets. Measured first: zero new errors across stdlib, facet and the example apps, whose generic bodies already obeyed the rules. - A template's
Tmay own a destructor. Inside a generic body a type parameter answered "carries no drop", sostruct W[T] { v: T }withfn get(this) -> T { return this.v; }was not a partial move — and atW[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 unboundedTnow counts as owning, so E0509 and E0337 apply to it as they do toText; a[T: Copy]bound keeps the bit-copy getter, and a consumingmatchstays the way to take a payload out. E0509 also names the type as spelled (W[T],(T, i32)) instead of the internalW__Param_T/__Tuple[T, i32]. - A consuming method on an enum local is a move the drop scanner sees.
e.into_inner()through atake thismethod lefteclassified 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 thismethod on an enum drops what it owns. The enum method emitter boundthisand the parameters and registered no drop for either, so a consuming method on an enum leaked its payload and everytakeparameter (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 poisonis 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 avendor/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, printingcpc: waiting for another cpc to finish prebuilding``.
This release spans the language and toolchain, package management, the agent surface, Facet's application model, and native Windows, Linux, and Android support.
[[bin]]/[lib]are removed. Applications useentry(withsrc/main.cplusas the default), and C-ABI libraries use[library].executor::block_on/executor::runare removed. Useasync fn main,.wait(), orfuture::wait_or_cancel.- A
guard letcomplement iselse Pattern, without pipe delimiters. facet/runtimeandfacet/agentmoved to thefacet_runtimeandfacet_agentpackages. The application and navigation APIs changed with the split; the detailed migration table is linked below.- The raw SQLite import is
sqlite/raw;sqlite_ffiis no longer a separate package.static-arenais nowstatic_arena, andterminal/appkitis nowterminal/backend. - Agent-surface reads and actions take an explicit capability grant, and multiple UI selection is represented as a set.
async fn mainand async#[test]functions are driven by the compiler. Synchronous code consumes a future through.wait()or the cancellablefuture::wait_or_cancelpath; 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.
- Applications register windows with
app.window(name, factory, chrome:)and start throughApp::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 andruntime::Window, global content navigation, andnav::Showmodes. See the migration table.
- A component is told when it is on screen, whatever moved the tree.
component::Attach::Foregroundandcomponent::Detach::Backgroundnow 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 ancestorDisplay::Noneor invisible — and announces the transitions; no mutating verb announces anything, soswitch_toparking a pane,set_shownhiding 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 throughcore::frames_settled, where band rules have resolved intodisplay). 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::Mountagain on every restore, and nothing at all on the way out. The node's single attach slot carries no reason, socomponent::childcould say one word; the reason now rides the node's presentation record, the repairscreen::ScreenBoxalready had.Mountkeeps 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 setson_attachon it.
Thisin 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 resolvedThisagainst whicheverimplblock came last. With two blocks in one file,let t: This = this;in the first one typedtas 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
staticthat nothing inside the package reads is reached from nowhere — so it was in no member oflib<name>.aand no export of the dylib, though it is madeweak_odrfor 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>.aused to hold a single object, so resolving any symbol from a package linked every module it had — a facet app on Android that importsstdlib/veclinkedprocessandpty, and with them aposix_spawnAPI 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=1restores 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)withoutfacet/gestures: twenty errors insidevendor/, the real one last).
- A bundled archive named
lib<package>.aappears 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_cppregenerated against llama.cpp b11003 (0.4.1), and regenerated from upstream's own headers from now on. The package used to carry a hand-curatedupstream/llama_cplus.hmirroring llama.cpp's ABI; it had drifted badly — still declaringllama_model_params::use_mmap,use_direct_ioanduse_mlockafter upstream deleted them, never having heard ofload_mode,lazy_mode,load_mtporllama_context_params::n_outputs_max_per_seq. Every field pastn_gpu_layersread the wrong bytes.build.shnow runscpc-bindgendirectly oninclude/llama.handtools/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/seedonload, greedy at temperature 0),Session::tokens_for,describe,reset,train_context_size,parameter_count,embedding_size,vocabulary_size,bitmap_audio, andBitmapdimension accessors. Three fixes rode along:sampleno longer callsllama_sampler_acceptafterllama_sampler_sample(which already accepts — the double count skews every stateful sampler), model paths cross to C as a NUL-terminatedCStringrather than a barestrpointer, andgenerateclears the KV cache unless asked to continue. llama_cppgained an e2e suite (src/test_main.cplus) that loads a real GGUF and drives real inference, gated onLLAMA_CPP_TEST_MODELand loud when it skips. The unit tests never reach allama_*symbol, so this is the only half that can catch ABI drift — restoring the stalellama_model_paramskills the test binary with SIGSEGV, which is what it is there to do.
- 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.
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/membersremain 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 ascpc query complete, as thecomplete_atMCP tool, and as the LSP'stextDocument/completion— all three call one function in core.cpc lspis 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 typecpc mcpuses, now shared fromcplus-core::sessionrather than duplicated. Measured on a 185-module project: 3.7 s for the first answer, 3.7 ms for every one after it.cpc lspresolves 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 waycpc builddoes, and diagnostics for such a project are the program's own instead of a fabricated missing import.- The graph is indexed.
CodeGraphcarriesby_id/by_name(symbol id and bare name to node indices), built once with it, sodef,members,symbols,callable_idsand the completion walks stop scanning the whole node vector. Measured on a 43k-node project:find_members1.63 → 0.29 ms, 2.67 → 0.43 ms on a 107-member type,file_symbols0.12 → 0.07 ms. A symbol id can repeat (twoimplblocks, 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 lspalso stopped canonicalizing every file in the project on every request.
- 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
stringValueis 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 throughperformKeyEquivalent:, 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_oknow sendsendEditingFor:before reading, which is what every native dialog does. - The routing itself is now tested rather than left to hands. A real
NSEventthroughperformKeyEquivalent: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. SettingkeyEquivalentand 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.
- A regression from
wireditself. It read appkit_ext's agent-click SLOT for every non-control — a slot facet never fills — so every gesture-bound container reportedwired=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 answerperformClick:, and arms it into aFacetInput00, which does. So answering the selector IS the answer. The exception is appkit_ext's own two classes, whoseperformClick:reads the slot and does nothing when it is empty — for those, and only those, the slot is the question. clickno longer acts and then reportsno_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.
App::runsettles before dropping the primary screen. Two of the three paths that free a screen did not.pushed_closedcallson_detach, removes the entry and frees the box;presented_closedfrees 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_pushedruns beforeApp::run's settle, so a wait at the caller would still have been too late for pushed screens. - The bailout says so.
spins > 100000turns "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 silentbreak.
- 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
choosesheet 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. promptopens on a value.initial:— the ledger'sinitialValue, 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_DROPSsays "facet says it asruntime::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'scancelanddestruction— 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.
context_menuis built on iOS:UIContextMenuInteraction+UIMenu/UIAction, inmenus.cplus. A right-click and a touch-and-hold are one affordance — Apple's own framing — so the ledger'sContextFlyoutmaps 1:1 and facet's contract never says "right click"; each backend picks the gesture its platform has, the wayswipeableis a menu on macOS and a pan on iOS.- The menu is built when it OPENS, not when it is attached. A
UIMenuis 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 andenabledand the titles are current with no refresh path at all. - A UIAction is the sender.
UIActionHandlerisvoid (^)(UIAction *), so one block type serves every item.UIAccessibilityIdentificationis not adopted byUIMenuElement, so the key ridesUIAction.identifier— the slot that means the same thing — and the payload rides an associated object.component::key_of/item_ofanswer 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
UIMenuOptionsDisplayInlinesub-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 acontext_menuin 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_copykeeps 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 bytools/run_ios_tests.sh— 78 passed, 0 failed. Disabling the two lines inwants_view/createturns two of them red, which is what makes them checks rather than decoration.
item:at construction, on the eight controls whose ledger type declaresCommandParameter— button, checkbox, icon_button, refreshable, menu_item, context_menu_item, swipe_item, toolbar_item. It sits on the shared band besidekey, 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 isfn(sender, ctx)and a bound method fillsctxwith 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.
CommandParameterstopped being dropped as MVVM. It shared one regex and one reason string withCommand— butCommandisICommand, which IS the view-model and is rightly dropped, whileCommandParameteris the ARGUMENT the handler needs. facet had already rebuilt the concept from first principles ascore::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.
- 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:
MenuFlyoutSeparatordeclares 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:
MenuFlyoutSubItemaliased toMenuFlyout(a submenu is not a flyout),MenuBartoMenuBarItem(the item is not the bar),SwipeItemViewtoSwipeItem. Six types now print each regen with the platform answer named: MenuBar, MenuFlyoutSeparator, MenuFlyoutSubItem, ShapeView, SwipeItemMenuItem, SwipeItemView. - The check runs from
gen_contract, not fromledger_spec, because that is where it RUNS:ledger_spec.pyhas not been able to regenerate the spec for some time (check_type_closurefails onMatrix,NavigationProxy,Shape,TableModeland the GIF decoder, none of which have a family rule), soledger-spec.jsonis a frozen artifact and a floor living only there would never fire. Repairing that tool is its own job.
- A
context_menuin a tree or list row can now open. A table or outline view handles right-click itself and asks its OWNmenu, 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) whosemenuForEvent:answers with the clicked row's menu, after calling super soclickedRowstill draws the ring.swipeable/swipe_itemwas unreachable the same way and is reachable for the same reason. - A
context_menuunder 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_menujoinshas_gesturesandwants_painting. Direct children only, so the rule agrees withattach_context_menu. run_jobanswers whether it started, and refuses a second flight. Two workers inside one job'srun()assign the same fields; where those areTextorVecthe 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_flightis the question five services were each answering with a private flag.- The agent surface tells a wired control from a dead one.
describe_uireportswiredbesideactionableandclickable, andclickanswersno_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_controlinstalls 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.cpluspromises app code type-checks on every target; it had stopped compiling on all of them (Appearance::Systemnever existed) and was missing eight members the real facades carry. Build it withcpc build --target android-arm64— a platform-shadowed file is unbuilt by default on the platform you are standing on. - A
context_menu_itemhandler can tell which item fired it. A handler isfn(sender, ctx)andctxis 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 inviews::createand a menu kind never gets a view.bind_menu_identitygives it the key as itsaccessibilityIdentifierand the item pointer as an associated object, socomponent::key_of/item_ofanswer from a menu action exactly as from a button.swipe_itemgets it too. - A sender that is not a view no longer raises.
key_ofanditem_ofwalksuperviewwhen 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_ofanswers 0 for an object with no superview, which is what the walk's termination condition already means. context_menuon 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.
- 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
onwas a candidate fors.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
Exprcarries its span — so the0in one impl block never equalled the0in 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)andB::go(ctx, v = 9), the calla.go(ctx: 3)had exactly one candidate that accepted it — B's — and that arrangement was applied to anAreceiver: the labelctxbound to A's parameterv, and B's default9was spliced into A'sctx. 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 ownv. - 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.
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).
stdlib/slice— checked sub-views overT[]:subreturnsOption[T[]](None on an invalid range), plus clampedprefix/suffix/drop_first/drop_last. The free-fn spelling ships the semantics; thexs.sub(from:to:)method form waits on generic slice impls.stdlib/flags— aFlagsoption-set over u64 bits, replacing the(dirty & MASK) != (0 as u64)texture with membership verbs:contains/intersects/with/without/toggledplus set algebra (union_with/intersect_with/minus). Bit values come fromconstmasks (constant expressions fold) or repr-enum discriminants cast at the call site.
- Derive through the empty impl:
impl Point: Eq {}— an empty impl block againstEq/Ord/Hash/Clone/ToTextgenerates 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 derivedHash+Eqis a validHashMapkey. Field rules: primitives andstrdirect (str orders via its blessedcompare), 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);Copyremains 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,thisfields, and consts — the attribute grammar takes real expressions now). Sema requiresbooland PURITY (E0924 — no calls or assignments in a contract); codegen emits each through theassertpath 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, inlower, 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, nodyn, andThisresolving 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)handsdatato a fresh thread;Scope::dropjoins every worker it started, on every path out. NoArc, no copy back, no atomics for the common split-work case. What makes it safe is a borrow the checker can see:lendis#[keeps(this)]on arefparameter, which now ties that argument to the receiver for the receiver's whole life (it used to tie view-typed arguments only — astris a borrow written as a value, and arefparameter 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 arefargument. 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 concreteT: a generic type it mentioned never got instantiated, monomorphize left it as aTypeKind::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 bindingresult: 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 aboutthisandrefparameters, which is the half a precondition cannot express — but namingresultthere is E0928, as is a parameter that collides with the binding. A postcondition sits between the call and theret, whichmusttailforbids, 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 ridesStructDeclwithis_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 beCopy, 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.rsbuilds 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 arefparameter, aref thisreceiver and#addr_ofare refused (E0927 / E0926). Passing a bitfield to aref u32used to take the address of a temporary copy and discard the write. Packed fields must beCopy(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-bindgenemits both: a bitfield becomes#[bits(N)]with its own signedness, a packed record becomes#[repr(C, packed)], and C's alignment-forcingunsigned :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: u32storage 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, autoprev + 1otherwise; 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)] unionand packed structs/bitfields — are tracked separately.) - Checked narrowing
as?:n as? u8evaluates toOption[u8]—Some(converted)when the value is representable,Noneotherwise. Integer source and target only (E0315 names the offending side); the infallibleaskeeps 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 explicitasin either direction. Same-brand==/!=and blessedhash/eqwork, so a distinct type satisfiesHash + Eq + Copybounds 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 scalarstatic) 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 atusize. 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 withimpl P: ToTextno longer ICEs. Sema admitted the part but codegen's interp lowering only knew primitives /str/Textand hit its unreachable arm. Monomorphize now rewrites such a part into an explicitp.to_text()call, so"${point}"works — including derivedToTextand nested structs.guard var/if var/while var: the pattern-binding statements takevarin place oflet, making the bound value(s) mutable —guard varin the enclosing scope,if var/while varinside the body (fresh per iteration forwhile var). Previously pattern bindings were always frozen; mutating one meant an extravar x = v;copy. Theletspellings and all pattern-let diagnostics (E0347/E0348/E0349/E0350/E0351) are unchanged; aguard varcomplement 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 existingfn 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 — includingname(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) -> Onow unifies structurally with a fn-pointer argument, bindingI/O(previously E0302 — a generic fn could not take a fn-typed argument mentioning its own params). - Generic calls under
awaitmonomorphize 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).
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 returningstr/T[]from a borrowing receiver — not just two hard-coded names. takeparameters /take thisare dying roots. A returned view of atakeparameter ortake thisreceiver 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)wherehead(x) -> strreturns a view of its parameter is rejected — the view is rooted atlocal. - 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 arefout-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/matchexpression, or moved out by a struct destructure now pins its owner exactly like the directlet 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 asappendwhile 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 = vtarget 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 whatppoints 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
*u8return no longer erases a view. Storing a view in a struct, boxing it, and returninginto_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 inbugs/str-field-outliving-its-text-is-not-caught.md.
interface Lifecycle { fn on_attach(ref this); fn on_detach(ref this); }. Hooks are fired FOR the component, never by it:run_componentfireson_attachafter the mount (the tree is live; initial routing belongs there) andon_detachwhen the loop stops, before teardown; teardown then drains the detach of every presented component. Breaking:run_componentnow requiresComponent + Lifecycle(empty hooks satisfy it).Handle.present(component)— the component-awareset_child: mounts the component's tree, fires itson_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_attachfires on every switch-in,on_detachas 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_themedrops 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/detachremain the manual view-parking tierswitch_tois 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 aswitch_to'd pane stopped reflowing on divider drags until re-attached.)- Backend host contract:
run_windowsplits intoopen_window(mounts, returns) andrun_loop(blocks), so hosts can act between mount and loop.
interface Service { produce; apply }+load_service: the threading contract as an interface —produce(the slow read) runs on a worker thread,applyand the optionalon_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_onin 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.
Screen— a component that also names its window: one conformance,fn chrome(this) -> Chrome, whereChromeis a plain record built with named parameters (title, size, minimums, titlebar flags, zoom).runtime::run_screen(screen)isrun_componentwith 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_quithooks, andapp.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/popopen and dismiss a secondary screen window alongside it,quit()ends the app,arg()reads the argument the showing verb carried.go/quitalso unwind arun_screen/run_componentwindow.- App context —
runtime::app_running/app_name/has_screen/register_screen: process-scoped reads from any handler, live while an App runs.register_screenadds 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_componentgainscustom_chrome/unified_toolbar/hide_title.
- 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 renamedtext()/text_secondary()/text_tertiary();primarynow means the brand role. Theme+set_theme. A plain record built with named optional parameters, installed once. Callingset_themeagain 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-coloris_dark()branching and the rebuild-on-appearance-change dance.- Fix: styled containers paint. A
column/row/zstack/gridwhose 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.
Box::into_raw/Box::from_raw— surrender and reclaim a heap slot as a raw pointer across boundaries aBoxcannot 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 markedopaque, removing a spurious W0002 warning from every build that linksthread.
- 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 curatedexposedview — only developer-exposed nodes, lean fields (id, role, name, actionable, re-parented to the nearest exposed ancestor) viaidentity::Registry.describe(). Small, high-signal context for agents; theBackendvtable gainsdescribe_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_labeloverrides it (icon-only controls), and.accessibility_hintsupplies the dev-authored intent ("opens the New Project wizard") — surfaced asdescriptionin 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.
- process → app → window → node, in MAUI's own words:
application.cplusholdsApplication(theme,Navigation,Windows) — reached throughapp::current(), MAUI'sApplication.Current— withopen_window/close_windowmirroring the MAUI verbs.runtime::Appembeds anApplicationby 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,syncand the key-onlyfindwalk the current app's windows. A node's presentation lives on its ownDataand 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 onecurrentdoor. The earlierAppStatename was dropped deliberately: paired withComponentit reads reactive, which facet is not — the record is ownership, and nothing re-renders.
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 bytools/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 onNode, not a control — the 21 gesture rows (taps, drag, hover, swipe, drop) live here, and handlers decline by returningfalseto 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.
- 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-erasedScreenBox),theme(roles,set_theme, resolution tables, appearance hooks), andruntime(the neutral facade:Window,App+ routes, dialogs, agent hook slots — every entry refusing loudly with no backend). Three reseams, everything else copy-paste:observe_sizetakes*Node, the presentation registry keys on the outlet KEY instead of the retiredHandle, 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.produceisJob.run(run_job(job, then:),wait_for_jobs— two of iris's three uses produce data, the third scaffolds a project, soServicewas a lie on one in three);on_workerisrun_on_worker, pairing withrun_on_main.Chrome's six booleans collapsed to onebar: Barenum (Native | Blended | Hidden | Custom) plus a separateclose_button_only— 64 combinations for what was one decision. The spec'sCancellable-becomes-events::Subscriptionidea died on its own stated caveat:Subscriptioncarries a*Busits 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 aview_releasepaired 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.touchnow requests a sync when unbatched (a batch stays silent until its closingC_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 formerlypresent— build, only-child, force-fill, typed detach registry, fire on_attach) andswitch_to(flexDisplay::Noneparking — nothing removed, no cursor invalidated);FontWeight(a hand-authored scale) +is_italicsplit from MAUI's one-enum FontAttributes across ~10 controls andTextSpan; 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_keyand friends);find(key, within:)defaulting to the mounted tree; andMenuItem's default action agreeing with its own comment.
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.
find(key).component()/component_at[C](key) -> Option[*C]— the instance-level analog of the view Handle: recover the componentpresentregistered 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.
- Global
findresolves a staged component's flex node. Aswitch_to(staged) panel's root is a subview of its outlet, so its keyed views are reachable byfind_view_by_idfrom 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 afacet::scrollinside a staged router child (iris Saves timeline) never establish its documentView; the canonical pattern — a plain keyed slot,set_childa freshfacet::scroll(content)into it — now scrolls under the staging router exactly as it did underpresent. ui::listfollows 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 andlist_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::treegainsrow_id: fn(item, ctx) -> Text(bound-method ready, likerow): 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'sclickon 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, drivingon_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::listcallbacks 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) — soon_select: this.open_file, row: this.file_rowbinds 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_closedfires on any close path, never counted against the shell-window total) +close_window(handle). The host pair undernav::push/nav::pop. Application.stopis nudged with a no-op app-defined event when the last shell window closes: a close driven from a callout (arun_on_mainstep, 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.
- 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.
@flexDSL — declarative layout blocks (row { box().grow(1.0) }) as a contextual builder, with a worked app-shell demo.
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 soNSView.layer()is a realCALayer, 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).
- 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.
- 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_enabledreaches every kind; collapsed panes restore; tree reports expansion; drag has ends; zero measurement is not a size.
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/+).
- Vendor tutorial / guide / ref layout across packages; facet and facet_appkit docs closed Stage 4 / audit.
- Repo working notes (
CLAUDE.md): localcpc, symbol graph over grep, generated-source map, AppKit “check the old tree first”.
A bindings release.
cpc-bindgengrows 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 afn(ref T)pointer mode — together with soundness and codegen fixes.
cpc-bindgen --frameworkgenerates 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_OPTIONSbecome C+ enums and constants. --mergeemits 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 returnSelf. - 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, andNSDictionary↔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. SELandClassbind as handles;BOOL↔bool;**out-parameters bind; Objective-C lightweight generics erase toid.
cpc-bindgen --swiftreads a Swift module's symbol graph.--swift-bridgeemits a compiled@_cdeclSwift bridge rather than a classification, and--bridge-specsupplies human-declared copyability the graph cannot express.
- C SIMD vector types and canonical function-pointer types map to C+; integer
and unsigned lane-vector wrappers are added to the
simdpackage.
- 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, andrt_darwin.
- No-crash error model: fallible operations return
Status/Option/Resultinstead of trapping. The whole standard library is converted. - Named arguments and default parameter values at call sites.
- New primitives:
HashSet[T],StringSet(aText-keyed set), andStringMap(aText-keyed owning map) with slot enumeration. Rc/Arcuniqueness:is_unique,try_unwrap, and a scopedwith_mut;MutexGuardgains scopedwith/with_mut.- A Swift-style API pass across the standard library: value-centric method
names, private (
_) internals, and per-module tests.jsonmigrates onto it.
- A function-pointer type can carry the
refmode (fn(ref T)): the callee borrows through the pointer, complementing the existingfn(take T).
- Narrow-integer
externarguments and returns are zero/sign-extended on both the import and export sides, matching clang;uint8_tand other sub-word scalars now round-trip correctly across the C ABI. - The
sretreturn attribute is applied at a non-musttailobjc_msgSendcall 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
externfunctions with conflicting signatures are rejected (E0357).
cpc fmt: unary+/-hugs its operand; bitwise-or|is spaced.
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
facetUI framework and the agent surface span all three 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.
facet+facet_appkit: a cross-platform native UI framework. UI is written declaratively in@facet { ... }builder blocks (label/button/stack+ an.on_clickmodifier) 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, reusingagent_coreunchanged. agent_mcpis backend-neutral: one MCP (JSON-RPC) bridge drives any AppKit / Win32 / GTK surface through a fn-pointer vtable.
- Struct destructuring in
let/var:let TYPE { f1, f2 } = expr;moves each named field into its own binding (mutable withvar). Sound where a bare field move is rejected. The field list must be exhaustive, and a struct with an explicitdropcannot be destructured (E0509). This is the feature that broke the freeze.
- 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
*pis a writable place forrefreceivers andrefarguments, matching the existing(*p).field = vrule —(*p).mut_method()andf(*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 nestedawait, both suspended on reactor sources, could resume a completed coroutine and segfault (#11). - Pointer-typed
staticinitializers emit asnull/inttoptrinstead of an invalid aggregate.
cpc init/cpc pm/cpc skill— project scaffolding and package DX;cpc initpins the scaffolded stdlib dependency to the toolchain version.- A WASM browser-playground backend runs C+ client-side (scalar core).
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.
- Receivers and the self-type are
this/This(wereself/Self). - Parameter ownership is spelled
ref(an exclusive, written-back borrow),take(consume / own), or a bare binding (a read-only borrow). Themut,move, andborrowmarkers are retired, as is the region-annotatedborrow REGION Ttype. - Locals:
letis an immutable local,vara mutable local.mutis gone everywhere: nolet mut, nostatic mut(everystaticis a mutable, addressable global), and parameters bind immutably. - Interface impls connect with
:(impl Type: Interface, wasimpl Type for Interface). - Visibility is name-based: an item whose name starts with
_is module-private, everything else is public.pubis retired;exportmarks the C-ABI / header / linker surface. unsafeis removed; raw-pointer and other low-level operations are written directly.- A function-pointer type can carry the
takeownership 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 ausize.Textcoerces tostrat argument, binding, and return sites; the explicitText::as_stris removed.
- Empty enums are rejected (E0361): a zero-variant enum is uninhabited yet was
lowered as a plain
i32tag. - Integer literals are range-checked against their type (E0314): out-of-range
values such as
let x: i8 = 300are rejected instead of silently wrapping. Explicitascasts 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
refparameter writes back through a pointer, sofn bump(ref n: i32)updates the caller's value (verified C-callable in both directions); everyexport fnsignature is checked for C-ABI representability (E0410).
- 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.
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.
- Closed multiple double-free / use-after-move holes:
matchnow 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 selfmethod call consumes its receiver and is rejected on aborrowreceiver (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 theMutexGuardrefcount (closes a guard-escape use-after-free).
- Generic function bodies are now type-checked (closed the unchecked-generic-body hole).
Selfnested 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.
- Taking a fn-pointer to an
unsafe fnrequiresunsafe(a safefn(...)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.
- 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 impls are written type-first:
impl TYPE for INTERFACE. - Interface/impl signature matching compares the
borrow/mut/movereceiver and parameter conventions, not only the types (E0505).
for-inearlybreakno longer crashes (SIGTRAP) and drops in-scope coroutine locals (leak-on-cancel); await/reactor destroy edges route to cleanup instead of trapping.
- A string literal coerces to
Textat assignment, matchinglet/return.
- Added the normative language specification (
docs/SPEC.md), a single-source diagnostic catalog (errors.toml+ generator), andMEMORY-MODEL.md. CI runs all workflows on release tags only.
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.
- New expression syntax
@ctx { ... }: the contextual builder block.ctxis 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)),letsetup bindings, and nested@blocks.@was previously an invalid character; no existing source changes meaning. - Modifier lines are line-oriented: a
.namethat starts a line attaches to the current item, while a same-line.namestays 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), andreturn/break/continue/yield/await/ loops /defer/guardinside 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, andfinish()as the block's value.letentries splice through with ordinary block scoping; nested@blocks compose whenfinishreturns the item type; the empty block isnew+finish. Any package that shipsBuilder(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
Builderat the@ctxline. - Contextual name lookup: inside
@view { ... }a bare item name (text(...)) and a bare context member used as a modifier value resolve through the context asview::textwithout qualification. Precedence is locals → same-file top-level → contextual, so aletbinding 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 realview::textreferences 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 { ... }buildsview::vstack, its children resolve inview) — not a nested DSL. Containers take a filledBuilder(fn vstack(b: Builder) -> Item), so the whole feature lowers toBuilder::new/addplus a finisher (the root calls.finish(), a container callsctx::name(builder)) — the compiler's output never names a collection type, so DSL packages work even on targets whereVecis gated.if/elseandforare Flutter-style collection control flow: their items add into the same builder (if logged_in { logout_button() },for row in rows { item(row) }),ifneeds noelse. A nested different@-DSL block is rejected (write a same-context container without@); revisit if a real cross-DSL nesting use case appears. cpc fmtkeeps@ctxglued and round-trips builder blocks — containers andif/forincluded — unchanged.
- New
--min-os VERSIONflag (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-riscv32target (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.TargetSpecgainsextra_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.
vendor/android_viewadopted 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-containedandroid_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-routedcplus_on_clickhook.vendor/jnicovers the full 233-slot JNI 1.6 function table (verified against the NDK's jni.h; object arrays, RegisterNatives, ExceptionCheck, NewDirectByteBuffer bound) and modelsJNIEnv *as the double pointer JNI requires (the bare table pointer trips an ART abort).
- 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.
- 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 atvendor/espidf— instead of an IR verifier error after codegen.async fnon 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 onesp32-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/espidfpackage: GPIO, esp_timer (now_us), task sleep (delay_msvia newlibusleep, 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 exportscplus_app_main; ESP-IDF's main component keeps a two-lineapp_mainC shim. Validated on hardware with an all-C+ firmware (GPIO blink +#[realtime]PID + telemetry — no C beyond the shim).
- New
esp32-xtensatarget (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_ofconsult 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 indirectbyval; 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, newesttools/esp-clang/version, LLVM 19+ enforced; missing installs get theidf_tools.py install esp-clanghint. - Verified on hardware: a
#[realtime]fixed-point PID (compile-time no-alloc / no-block / bounded-recursion contract) built as anesp32-xtensastaticlib, 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 atcpc check. - Fixed a
musttailmiscompile-rejection (host-affecting): apub extern fnwrapper tail-calling an internal fn returning the same ≤16-byte aggregate emittedmusttailacross 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.
- New
--target NAMEonbuild/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--targetreproduces the previous host behavior byte for byte. android-arm64(rung 2: the first non-host external toolchain): emitsaarch64-linux-android24ELF 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 defaultndk/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'sllvm-ar(the host BSDarcannot 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-timecfg!gates (HFA classification, Microsoft x64 size buckets, SysV register pairs,byval, spin-loop hints, NEONtbl1, 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 buildof a[lib]staticlib emits the object, archive, and C header intotarget/<target-name>/<mode>/; clang gets-target <triple>plus-isysrootfromxcrunwhen available.[[bin]]builds,cdylibcrate-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.llartifacts 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 consultsclang -print-target-triple. E0862 now words the mismatch as a host or target triple accordingly.
- New
vendor/uikitpackage: UIKit bindings mirroringvendor/appkit(ObjC-runtime FFI;Window,ViewController,View,Label,Color,Screen, app-delegate synthesis). Includes thecplus_app_mainentry convention: a two-line Cmainshim in the Xcode target calls into the C+ staticlib, which registers the delegate and entersUIApplicationMain. Verified on the iOS simulator: a C+-driven screen (white window, centered label) renders on an iPhone 16 Pro simulator. vendor/uikitexpanded 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 indrop). The umbrella module re-exports the set; the whole surface sema-checks for the iOS targets and links against the simulator SDK in e2e.
- New
agent_consentrecipe: a reference consent middleware overagent_core'sAuthGate.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 realAuthGate. Closes the "ask-user + persisted per-agent rules" residual; the gate itself stays a pure predicate. agent_appkitactions (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- registeredcplusScrollSelfVisible:NSView method).on_main_thread()is public.- New
Surface::layout_diagnostics: per-node Auto Layout health (uses_autolayout,has_ambiguous_layoutvia-[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.
- Fixed a
musttailmiscompile on arm64: a tail call returning a by-value aggregate wider than 16 bytes (returned indirectly by AAPCS64) was markedmusttail, 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-bytellama_model_paramsFFI 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_monosis now keyed by(origin_file, span). (Turbofish calls were already collision-free.)
llama_cppverified end to end: thellama_cpp_smokerecipe 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 arm64musttailfix above.
- New W0003 warning: a
[[bin]]package's own[link] libs/frameworksare 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-pathsand[link].extra-objectsnow 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_cppreads${LLAMA_CPP_LIB};vendor/cudareads${CUDA_LIB:-/usr/local/cuda/lib64}.
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.
- Intrinsics use the
#name(...)sigil; the legacy__cplus_*()call spelling is removed. .to_string()/ToStringare now.to_text()/ToText.- Naming an owned string via
.to_text()or interpolation requiresimport "stdlib/text"(E0613); borrowed views (str) need no import.
- 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.
vendor/agent_appkit:open(window)walks the live NSView tree into aSurface. describe_ui snapshot (Vec[UiNode]); authorizedclick/set_text/scroll_tothrough the agent_core authorization brain (exposure viaset_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 consentAuthGate.- New
appkit_agentrecipe showing the whole flow.
- Ownership
into_raw/from_rawfor parented view wrappers (GAP 2); SF Symbols, a layer-backedRoundedView, toolbar and text coverage (GAP 4/5); the correct NSImage symbol-configuration selector (GAP 6).
- 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). Linkslibllama/libmtmd; the[link]search-path points at a local llama.cpp build. Allama_cpp_smokerecipe shows greedy generation.
- Swift bridge for Apple's CoreAI, adapted to the real API (Xcode 27 / macOS 27).
- cpc-bindgen emits safe
pub fnwrappers over#[link_name]externs,pubrecords/fields, andpub typetypedef aliases (the bindings llama_cpp needs).
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.
stringis removed. Source-levelstring(andstring::new/string::with_capacity) now error with E0303. The owned, growable string isText, implemented entirely invendor/stdlib/src/text.cplusand 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 usestr. (.to_string()/ interpolation still work without the import via type inference, producing an un-nameable owned value; to name the type, importText.) TextAPI — 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], theunsafe as_strborrow escape hatch, andc_str -> Option[CString]for the C ABI.TextisSend + Sync(usable as athread::spawnpayload and inArc[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 ownedText.
- Functions can be declared
unsafe fn; calling one outside anunsafe { }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).
- Migrated off
stringtoText: stdlibcow/fs; vendorjson,appkit(the Objective-C string bridge),uuid, andagent_core. The ownedTextmade the JSON deep-clone paths safe (Text::clone()instead of anas_str().to_string()round-trip), removingunsafefrom them.
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.
stringvalue-param soundness fix: astring(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_movenow coversTy::StringalongsideTy::Struct/Ty::Enum. Repro inbugs/string-param-store-double-free/. (Requires acpcreinstall from source.)
Vecis now ownership-safe: overflow-checked allocation sizing, null-checked malloc/realloc, and no silent out-of-bounds reads.- API changes:
getis a bounds-checkedvec::get::[T](v, i) -> Option[T](Copy elements);at_copy(i) -> Tasserts in-bounds;at(i) -> Option[*T]reads a non-Copy element in place;popreturnsOption[T]; addedset,swap_remove,truncate,shrink_to_fit,is_empty.iterstays a gen method. All in-tree callers (json, clap, agent_core) migrated.
- A standalone tool to manage packages in a project's
vendor/:install/remove/update, with git-tag versioning,pubgrubresolution, SHA-256 content addressing, a shared cache, and a lockfile. No dependency on the compiler.
- 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.
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.
#sigil for compiler builtins: the FFI/raw and byte-swap builtins (str_ptr,slice_ptr,slice_len,str_from_raw_parts,bswap32,htons, …) andprintlnnow 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 libraryio::printlnis unchanged).- Infinite
loopdiverges: a function whose body ends in an infiniteloop(nobreakcan exit it) no longer needs a dead trailingreturn. let _ = expr;is now a discard binding (evaluates and drops the value).
- 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 theappkit_drag_droprecipe. - Leak-free ownership: every
alloc/initwidget wrapper now follows the "+1 normal form" (owns its object, releases once indrop) — 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_labelis a real static label (non-editable, non-bezeled); it no longer behaves like an input field or accepts dropped text.
- Struct-by-value ABI (P0):
NSPoint/NSSize/NSRectand other homogeneous float aggregates passed by value toobjc_msgSendnow 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/loopbody is now dropped at the end of each iteration (and onbreak/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). Slidervalue get/set used the wrong (float vs double) ABI; fixed todoubleValue/setDoubleValue:.
- macOS CI: a
cargo test --workspacejob now runs on Apple Silicon (push-to-main + PRs), alongside the tag-triggered Linux and Windows CI.
Language hardening, a P0 ownership fix, the first Linux and Windows ports, and GPU/CPU BLAS bindings.
- Module-level global asm:
#asm("...")at item scope lowers to LLVMmodule 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 justletlocals.if/elsevalue 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.
- value-refs precise scoping: uses resolve to the innermost in-scope
definition (shadowing is handled correctly);
match-arm payload bindings andforloop variables are first-class definitions; and a binding returned from a function records the caller-side bindings its value flows into.
- Ownership (P0): a heap-owning enum passed by value as a call or method
argument (e.g.
vec.push(v)wherevowns a nestedVec) 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 avendor/jsonparse + 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 recursiveNode { Branch(Vec[Node]) }, thevendor/jsonValue::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 thatreturns/breaks/continues no longer falsely poisons the value on the path where that branch is not taken.
vendor/cuda: CUDA Runtime + cuBLAS bindings (NVIDIA GPU) — device management,DeviceBuffer(Drop =cudaFree), a cuBLASHandle(Drop =cublasDestroy) withsgemm/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'slib64) resolves withoutLD_LIBRARY_PATH. Relative entries resolve against the manifest directory.
- Linux/x86-64: first Linux bring-up of the toolchain (requires
clang/LLVM 19+).
cpcdiscovers a clang ≥ 19 on its own, links via GNU ld with-lm, selects*_linux.cplusstdlib 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.cpcselectsllvm-ar, links math from the UCRT (nom.lib), pulls f16 helpers fromcompiler-rt, applies the Microsoft x64 struct ABI (indirect for non-1/2/4/8 aggregates), sets stdout/stderr to binary mode so\nstays a single LF (not\r\n), and provides a Win32reactor_windowsasync backend (timers + cooperative scheduling; socket/file IOCP is a follow-up). All changes are platform-conditional. - Coroutine codegen portability:
llvm.coro.endis emitted in the return-type form the target clang expects (i1on older LLVM / Apple clang 21,voidon LLVM 22+), probed at build time. Previously a fixed form failed to verify on the other toolchain.
- Linux and Windows CI run
cargo test --workspaceon 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@v5andupload-artifact@v5.
Language track. The headline themes are the completed ownership/Drop model, inline assembly, and code-knowledge-graph value depth.
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!Sendand!Syncby default (moving or sharing it across aSend/Syncbound is rejected, E0502); a bare*Tused directly stays Send. The override re-enables a type you vouch for.Send/Syncimpls must carryunsafe(E0860);unsafeapplies only to those markers (E0861). Conditional generic form carries the condition as bounds:unsafe impl Send for Arc[T: Send + Sync] {}.Arc,Mutex, andChannelcarry 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 (astring/Vec/Boxlocal, or a type whosedropis 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'sdropexactly 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).
- 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/inoutset direction;reglets the compiler pick a register (then{name}must appear in the template) or"x0"pins one.out/inouttargets must bemutvariables; 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.
type-aton inferred expressions.cpc query type-at FILE:LINE:COL(and LSP hover) now answer call results, field/index reads, arithmetic, andmatch/ifvalues, not just annotated positions, rendered with concrete names (Result[Value, ParseError],Vec[i32]).value-refs.cpc query value-refs FILE:LINE:COLreturns 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.
- Codegen: a
matcharm (or other value position) whose body is anifbuilding a payload-carrying enum constructor no longer discards the value (previously a silent miscompile; surfaced by the json package migration).
vendor/jsonparser 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).