S
I have been going back and forth over this proposal. Overall, I understand why there is a need for it though I agree with @KeithBauerANZ that it won't solve the existing usage where UI developers are currently using unstructured tasks. Concretely, it is almost never correct to create a task without retaining it for UI code. These tasks are often executing state updating logic and if they are not retained they can't be cancelled when the view disappears. That's a common bug that results in…
S
Which repo would that be? And if you want to point me to where the created-by-build-system xattr gets applied, I’d be happy to take a stab at implementing it and submitting a PR.
S
ktoso: It's not a "mistake", since there's no other way to call async code from a synchronous context unless you enter a task -- either using Task.init, .detached, or preferably .immediate. Those calls do exist and will continue to exist, if we like them or not. It is helpful to make them well spelled out explicitly (and implement efficiently) rather than keep them hidden in sneaky wrappers (as shown in the Motivation section). I disagree with this take — it's very much a mistake, as it almost…
S
Yeah, I've seen the link and am aware of that connotation as well. Nevertheless, oneway carries significant meaning in multiple RPC systems in the past. The word isn't exclusively used in cryptography, it is a well known term in distributed systems and rpc design. That it's used in other contexts doesn't really change that.
S
ktoso: Very much so, most RPC systems offer it -- please refer to the "prior art" section: swift-evolution/proposals/NNNN-oneway-methods.md at wip-remote-call-blocking-oneway · ktoso/swift-evolution · GitHub The semantics this is offering is the same as all this prior art systems. Sorry just to be clear, my link was to the wikipedia article for one-way functions, a cryptography construct that describes something trivial to compute but difficult to compute the inverse. That seems distinct from…
S
KeithBauerANZ: I think that in general, _ = Task { await ... } is a mistake [...] It's not a "mistake", since there's no other way to call async code from a synchronous context unless you enter a task -- either using Task.init, .detached, or preferably .immediate. Those calls do exist and will continue to exist, if we like them or not. It is helpful to make them well spelled out explicitly (and implement efficiently) rather than keep them hidden in sneaky wrappers (as shown in the Motivation…
S
jrose: (I also wonder about the middle ground of "this task has been enqueued", which for distributed actors would make send still async. But I guess that would be neither low-level enough to implement an alternate contract, nor high-level enough to provide any significant additional guarantees to the caller.) That would defeat the purpose; the send must be usable from synchronous contexts. This design is aiming to not introduce a special case for distributed but allow actors to be used in the…
S
goose: Just wanted to call out explicitly that one-way functions are already a thing Very much so, most RPC systems offer it -- please refer to the "prior art" section: swift-evolution/proposals/NNNN-oneway-methods.md at wip-remote-call-blocking-oneway · ktoso/swift-evolution · GitHub The semantics this is offering is the same as all this prior art systems.
S
I think that would be reasonable if you're interested in filing an issue or opening a PR. We could probably apply it at the same time as the created-by-build-system xattr on top-level build directories.
S
I've been going through this exercise of excluding a number of directories from my Time Machine backups because they often contain thousands of tiny files that are easily regenerated. This can really help speed Time Machine backups, especially first-time backups (which I find I have to do far too often). It would be handy if swift build (and maybe SPM) could set the tmexclusion flags when they create some of these temporary directories. Thoughts?
S
I realize the original post was very theoretical, so I used agents to build a web app that visualizes the type resolution and the graph SwiftLexicalLookup builds internally. You can check it out here: typegraph.fsakel.com. Quick Example The app uses my own branch of swift-syntax since the last feature is still in the process of getting upstreamed. Here's the example from the original post where the graph more clearly shows how we get a cycle. In the example, MyModule.A > A is crossed out…
S
Network.framework goes through the user-space networking, but everything leaves the device either through a socket or a kernel channel (shared memory tx/rx ring, zero copy, minimal syscalls). Here's a generated diagram based on disassembly, macOS 27.0.1 (click for more details)
S
Jon_Shier: Yes, but Network.framework still uses sockets under the hood Very rarely (if ever) these days; normally it's user space networking instead of sockets.
S
Michael_Ilseman: E.g. Windows sockets are not backed by file descriptors, not even through UCRT. Sure, but then I would ask what is special about a file descriptor? What makes it truly unique? Ultimately, the concept is the same - SOCKET is a spelling for a descriptor. What makes int (or if you prefer CInt) so special that it should be deemed to be the only viable answer for the descriptor? I think that there might be some value in changing SocketDescriptor to use an associatedtype to a…
S
Yes, but Network.framework still uses sockets under the hood, it just also does a bunch of extra work to automatically support things like multi path TCP and Network Extension integration. If Apple wanted to rewrite it in Swift natively, they'd need core Swift primitives like this.
S
Sounds like this is an LLM problem rather than a Swift problem?
S
Isn’t the recommended path on Darwin to use Network.framework instead of BSD sockets?
S
You're right that I should have been more explicit about what platforms we're supporting now vs deferring as future work. From a technical and design perspective, I think that Windows is severable. However, it makes sense to talk a little about as it could inform some naming decisions. Windows shares a lot of similar surface area and there would be a lot of benefit to unify across them, especially for the constants. However, Windows sockets are different and pull in potentially different design…
S
I actually made one of them: GitHub - CharlesJS/SyncPolyfill: A polyfill to use Synchronization types on older macOS / iOS versions · GitHub
S
I'm trying to use @resultBuilderresultBuilderresultBuilderresultBuilder on Linux, my compiler is 6.2.4, but it is consistently rewriting the closure in crazy ways. For instance, if there is an array builder defined, it will render a single struct as [struct] for no reason. Then, if I take out the array builder, it will render the struct as a struct, however the builder itself will claim it was expecting an array, but it shouldn't be. Is there a way for me to see the code that the @resultBuilder…
S
I'm already using os_unfair_lock since that's what Mutex uses internally on Darwin, and re-exporting Synchronization.Mutex on other platforms. But there's an enormous amount of Swift projects (including from Apple) that have their own version of a Mutex type, solely because of the iOS 18 requirement.
S
github.com GitHub - swhitty/swift-mutex: Cross platform lock backporting the Swift 6 Mutex... main Cross platform lock backporting the Swift 6 Mutex API to earlier platforms - swhitty/swift-mutex
S
Honza_Dvorsky: Back-deploying Mutex to macOS 10.15-aligned versions would go a long way towards practically letting the ecosystem move to it from Foundation's locks. Next best thing is a wrapper that conditionally uses NSLock on older systems. Possible implementation (click for more details)
S
Hi all, I’m looking for guidance on the right reviewer for swiftlang/swift#76329, a small documentation-only change correcting parameter comments for three DecodingError functions in Codable.swift. The PR has been open for a while (2 years ). I recently revisited it, and tried following up in the PR thread last month but haven’t heard back. Could someone familiar with the standard library point me to an appropriate reviewer, or take a look when time permits? Thanks!
S
https://developer.apple.com/swift/downloads/swift-logo.zip Contains a PDF outlining the permitted usage and how it needs to be attributed.
S
Has there been discussion of back-deploying Mutex to older Apple platforms? We can't adopt it in many of our API-stable packages that shipped a 1.0 before Mutex was available, as bumping platform requirements is a semver major change. Back-deploying Mutex to macOS 10.15-aligned versions would go a long way towards practically letting the ecosystem move to it from Foundation's locks.
S
Hi there, I'm thinking of publishing my own Swift plugins for Jetbrains IDEs and VS Code IDEs (yes I know they already exist but I want to have a crack anyway). I'd like to use the Swift Logo (without modification) for the plugin logo when it is loaded. Can I use the swift logo this way provided I also mention in the plugin notes that it is 3rd party and not official etc? Thanks!
S
beaumont: With the pitch PoC this works for a library target without an include/ directory but doesn't appear to work for executable targets. Yeah, the POC probably isn't complete. I'm actually going to break the multi-language gen into it's own evolution proposal and do it first. I'm working on the code now and see a few things like that which I want to improve. Thanks for pointing that out though. I'll make sure it works for all targets.
S
Hi all. In Policy on hiding implementation details from Swift module interface, I discussed the implications of removing private declarations from .swiftmodule files on diagnostics. I've been working more towards this, but have come across changes that indicate LLDB may impose some requirements. I've come across this PR: [Serialization] Prepare the infrastructure for the deserialization safety feature by xymus · Pull Request #62886 · swiftlang/swift · GitHub. It introduces a kind of "poison"…