top | item 44146369

(no title)

svapnil | 9 months ago

What's a usecase for this that actually makes sense? Why does Erlang need to run on IoT devices? The main usecases of Erlang I know of are suitable for beefy machines.

Source: former Erlang engineer

discuss

order

cess11|9 months ago

The renowned AXD301 ran on 68k and UltraSPARC II processors. An ESP32 isn't that far off with its 240-ish MHz.

Initially Erlang was developed on VAX, at what, 3 MHz or so? Since then decades of optimisations have gone into the BEAM.

simoncion|9 months ago

A lot of optimization has happened to that VM, yeah. However, it has likely gotten a lot more complex. One source of complexity that comes to mind is SMP support.

(Do I have any idea how the VM would run on a 200 MHz machine? Hell no. I'm just mentioning that the thing has also gotten more complex as time has gone by.)

johnnyjeans|9 months ago

Why not? Erlang encourages the same kind of really flexible actor-driven architecture that Smalltalk did. It's a nice programming paradigm that's more general than you think, and the hornclause syntax is really, really nice. Very pleasant to use like this.

sph|9 months ago

Smalltalk had nothing to do with actors. It was largely a single core system.

kwillets|9 months ago

There's a why page in their docs, but basically it's cheaper than a multitasking OS for doing the same thing. The valueprop of Erlang is lightweight threads and message-passing.

My knowledge of microcontrollers is dated, but the frameworks for Arduino etc. seemed limited on their ability to do event or message-based programming; most example apps at least were a polling loop. The classic architecture of setting up interrupt/event handlers and going to sleep was not there.

throwawaymaths|9 months ago

before they went under IIRC bowery farms was using BEAM for a fleet of vertical farm in their automated farming robotics, i imagine the no-nonsense networking and clustering was an advantage (i don't know for sure)

imagine youre automating your home, with an rpi here and a gpu node here etc. wouldn't it be nice to immediately have dev access to any node in your home just by connecting to any node?

solid_fuel|9 months ago

The actor and supervisor system is really, really nice when you want reliability even with only one core (at least in theory, nothing against Atom but I would probably want a more battle-tested VM for shipping a production device).

hinkley|9 months ago

It was originally built for phone switching hardware.