[Pitch] Global actors

Hmm. Let me see if I understand this correctly:

  1. I can magically convert a class hierarchy to being a (single) actor by applying a global actor to the base class. (Edit: Not correct, as each actor instance gets its own execution context. So the result would not be an actor, but "act" like one in most cases.)
  2. I can make a bunch of actors use the same concurrency domain / actor context by not making them actors (using "actor XYZ") but instead making them classes in a global actor (using "@myActor class XYZ"). (Edit: Sort of. They are sharing the same concurrency domain, but they are not really actors, as that requires separate concurrency domains for all instances.)
  3. I can create an actor by first creating a global actor, and then doing "@myActor class XYZ" instead of "actor XYZ". So you could perhaps argue that "actor XYZ" is syntactic sugar for "@tempPrivateActor class XYZ"... (Edit: No, the result would not be an actor, see above.)

This makes a lot of sense to me. But I think it makes the separation between "actor XYZ" and "class XYZ", and the whole discussion about whether actors should support inheritance, a bit odd... :smiley:

(Edit: Corrected after reading @xwu's response.)

2 Likes