News for hackers. Stuff that matters.
Re:Fucking Approachable Swift Concurrency by isodev on Tuesday December 30, 2025 @10:38AM (#46434366)
I really don't know why Apple decided to substitute terms like "actor" and "task" with their own custom semantics. Was the goal to make it so complicated that devs would run out of spoons if they try to learn other languages?

And after all this "fucking approachable swift concurrency", at the end of the day, one still ends up with a program that can deadlock (because of resources waiting for each other) or exhaust available threads and deadlock.

Also, the overload of keywords and language syntax around this feature is mind blowing... and keywords change meaning depending on compiler flags so you can never know what a code snippet really does unless it's part of a project. None of the safeties promised by Swift 6 are worth the burnout that would come with trying to keep all this crap in one's mind.

Re:Fucking Approachable Swift Concurrency by hn-acct on Tuesday December 30, 2025 @10:50AM (#46434517)
Do people actually believe that there are too many keywords? I’ve never met a dev irl that says this but I see it regurgitated on every post about Swift. Most of the new keywords are for library writers and not iOS devs.

Preventing deadlock wasn’t a goal of concurrency. Like all options - there are trade offs. You can still used gcd.

Re:Fucking Approachable Swift Concurrency by isodev on Tuesday December 30, 2025 @11:07AM (#46434711)
> Do people actually believe that there are too many keywords?

Yes they do. Just imagine seeing the following in a single file/function: Sendable, @unchecked Sendable, @Sendable, sending, and nonsending, @conccurent, async, @escaping, weak, Task, MainActor.

For comparison, Rust has 59 keywords in total. Swift has 203 (?!), Elixir has 15, Go has 25, Python has 38.

> You can still used gcd.

Not if you want to use anything of concurrency, because they're not made to work together.

Re:Fucking Approachable Swift Concurrency by dagmx on Tuesday December 30, 2025 @12:01PM (#46435304)
Most of your listed examples aren’t keywords though. They’re built in types or macro decorators.
Re:Fucking Approachable Swift Concurrency by saagarjha on Tuesday December 30, 2025 @11:23AM (#46434873)
Task and MainActor are types.
Re:Fucking Approachable Swift Concurrency by isodev on Tuesday December 30, 2025 @11:39AM (#46435045)
So?
Re:Fucking Approachable Swift Concurrency by jen20 on Tuesday December 30, 2025 @12:07PM (#46435385)
So... they aren't keywords.

Swift does indeed have a lot of keywords [1], but neither Task or MainActor are among them.

[1]: https://github.com/swiftlang/swift-syntax/blob/main/CodeGene...

Re:Fucking Approachable Swift Concurrency by isodev on Tuesday December 30, 2025 @12:59PM (#46436022)
I never said they’re keywords. Y’all way too focused on defending Apple at all cost.
Re:Fucking Approachable Swift Concurrency by saagarjha on Tuesday December 30, 2025 @08:57PM (#46440481)
Replying to someone talking about keywords with a list of something that's not keywords, then retreating to "you are an Apple bootlicker" when someone points that out, is not a good look.
Re:Fucking Approachable Swift Concurrency by dagmx on Tuesday December 30, 2025 @12:22PM (#46435590)
If you’re including types, you’d hit the many hundreds if not thousands in most languages.

It dilutes any point you were trying to make if you don’t actually delineate between what’s a keyword and a type.

Re:Fucking Approachable Swift Concurrency by jgavris on Tuesday December 30, 2025 @10:03PM (#46440818)
I still feel like Swift 5 (5.2?) was the sweet spot. Right now there are just way too many keywords, making C++ look easy again.

Similarly, I find Combine / GCD code far easier to write and read and understand, and the semantics are better than structured concurrency. I have plenty of production Combine code in use by (hundreds of) millions of people and it hasn't needed to be touched in years.