Re:Swift Evolution: Actors
by afavour on Tuesday March 16, 2021 @03:58PM
(#26482052)
I really enjoy working with Swift but after looking at this Actor proposal I think I agree with you. It seems like you'd always want to use actors? Unless you specifically don't want things to be concurrency safe. It feels like something the language should have had from the start or should have as an external library.
[ Parent
| on HN ]
Re:Swift Evolution: Actors
by ogre_codes on Tuesday March 16, 2021 @05:21PM
(#26483154)
> It seems like you'd always want to use actors?
My impression is that when working with Swift your first tool of choice should be a value type, so a strict or an enum. Actors would only be desirable when you need class-like behaviors and need concurrency. Maybe I’m missing something, but I suspect many of us will never use actors directly at all. I certainly don’t see any parts of my code which demand this kind of structure.
Re:Swift Evolution: Actors
by viktorcode on Wednesday March 17, 2021 @05:18AM
(#26488425)
You'll want actors if you have shared mutable state. But the most common usage of concurrent programming will be covered with simple async / await calls.