BEAM There, Done That with Omer Kilic & Frank Hunleth on Nerves

Omer Kilic worked on Erlang Embedded and Erlang/ALE at Erlang Solutions, and Nerves started out as shell scripts and Erlang. This episode goes back to those Erlang roots of embedded BEAM.

Before Nerves

Omer and Ivan Iacono fitted the Erlang runtime and libraries into 8 MB of flash on a MIPS board. Ivan sent patches for MIPS-specific runtime issues that only show up on architectures almost nobody runs.

Reinventing OTP badly

Frank’s handheld retinal diagnostic device was written in C++, with actor-like processes, a hand-rolled supervisor and hard real-time light control offloaded to low-level hardware. His conclusion was that recreating what OTP gives you for free is a lot of work, and his version was rudimentary in comparison.

Supervising hardware

A companion microcontroller wrapped in a GenServer becomes part of the supervision tree, and a restart returns both sides to known initial conditions. Omer sees heterogeneous SoCs with big application cores and small RISC-V real-time cores as small distributed systems on one chip, where message passing is the right model.

Let it crash, in production

Across a SmartRent fleet, rare exceptions were traced to memory bit flips during brownouts and at high altitude. Supervision recovered from all of them without any user-visible impact.