S
The usual fix is to make sure there's exactly one copy of Google Maps in the final app, owned by the host app rather than by your SDK: Build your SDK as a static framework (MACH_O_TYPE = staticlib) inside the XCFramework. Its references to Google Maps symbols then stay unresolved until the app's link step, where they bind to the app's single copy. A dynamic framework links Google Maps into itself, which is what produces the duplicates. Hide the dependency from your public interface. Use…
S
Real-world example: a small feature-flag SDK Putting it together: OrbitSDK, a client that fetches remote feature flags, with configuration, pluggable transport and logging, typed errors, an actor-based client with request de-duplication, and Swift 6 concurrency safety. Manifest // swift-tools-version: 6.0 import PackageDescription let package = Package( name: "OrbitSDK", platforms: [.iOS(.v15), .macOS(.v12)], products: [ .library(name: "OrbitSDK", targets: ["OrbitSDK"]) ], targets: [ .target(…
S
Most iOS teams don't set out to build an SDK. It happens by accident. A networking layer gets copied into a second app. A design system gets pasted into a third. Somebody fixes a bug in one copy and not the others, and six months later you are diffing three almost-identical folders trying to work out which one is "right". Swift Package Manager (SPM) is how you stop that from happening. But "wrap it in a package" is only the first 10% of the work. The other 90% is deciding what is public, how…
S
looking forward to. and there some other similar library if it helps: GitHub - 1amageek/swift-flow: A Canvas-based flow diagram library for SwiftUI (iOS / macOS) · GitHub
S
GPKit 2.0 is out. It's a Swift package for GP orbital data: it reads OMM and TLE, six-digit catalog numbers included, propagates them with SGP4, and finds passes with look angles and Doppler. The core doesn't need Foundation, and CI tests it on macOS, Linux, Windows, Android and WebAssembly and builds it for iOS, tvOS, watchOS and visionOS. The new part is data age. Give it older and newer sets for the same satellites and it measures how far a prediction drifts as the data gets older, by orbit…
S
If there is enough interest in collaborating on it. Was thinking about open source the core and basic nodes. With these two alone, any graph nodes can be added as desired for the given project.
S
And lastly: regardless of whether we stick to Span<Cell> or loop back to AliasedSpan, I think it would be useful to document the expectations around bulk updates. I think it's not possible to spell a generic constraint that would allow you to extend Span for Cell elements such that it can have bulk update operations, for instance.
S
Regarding Cell and eventually aliasing/non-aliasing accesses if they're broken off, it's still not fully clear to me what we lose when we ask Swift to stop assuming everything is exclusive. For instance, if I have a Span<Foo> and a Cell<Foo> that are live at the same time, I expect that modifying the contents of Cell<Foo> still cannot modify the contents of any Foo inside the Span, and the compiler can optimize accordingly. I would also expect that a borrowed value (or an inout value) can never…
S
I have been relatively quiet on this proposal because I usually review features that either have clear security implications or features that I think I would use; but now that AliasedRawSpan is no longer proposed, it falls outside my usual scope. (There's a good amount of room to get the implementation of Cell wrong in a way that leads to memory safety issues, but I think that there exists a safe implementation.) With that said, it's been pointed out to me that Span<Cell<UInt8>> could be the…
S
I just tried playground and this seems to be one of the better web implementations of SwiftUI. Nice job! I'm very happy to see it using embedded wasm. The API looks to be identical to Apple's SwiftUI. I think ElementaryUI had to diverge from Apple's SwiftUI API to get it to work in embedded Swift. I prefer your approach of keeping it the same. Do you plan to keep the API close/identical to Apple's SwiftUI?
S
I think the current rule is that we restrict the type of the function by its captures: if it has an inout or ~Escapable capture, we infer it as non-escaping; if it has non-Sendable captures, we infer it as non-Sendable (regardless of RBI); etc. There’s no reverse flow.
S
Stumbled upon this after quite some time. Has there been any progress on this or any code published ?
S
John_McCall: You’re suggesting that we delay checking capture rules of local functions until we can analyze their uses? Ah, never mind. I thought we already did that for captures, but maybe it's not nearly as general as I'm imagining. At least for escaping vs non-escaping uses, there's a distinction though: func f(_ fn: () -> ()) -> () -> () { func g1() { fn() // this seems to work? } func g2() { fn() // we diagnose this } g1() return g2 }
S
Very cool, thanks for sharing
S
Very nice, do you plan to provide a opensource version
S
Slava_Pestov: Should we say that the type of the closure that we form when you write f there be called-once? It would then follow that f() can consume non-copyable captures and so on, as long as the calls to f() are in the right spots. You’re suggesting that we delay checking capture rules of local functions until we can analyze their uses? That’s probably feasible. But we can’t really reason about whether there’s exactly one call site on every path in the typechecker, so I’m not sure how much…
S
tshortli: Modeling defer as a closure is an implementation detail of the compiler rather than a language design choice. Actually this reminds me, if you have a local function that is only called and not used as a value: func f() { ... } f() What we do today is basically equivalent to forming a closure and immediately calling it. Should we say that the type of the closure that we form when you write f there be called-once? It would then follow that f() can consume non-copyable captures and so…
S
Hi, I'm Ghost Chat Dev. I'm a mechanic in Quebec who taught himself to code, and I built a tool that takes a plain-English description of a Swift app and generates the project files plus a GitHub Actions workflow. One question I keep hitting: where does AI-assisted Swift break for you? Mine compiles plain Swift and Foundation fine, but it can't build SwiftUI, so I have to test those in Playgrounds by hand. I'd like to know if that's a me problem or a Swift problem. Example build here: GitHub -…
S
It's true that an implementation of this proposal would unblock fixing that issue, but I don't think it should be explicitly called out in the proposal. Modeling defer as a closure is an implementation detail of the compiler rather than a language design choice.
S
nice proposal. I don't have much to add, I just wanted to mention one use case that would benefit from this. on competitive programming platforms that support Swift, such as https://atcoder.jp, usually either top-level code or @main is supported, unless manual heuristics are employed, which could easily be wrong and require effort to develop and maintain. I've advocated for Swift support on some online judges, and I ran into this issue while testing their setups. there wasn't a straightforward…
S
Cool. In these instances where the type name is so similar to what the thing actually is, the extra capitals would sometimes obscure the intended meaning, and maybe title case feels bellowy but personally I read it as a sign of authority. Thanks for the extra info.
S
That's valid. Apple has been moving to sentence case for topics, but there's such a legacy of title case in the stdlib docs, and no intention of changing all of it, that I should probably just make everything title case for consistency with what's already here. I'll fix that on first commit tomorrow, thanks.
S
Not sure if this is too quibbly to comment on, but I noticed some case inconsistency in the headings that might be of interest. In the span sections there's a minor mismatch in "Span" vs. "raw span", with sentence case being preferred, but then later in the docs for Optional, Hasher, Dictionary it's title case throughout.
S
But the joy of print is that it automatically prints out all of a struct's property names and values. It's hard to live without when you're developing / testing.
S
ibex: But, after a while doing this gets tedious. You could also declare your own ~Copyable protocol with a var description: String, and make inspect() into a generic function over that protocol.
S
John_McCall: Hmm. I was thinking of the limit generally being “I don’t want to overwrite more than this many elements” rather than “I only want to copy a prefix”, but I can see your point. Yeah, I do think the first way of thinking about it is useful to express directly. It would be nice to have ...startingAt: inout Index, limitedBy: Index, copyingFrom: ... that guarantees elements are preserved at or after that limit. It's not hard at all to math that into "how many elements or what are the…
S
gonsolo: Currently Moana takes around 17 minutes to load, I believe this can be cut down to under 2 minutes. It's 13 seconds now (if everything is correctly preprocessed): https://youtu.be/dMYG1hy7kVY?si=DJmQ4vw0tdEm5u4O And it's not Swift anymore.
S
We've got a PR up that organizes the new 6.5 symbols like Cell and TaskID into their proper places in the documentation. PR: stdlib Documentation: curate 6.5 symbols by invalidname · Pull Request #94225 · swiftlang/swift · GitHub Browsable preview: Documentation More details in the PR description. Feel free to leave a comment or question. Thanks.
S
Hello, Swift community! The review of SE-0542: Package Manager Condition Plugins has ended. The Ecosystem Steering Group has decided to return this proposal for revision. We would like the revision to address two goals: 1. Further clarify how target platform conditions are applied to plugins, particularly prebuild plugins. We think it's important for plugin authors that this behavior is well defined and understandable, and that it's something we can commit to supporting long term. 2. More…
S
Thanks for posting this! I read through the docs and code and noticed a lot of interesting details, quite a cool mix of ideas here. It'd be good to have a discussion section on how DepotKit sits with regard to FileWrapper. The expire-on-read mechanism is clever, nice detail. Cheers.