Within BEAM itself there’s no priority mechanism, however, on a RPi3 or BeagleBone you could get about an 200 uS average response time to GPIO on Linux, even under moderate load. The jitter was pretty low too, like 10-20 uS on average, but the 99.9% tail latencies could get up to hundreds of millis.
That’s fine for many use cases. Still I now prefer programming on esp32’s with Nim for anything realtime. Imperative programming just makes handling arrays easier. Just wish FreeRTOS tasks had error handling akin to OTP supervisors.
Now Beam/Elixir would be amazing for something like HomeAssistant or large networked control systems.
As of OTP 28 there's also priority messaging that a process can opt in to. Not really related, but it's new and interesting to note.
That's a very important feature. Without priority messaging you can't nicely recover from queues that start backing up.
Our observation is that Erlang's "soft-realtime" is already getting much harder once Linux stays out of the way. We have a master thesis worth of research on having multiple sets of schedulers in one Erlang VM that run on different hard real-time priorities plus research on a network of message passing and garbage collecting Erlang processes can be doing Earlies Deadline First scheduling.
However that stayed prototypical because we found relativeness of vanilla Erlang on RTEMS was good enough for all practical customer problems we solved.
For very high performance hard real-time we drop down to C and we are currently working on a little language that can be programmed from the Erlang level that avoids that.
--
thanks !
* GRiSP Metal - aka just GRiSP (Erlang/Elxiir + RTEMS)
* GRiSP Alloy - Buildroot Linux based, starts the Erlang/Elixir runtime as process 1 similar to Nerves but more language agnostic (Nerves is for Elixir only) and we support RT Linux and running multiple Erlang Runtimes at different priorities
* GRiSP Forge - Similar to alloy but Yocto based.
The idea is that from the high level language level they are more or less interchangeable.
[1] https://www.st.com/resource/en/datasheet/stm32u5f7vj.pdf
That requires certain choices for CPU, RAM.
We also have a lot of energy management hardware on the board: All PMODs can completely switched off. There is a separate wakeup logic that triggers when the capacitor that gets charged by the harvester has reached a certain charge level and many more.
The challenge with using Erlang for systems like that is that it has a boot phase which it needs to get through until we can manage energy from the Erlang level. So we either need to have enough charge to get through the whole boot or we need to manage the boot process to and do it in chunks then sleep again.
That's what we want to find out with this hardware but first we needed to squeeze in Erlang VM, RTEMS, TCP Stack and all of the Erlang objects to be useful (first goal was reach the shell). That's where we are right now.
I want to believe we'd someday see erlang/elixir all over the place, especially in flight software, due to their use of "lightweight processes" and high fault tolerance, but I don't see it happening any time soon, and I certainly don't see people hiring for it. I think it could solve some legitimate industry issues but it's too big of a change for too subtle of benefits
Makes me curious at what pace and why the size has grown from 1986-2025 and how long ago the line was crossed that made 16 MB seem like a that is now a small runtime?
I love people who can stay excited and optimistic about stuff; it's so easy to be cynical, it's refreshing to meet someone who hasn't had the life sucked out of them.
I need to pick up a GRiSP Nano one of these days. I have the GRiSP 1 and even managed to get Lisp Flavoured Erlang working on there [1], but I haven't played with it much since then. I should fix that.
[1] https://medium.com/@tombert/working-with-lisp-flavoured-erla...
How true that is
voicedYoda•6mo ago