Why was the async keyword removed and replaced with Task?

I see async was replaced by Task.init and will be removed shortly, but why? I like the async keyword because it is pink!

I like the async keyword because it is pink!

That's not a strong argument.

Could you show code where you get this warning ?

This may help you understand the difference: https://www.hackingwithswift.com/quick-start/concurrency/whats-the-difference-between-async-let-tasks-and-task-groups

That usage of async is actually a function (see here) which returns a Task instance. It’s arguably confusing to have both a function and a keyword with the same name, and just initializing a Task directly seems cleaner. Seems like the kind of API refinement that is normal when developing something new with everyone watching.

I agree with the points above but also…

If you’re curious about the rationale behind decisions like this, you’ll find that much of the discussion took place in public via Swift Evolution. You can pop on over to Swift Forums and read through the threads where this was all thrashed out.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Why was the async keyword removed and replaced with Task?
 
 
Q