$ the-wire · showcase
Swift's async runtime paves way for per-function CPU control and macro-driven conformance
By RepoJournal · Filed · About Mobile platforms
Swift lands new concurrency and optimization work, including an AsyncStream error fix and a prototype for per-function CPU overrides, while Flutter's CLI refactor tightens its dependency injection.
Swift's runtime now looks up function type metadata through a new table keyed by pointer identity of result and parameter types, returning prespecialized metadata directly without entering the dynamic cache; this is groundwork for faster specialization but does not yet distinguish function flags, parameter flags, global actor, or thrown error, so multiple candidates are searched for an exact match [1]. Separately, an experimental `@_target` attribute lets a single function override its baseline CPU/ISA, guarded behind an experimental feature flag [2]. AsyncStream also gets a correctness fix so that `next` does not drop the error thrown by a termination handler [3].
Also for Swift, a new preliminary step for macro-derived conformances: `EnumCaseInfo` gains a `runtimeAvailabilityQueries` field to carry per-case runtime availability for enums, reachable only under the `DeriveConformancesViaMacros` experimental feature flag; noting the field is not yet used [4]. In optimization, `DeadObjectElimination` now treats `mark_dependence_addr` as a load-like use of its address operand, allowing dead objects used as address operands to be rewritten into `mark_dependence` on the stored value [5].
Flutter's tooling continues a long-running modular dependency injection migration with more breaking changes. `DevicesCommand` now requires non-nullable `DeviceManager`, `Doctor`, and `ToolContext`, eliminating global fallbacks [6]; `ScreenshotCommand` requires non-nullable `ToolContext` with an optional `VMServiceConnector` [7]; `LogsCommand` takes `ApplicationPackageFactory` and signal handlers, resolving the logger via `toolContext?.logger ?? globals.logger` for backwards compatibility [8]; `AssembleCommand`, `GenerateCommand`, and `GenerateLocalizationsCommand` all move to constructor injection [9]; and Apple build subcommands (`BuildIOSCommand`, `BuildIOSFrameworkCommand`) migrate similarly [10].
Kotlin's frontend groundwork and Lombok plugin fixes round out the day. A new DSL declares compiler-required annotation parameters, currently supporting only enums and strings, and resolution of those arguments is being reworked; for example, only `Deprecated.level` is compiler-required [11][12]. Lombok `@EqualsAndHashCode` and `@ToString` now respect the `callSuper` config from `lombok` config files and honor an explicit `callSuper=true`, fixing a case where the config was read but never passed to generators [13]. Kotlin/JS and Wasm get basic incremental compilation test coverage, moving existing scenarios to platform-agnostic annotations so they run on JVM, JS, and Wasm, with known bugs pinned as TODOs [14]. A separate Lombok bug-fix batch is mostly `@EqualsAndHashCode`-related [15].
Action items
- → Rebuild Flutter tool binaries if you rely on internal command constructors flutter/flutter [immediate]
- → If you use experimental Swift features, watch the `@_target` and `runtimeAvailabilityQueries` behind flags apple/swift [monitor]
- → Update Lombok plugin tests for `callSuper` config semantics JetBrains/kotlin [plan]
References
- [1] [Runtime] Look up function type metadata in the prespecializations library. ↗ apple/swift
- [2] Add experimental @_target attribute for per-function CPU overrides ↗ apple/swift
- [3] [Concurrency] AsyncStream; next must not drop error from termination handler (#91897) ↗ apple/swift
- [4] [Sema][SwiftMacros] Add per-case runtime availability info to `EnumCaseInfo` ↗ apple/swift
- [5] [DeadObjectElimination] Treat `mark_dependence_addr` as a load-like use of its address operand ↗ apple/swift
- [6] [tool] Migrate DevicesCommand to modular dependency injection (#190768) ↗ flutter/flutter
- [7] [tool] Migrate ScreenshotCommand to modular dependency injection (#190767) ↗ flutter/flutter
- [8] [tool] Migrate LogsCommand to modular dependency injection (#190765) ↗ flutter/flutter
- [9] [tool] Migrate AssembleCommand and GenerateCommand to modular dependency injection (#190773) ↗ flutter/flutter
- [10] [tool] Migrate Apple build subcommands and toolchain to modular dependency injection (#190780) ↗ flutter/flutter
- [11] [FIR] Introduce small DSL to declare compiler-required annotation params ↗ JetBrains/kotlin
- [12] [FIR] Rework resolution of compiler-required _arguments_ ↗ JetBrains/kotlin
- [13] [Lombok] Fix `callSuper` from config and explicit `callSuper=true` ↗ JetBrains/kotlin
- [14] [BTA] Add basic IC test coverage for Kotlin/JS and Wasm ↗ JetBrains/kotlin
- [15] [Lombok] Bug fixes part 3 (mostly related to `@EqualsAndHashCode`) ↗ JetBrains/kotlin