6 ms·
Just forget everything you've learned about it previously, use 6.2+, non isolated by default and every upcoming feature turned on. And your intuition will be sp
by hn-acct 8mo ago
Just forget everything you've learned about it previously, use 6.2+, non isolated by default and every upcoming feature turned on.
And your intuition will be spot on.
- apt-apt-apt-apt 8mo agoCan you explain a bit more on what changed with 6.2+ that is now better?
- saagarjha 8mo agoFar fewer actor hops by default which usually makes it easier to write correct code
- hn-acct 8mo agohttps://github.com/swiftlang/swift-evolution/blob/main/proposals/0449-nonisolated-for-global-actor-cutoff.md https://github.com/swiftlang/swift-evolution/blob/main/propo... https://github.com/swiftlang/swift-evolution/blob/main/proposals/0461-async-function-isolation.md https://github.com/swiftlang/swift-evolution/blob/main/propo... https://github.com/swiftlang/swift-evolution/blob/main/proposals/0463-sendable-completion-handlers.md https://github.com/swiftlang/swift-evolution/blob/main/propo... https://github.com/swiftlang/swift-evolution/blob/main/proposals/0466-control-default-actor-isolation.md https://github.com/swiftlang/swift-evolution/blob/main/propo... All of these changes improve the ergonomics of async/await. Fewer hops and a better alignment of when one would expect a hop to occur. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0493-defer-async.md https://github.com/swiftlang/swift-evolution/blob/main/propo... async defer is nice too but it's not in the 6.2 public release AFAICT.