Re:Swift Evolution: Actors
by slavapestov on Tuesday March 16, 2021 @06:28PM
(#26484045)
There are also the various static checks that prevent you from accessing actor-isolated state outside the actor, or passing non-Sendable state across actor boundaries. It's not clear how a general language extension mechanism could implement those.
I wonder if Rust can do that, by using data lifetimes incompatible between actors, thus protecting them from being passed around beside sending.
I also don't see why a namespace, like that of a function, won't be enough isolation from peeking between actors.
Somehow Scala got Akka, the actor framework, without having to tailor the language for that.
> How do you isolate things when there's shared memory?
That's precisely what actors aim to solve. Actors pass messages, not memory.
> Akka
If you look at an actor framework built in a feature-rich language (Orleans), that problem isn't apparent at all. Even Rust, with all the ownership complexity, manages to do elegantly handle actors, without an explicit plan to do so. Your critique is more relevant to Java than actor libraries.
it seems like these fundamentals are in tension, and tradeoffs need to be made, which just means that there won't be a one size fits all paradigm. maybe someone will create something that is truly magic and does everything, but more likely they're trying to sell you something.