Where is Elixir and the Actor Model heading?

I think the discussion neglects a lot of important BEAM centric points.

We might liken primitive BEAM processes, as spun up by Process.spawn, to actors. It’s hard to do anything meaningful when processes are isolated to the extent that you don’t know about their failure. BEAM processes remedy this with the link and the monitor. OTP builds on top of these primitives to give us the Application, Supervisor, and Generic Server. That’s how we design and structure Elixir projects around concurrency and falt-tolerance. There’s a lot of value there. OTP brought Elixir’s concurrency model to a conclusion a long time ago by building on these primitives [1].

STM doesn’t offer any concurrency (it’s about data). What exactly constitutes STM aside… Erlang/Elixir have ETS so we have those efficiencies. They’ve had it for a very long time. Perhaps before STM had a name.

CSP is interesting but I’m not sure how much it (I presume the channel) helps w/ clarity. There are a couple of points to consider:

  1. OTP is the vehicle we use in practice. It makes for much better code structure than our primitives. The Actor Model and CSP are theoretical. If CSP is just as theoretical as the Actor Model… and we liken BEAM processes to actors… then Go’s concurrency model may only be as useful in practice, or there about, as primitive BEAM processes. Perhaps something analogous to OTP will be built on top of Go’s go-routine and channel [2].

  2. Erlang made a practical choice. They opted away from a channel-like pipe and pipe algebra because it wasn’t as useful for their users as the model that we have today. That might have been their application area, the details, their users, their particular implementation, their times, or the BEAM model might in-fact have a more general practical advantage (or not).

Let’s not conflate the Actor Model w/ the way we build Elixir projects because OTP makes them sufficiently different to warrant a distinction.

[1]: Kubernetes’ and similar projects are quite like OTP but extended to more than one machine.
These projects are for building distributed systems beyond a small number of machines not a language alone.

[2]: I can’t see them using the Actor Model because they’re using CSP.

3 Likes