[erlang-questions] Erlang is *not* a implementation of the Actor model Re: Go vs Erlang for distribution

Ulf Wiger ulf@REDACTED
Mon Jun 23 17:00:24 CEST 2014

I have argued in a number of presentations that what selective receive does for Erlang is to allow a form of ‘local-scoping’ of events. Haskell, Occam and for that matter, UNIX select(), accomplish this using separate buffered (or blocking) channels, where the program can choose which channel(s) to receive from at any given time.

The underlying observation is that there is no defined ordering between events which arrive to a process from different senders. What any selective receive model does is to allow the receiver to reduce the statespace by ignoring events that are irrelevant for the operation at hand.

I’m not sure who deserves most credit for talking about ‘accidental complexity’ in terms of Erlang programming, but I’m leaning towards crediting Joe for evangelizing it the most, although I’ve seen stencils from the late ‘70s where Mike Williams wrote very good stuff about it. The term has of course been used elsewhere, not least by Fred Brooks.

One can compare FIFO, run-to-completion message handling with GOTO programming, and I recall Simon Peyton-Jones noting that the key to avoiding the problem is to have proper scoping of messages (c.f. variable scoping).

Reducing the state space is of course key to any formal verification effort, so I’d claim that Erlang actually provides some tools for extending the reach of formal verification. But the real benefit of Erlang is that it allows developers to write more complex event handling systems that are at least *debuggable*, if not entirely formally verifiable.

The properties ‘fairness’ and ‘reachability’ are global, and are made a bit more difficult to verify in systems that make use of selective receive. OTOH, verification of a global state-event matrix has a pretty low complexity ceiling, and at least in telecoms (and, I’d claim, in the Web), a missed deadline is not a system-wide failure, which means that you can get very far with informal testing and statistical goodness properties.’

Ulf W

On 23 Jun 2014, at 14:17, Ignas Vyšniauskas <i.vysniauskas@REDACTED> wrote:

> This is the availability of the `receiver .. after ..`
> primitive. Allowing local-timing-based behaviour in processes usually
> means that you need some very strong global fairness assumptions in
> order to do any kind of formal proofs. I don't see how one could
> obtain a (useful) representation of Erlang semantics in any of the
> usual process calculi without ignoring this fact.

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.

More information about the erlang-questions mailing list