S
Hi everyone, I'd like to share ZenCODE, an open-source (MIT) coding agent I've been building in Swift 6. It runs in the terminal or as an Agent Client Protocol (ACP) agent inside editors, and it ships as a single native zen executable for macOS, Linux, and Windows via WSL (it also runs on a Raspberry Pi). What may be interesting for Swift developers Xcode integration. ZenCODE connects to Xcode 27 over ACP as a coding agent. The optional xcode-tools package bridges Xcode's own MCP server (xcrun…
S
Hi everyone! I'm a new contributor to the Swift project and I'm not entirely familiar with the usual PR review process or how long it typically takes to get feedback. I have grown increasingly frustrated by the fact that async let doesn't preserve the thrown error type of a typed-throwing function. After looking into it, I discovered that this had already been reported some time ago in issue #76169 but I couldn't find any indication that anyone had started working on a fix. So I decided to give…
S
We've just released JWTKit 5.8.0 and JWT 5.2.0 which contain a number of security fixes discovered from external reporters and fuzzing. We recommend that you update as soon as possible. If your application uses provider identity tokens for login, you may also need to configure an expected client or project ID, or migrate to the new audience-aware verification APIs. Updating alone does not secure login paths that continue to accept tokens without checking their audience. See more information on…
S
jrose: I'd be hesitant to pursue this because it depends on the body—there are several criteria ("yields exactly once", "does not throw after yielding") that aren't visible just from the declaration signature. It would be nice™ and maybe we can make it easier in the future, but the "auto" part is probably not going to fly. I did call the idea crazy I don't think it's something that this proposal has to address immediately, but I'd love to see an audit of, say, the standard library and…
S
xwu: func f() yields(T) This also has the advantage of admitting a return type (distinct from the yield type) if we decide that's wanted in the future. As I understand it, this debate has (amongst other things) paralyzed Rust's coroutine work for a number of years. On the other hand, it marks a split from yielding accessors, where I feel like this is intended as a "natural generalization" of those.
S
Is two groups too many? Who wants to always send a @oneway but is comfortable sending a @oneway(never)? Diagnostic groups come with a userdoc, and it seems to me like these would have the same doc, explaining send wrt @oneway annotation. Maybe the thinking is you'd want to opt out of them separately, if you enabled them for the whole project? Neither nonisolated, nonisolated(nonsending) or @concurrent functions, cannot be called using send. Is this vestigial from when this was distributed…
S
meg-gupta: func f() -> yield T // yields an owned value func f() -> yield borrow T // yields a borrowed value func f() -> yield inout T // yields a mutable value KeithBauerANZ: Agree that yielding seems a better choice both grammatically and for reuse of the existing keyword. Hmm, if the comment explaining this feature "wants" to write yields, then why don't we just do that--just like throw/throws: func f() yields(T) (We can always quibble about the punctuation.)
S
+1, I regularly want this, and the design seems obvious.
S
Agree that yielding seems a better choice both grammatically and for reuse of the existing keyword. yielding borrow T is also ungrammatical and doesn't reuse the borrowing keyword (where yielding inout T does reuse the existing keyword). yielding borrowing T isn't great but I think it's better. The proposal doesn't seem to address where in the calling function these coroutines are resumed, and whether or not they form a strict stack. Maybe that behavior is already specified elsewhere for…
S
allevato: there's a path where for certain kinds of with* functions the compiler could auto-synthesize a yielding version I'd be hesitant to pursue this because it depends on the body—there are several criteria ("yields exactly once", "does not throw after yielding") that aren't visible just from the declaration signature. It would be nice™ and maybe we can make it easier in the future, but the "auto" part is probably not going to fly.
S
Very cool, this is something I've wanted for a long time. Defers It isn't called out in the proposal, but do defer statements work as one would expect with yield? func f() -> yield T { let t = getAT() defer { t.release() } yield t // t.release() should happen here } Multiple yields Since it's listed as a future direction, could you also provide some more insight on what more is needed to support multiple yields? Generators are one of the big things I'm interested in here, which this proposal…
S
I had a somewhat working pass at this a few weeks ago. I don’t think it actually solves many of the problems we commonly encounter with Metal. But it was an interesting experiment. Repository schwa/schmetal GitHub - schwa/schmetal: Write Metal shaders in Swift syntax (but don't) Write Metal shaders in Swift syntax (but don't) L
S
This sounds like a great pitch. The only bikeshedding I have is that I think yielding would be better than yield in the function declaration (not the yielding func alternative, but still keeping it next to the returned type), i.e.: func f() -> yielding T // yielding an owned value func f() -> yielding borrow T // yielding a borrowed value func f() -> yielding inout T // yielding a mutable value This would also make it more consistent with the yielding syntax we currently have for accessors.
S
I'm not sure if it would be good but it seems like if your error enum can be constructed for arbitrary Error types, and the purpose of this syntax is just to rethrow or wrap, the compiler could do that for you and you can just write try. protocol ConvertableFromError: Error { /// Compiler promises to only call this init after attempting to as? cast your error. init(wrapping: some Error) } And the implementation could map to cases for specific known errors... I'm not sure how much this buys over…
S
theoriginalbit: Mirroring the existing catch is MyError and catch let error as MyError would yield the spellings catch not MyError and catch let error not MyError; is not would read better, but I'm unsure whether requiring two keywords is desirable. Having a not keyword would very likely not be accepted as it is explicitly barred for Swift Evolution proposals for Boolean values like is provides. If you really want these semantics, you might want to seek ~is/!is as a keyword. The keyword is only…
S
Here's a draft Swift Evolution Proposal for this work: https://github.com/tbkka/swift-evolution/blob/c271626276f1e483eb55508423e3b0faf566a494/proposals/NNNN-dynamic-casting-of-noncopyable-values.md Any feedback is appreciated.
S
+1. This is clearly useful, in line with the existing design of dependency conditions, and as the proposal says the technical constraints that prevented implementing it initially have long since been resolved.
S
oh yeah, I guess I forgot that already landed
S
This is already done in Exclude scratch directory from Time Machine backups by MahdiBM · Pull Request #10464 · swiftlang/swift-package-manager · GitHub. Should make it to Swift 6.5.
S
Hi everyone, This is a pitch to introduce single-yield functions to the language. Single-yield functions are declared by writing yield in the result position: func f() -> yield T // yields an owned value func f() -> yield borrow T // yields a borrowed value func f() -> yield inout T // yields a mutable value A single-yield function is a coroutine that runs until it reaches a yield statement. It then yields a value to its caller and suspends. When the caller is finished accessing the value, the…
S
@ktoso Thanks for writing this, I'm excited to see how this pitch evolved! It looks very good! IMO the motivation behind the statistic was unfortunate and could be misunderstood, perhaps can derail the discussion on the formal proposal. I had the same thought when I came across that part as noted by Franz here: The motivation section of this proposal says that 70% of the Task {} usages were fire-and-forget but it doesn't state if those fire-and-forget usages were valid in the first place. I…
S
Some folks will be out for the LLVM conference but we are still meeting today! Today's agenda is up on Notion
S
There is do { // ... } catch let error where !(error is SomeErrorType) { // ... } but that does not provide special support for typed throws.
S
Neither nonisolated, nonisolated(nonsending) or @concurrent functions, cannot be called using send. Why not? Sending one-way sync jobs to concurrent executor might be handy as well. I see a lot of DispatchQueue.global().async { ... } in our codebase. @oneway is not accepted on properties, computed properties, subscripts, or static functions, because they cannot be used with send. What about global-actor isolated static functions, or parameter-isolated static functions? let collect =…
S
Has anyone else wanted a negated type pattern in catch? I couldn't find an earlier thread on this. Particularly since the introduction of typed-throws (SE-0413) I find myself often writing a forwarding clause when a do body mixes different typed and untyped throws (or just different typed throws). func fn() throws(MyError) { do { try someTypedThrows() // throws(MyError) try someUntypedThrows() } catch let error as MyError { throw error // making sure it doesn't end up wrapped in .unhandled }…
S
Thanks, that is a useful limitation to make explicit. For the workflow I described, I think it is reasonable for the application to add an explicit exact requirement for C when it needs a particular packaging revision, even if C would otherwise only be a transitive dependency through B. That requirement would still need to satisfy B's version constraints. Assuming SCM-to-registry mapping identifies both references to C as the same package, the application could explicitly select…
S
I agree that publishing optimized archives through existing registries is the right starting point. Registry archives avoid downloading Git history, but they do not necessarily exclude tracked test fixtures, benchmarks, or other files unnecessary for downstream builds. A registry standardizes how source archives are distributed, not how their contents are selected or optimized. The registry specification accepts a publisher-supplied source archive; it does not require automatic selection of…
S
Thanks for opening this pitch. I think this is an important and long-standing gap that we should fill in swift-system. I agree with @jrflat that this should be ~Copyable similar to the pitched Win32 types. I wish we could go back and make FileDescriptor ~Copyable as well. Jonathan already explained it well which benefits we get from ~Copyable usage here and from personal experience I have modeled those types with ~Copyable for the past two years and it has saved me multiple times from…
S
Hello, Swift community! The review of SE-0560: Build configuration conditionals for target dependencies begins now and runs through November 11, 2026. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to me as the review manager by email or DM. When contacting the review manager directly, please put "SE-0560" in the subject line. What goes into a review? The goal…
S
Thank you everyone, it's been 6 months and with no feedback I will be archiving and deprecating swift-statsd-client