i wonder how Erlang on a microcontroller would feel like
-
@david_chisnall right, but if you were working on an MCU dialect (and it would almost certainly have to be a dialect) you could change that
Doing so would fundamentally change the Erlang abstract machine in ways that would impact the rest of the system. In particular, Erlang has a notion of selective receive as a core part of the language (which is necessary for things like two-phase locking, which can't be expressed natively in the actor model without it).
Selective receive means that waking up an actor that has a full message queue will not automatically result in its message queue shrinking in size.
-
Doing so would fundamentally change the Erlang abstract machine in ways that would impact the rest of the system. In particular, Erlang has a notion of selective receive as a core part of the language (which is necessary for things like two-phase locking, which can't be expressed natively in the actor model without it).
Selective receive means that waking up an actor that has a full message queue will not automatically result in its message queue shrinking in size.
@david_chisnall @whitequark that makes sense. At that point, when some core quality is lost, changing how the system works and can be used, a subtle line is crossed between Erlang variants and Erlang-inspired languages.
I think in a way that encourages us to ask useful questions like what properties of Erlang are you interested in? what are your other inspirations? what requirements do you have? what are the implications of combining those things in this way?
(though obviously you don't have to have answers or be interested in them. I just think it gives useful structure to the inquiry)
-
Doing so would fundamentally change the Erlang abstract machine in ways that would impact the rest of the system. In particular, Erlang has a notion of selective receive as a core part of the language (which is necessary for things like two-phase locking, which can't be expressed natively in the actor model without it).
Selective receive means that waking up an actor that has a full message queue will not automatically result in its message queue shrinking in size.
Some background:
In Verona, we have a generalisation of the actor model, which makes things like two-phase commit easy but makes this problem worse: the equivalent of a message is 'sent' to multiple concurrent owners (generalised actors), so working out who to wake to reduce the total number of messages in the system is hard.
We looked at what a version for embedded devices would look like, but even the actor-model subset is basically impossible. Even simple actor model has things with fan-out, so waking up an actor because its queue is full may cause two more messages to be sent. And these may be in cycles.
And actor model (and BoC) don't provide good tools for reasoning about the worst-case numbers.