From 8e445cc08d54c5bddb91d46cca7ce4d471f34ccc Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 9 Nov 2026 17:54:39 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m2/compile-checks.md Quest-Claim: 19c89b4028b0761d From 2c5b9463f2b99f100b47db552cd13fb068238f98 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 9 Nov 2026 20:25:13 -0800 Subject: [PATCH 2/2] quest: finish quest/m2/compile-checks.md, reporting which Swift and C++ checks compile Co-Authored-By: Claude Opus 5.5 --- quest/m2/README.md | 1 - quest/m2/compile-checks.md | 31 ------------------------------- 2 files changed, 32 deletions(-) delete mode 100644 quest/m2/compile-checks.md diff --git a/quest/m2/README.md b/quest/m2/README.md index 4b772e7f6..e5a9e5dac 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -31,5 +31,4 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export/README - [rust2-wasm](/quest/m2/wasm/README.md) - a crate's `pub` API in the browser through the exporter's wasm32 target, and the gate the translator has to pass - [Translate moq-net's model to TypeScript](/quest/m2/ts-model/README.md) - the model translates with kio and moq-pattern, for the gate to compare -- [Spike: the target language's compiler enforces Rust's rules](/quest/m2/compile-checks.md) - which of Swift's and C++'s run-time checks become compile errors, and at what cost - [Waiting: Swift 6.4 in nixpkgs-unstable](/quest/m2/uniffi-swift-arm.md) - the nightly UniFFI fixtures move back to arm diff --git a/quest/m2/compile-checks.md b/quest/m2/compile-checks.md deleted file mode 100644 index 59c6d1800..000000000 --- a/quest/m2/compile-checks.md +++ /dev/null @@ -1,31 +0,0 @@ -# [M] Spike: the target language's compiler enforces Rust's rules - -## Goal - -A report on how many of the run-time checks [rust2-ffi](/ffi/README.md)'s Swift and C++ -bindings make become compile errors when the generators emit those languages' own -ownership forms, and what that costs their callers. It generates the stricter forms for -the `api` fixture, lists each test in `ffi/tests/api.swift` and `api.cpp` that breaks a -check today and whether the stricter binding refuses it at compile time, and shows the -fixture's script rewritten against it. - -## Plan - -Decided with the maintainer on 2026-11-09, in the quest audit: ✅ a spike in m2, whose -report decides whether the generators switch. moq's own wrapper packages sit above the -generated API, so a later break is absorbed there. Rejected: spiking it in m1 before moq -adopts the exporter; not planning it. AGENTS.md lets a binding check at run time only -what its language cannot express, so this finds where that line really is. - -- Swift: a handle as a `~Copyable` type with `consuming` methods for `self` and - `borrowing` parameters makes a call after a move a compile error, where today it traps. - The cost is a handle that is harder to store in a collection or capture in a closure. - (`Sendable` conformance by `Sync` is [not-send](/quest/m1/ffi-export/not-send.md)'s.) -- C++: `[[clang::lifetimebound]]` on a returned `view` and `[[clang::lifetime_capture_by]]` - on what a callable keeps make Clang warn where a view outlives its buffer, today C++'s - own undefined behavior; `-Wdangling` as an error is the consumer's choice. Swift - imports the same attributes through its C++ interop - ([safe interop](https://swift.org/documentation/cxx-interop/safe-interop/)). -- Kotlin, Go, Python, and Dart have no such form; say so in the report rather than look. - -Public API: none; the report scopes any later change to the generated Swift and C++.