SE-0306: Actors

First off, I am so excited about Swift getting first class support for actors with such a performant design and deep integration.

But I don't think the current proposal is there yet. I agree with Chris.

Keep this proposal exclusively focused on pure actor model.

Using class infrastructure to implement actors is an implementation detail. We can decide later to surface this capability (actor classes). For now, make actors implicitly final. Once you expose class capabilities of actors you can say actor declaration is short for final actor class and actor class would enable inheritance. The actor implemented as final class also removes the initializer complications as well.

I also agree with @Chris_Lattner3 that no synchronous access should be provided in the base proposal. Keep actors pure. Then we can tell the developers that if they use pure actors, they will get distributed processing and fault isolation almost for free. (Usual disclaimers apply: Depending on your system design and purpose)

After removing the above items from the proposal, I suggest improving examples to better showcase pure actor systems.

A side note:

From the feedback on the forums it is evident that the current Swift community is not very familiar with actor model of concurrency and its design patterns. The upcoming proposals that add features for ease of migration and integration with the existing ecosystem are going to muddy the waters even further and confuse people.

It is critical that we create high quality reference and training materials on actors and actor systems, focusing on new actor centric designs. Most of the focus right now seems to be on migrating existing code with minimal change and no redesign. This is not going to work very well and people will start to blame actors for it.

The proper use of actor model requires a redesign of many existing systems and needs correct understating of the actor model of concurrency. We should not overemphasize the mechanical details of actor implementation (as a class wrapping a logical serial execution queue). We should also properly introduce high level conceptual view of actor systems.

17 Likes