NINETY DAYS
NINETY INCIDENTS
NINETY PERCENT
YOU PAID FOR ALL FIVE NINES BUT YOU’LL ONLY NEED THE EDGE
| Cocoaphony Blog | https://robnapier.net |
| GitHub | https://github.com/rnapier |
| Twitter (defunct) | https://twitter.com/cocoaphony |
@Drwave I was 48 when Covid stopped me cutting my hair. I grew it out the way I wanted to since I was 20. And at various points I’ve been worried that maybe I wouldn’t look right at 60. But my neighbor at 60-something had aging hippy hair he’d grown out when he retired, and I thought no, I absolutely want to look like him.
But you’ve inspired me to maybe a trim to get things a bit more in place, because my hair is getting a bit wild these days. I could try long without losing control.
NINETY DAYS
NINETY INCIDENTS
NINETY PERCENT
YOU PAID FOR ALL FIVE NINES BUT YOU’LL ONLY NEED THE EDGE
@kayleesdevlog `scale` isn't nonisolated. (it's also a computed property, not a `let` property, but it's not nonisolated at all.)
I would expect that there are internal reasons that Apple made opacity nonisolated, and they could have wrapped it in a getter to be like the others. But there is likely history there, or a performance tweak.
But the key is that "make sure `unsafe` does not appear in the interface" is not a particularly major design goal. It shows up a bit.
@kayleesdevlog In this case, I am pretty sure the problem is that Opacity is itself an AnyTransition, and AnyTransition is not Sendable. But I'm betting the underlying transition *is* Sendable, and Apple would like to expose that. This would be the best way to express that promise without creating an extra protocol indirection (which would have a runtime cost).
Even with that, you'd probably still need the `unsafe` marking, since *this* type isn't Sendable. I don't think that's hideable.
@kayleesdevlog This indicates that `opacity` is promised by the author (Apple) to be safe to call from any context (i.e. any thread), even though the compiler can't prove it. The "unsafe" here means that you must trust the author to follow the rules rather than the compiler enforcing the rules.
For details on nonisolated(unsafe), see the SE proposal: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0412-strict-concurrency-for-global-variables.md
This annotation opts out of static checking, but not dynamic (runtime) checking, so if there are mistakes, it may crash.
RE: https://mastodon.social/@lapcatsoftware/116278367466232058
For me, the StM feature that’s worth the whole price. Everything else is just bonus. I hate autoplay videos so much.