While porting some of my libraries to Swift 6 in preparation for my next projects, it struck me for the first time in my 5-6 years of Swift programming, and maybe echoing some of the posts on this forum: has Swift become an overengineered language? Can it be simplified, or will it only get more and more complex?
That happened when I was looking at the Task
constructor's signature:
@discardableResult
public init(priority: TaskPriority? = nil,
operation: sending @escaping @isolated(any) () async -> Success)
Take just the operation
argument. It's a closure that is sending, escaping, declares any isolation (I don't understand this part very well yet), it's async and it returns Success
. That's a whole bunch of facts - 7 to be precise - you need to know about just one parameter of this constructor.
I understand that all 7 make sense and there's nothing you can do about it within the current strict concurrency model.
My absolute respect goes to people who have built this incredible language. I love Swift, and I understand that it is at the cutting edge of today's paradigm shifts in our industry. In order to survive in the multi-core era we live in, you do need more reliable concurrency and Swift delivers that.
However I can't help but think at times, has it gone too far? We went from semaphores, the simplest fundamental building block of concurrency, which is also error-prone, yes, to a monster of a paradigm that kind of guarantees correctness but may leave both you and even the compiler overwhelmed. (Let alone, you do need to occasionally resort to semaphores where structured concurrency hits its limits.)
Bottom line, I want to ask the language maintainers: could the next evolutionary step for Swift be simplification of the existing language rather than new features? Really, isn't it time to step back, look at it and maybe say: "how can we simplify things?"
Thank you!