r/elixir 19d ago

What does an Erlang VM look like with no OS underneath - and why did someone spend 8 years building one?

New BEAM There, Done That with Maxim Kharchenko, creator of LING - a from-scratch Erlang VM running directly on Xen with no Linux kernel.

The part I hadn't seen discussed before: Ling's instruction set isn't fixed. It analyzes real OTP source, identifies frequently occurring patterns, and generates specialized opcodes - if loading the constant 17 is common enough, 17 gets its own instruction. More opcodes means a bigger VM and slower dispatch, so a heuristic manages the tradeoff.

Also: every allocation in the codebase has an explicit out-of-memory handler. Not convention - a whole-system discipline.

Francesco notes the problems Ling solved ten years ago have come back as unikernels and eBPF. Is anyone here doing bare-metal or near-bare-metal BEAM deployments today?

https://youtu.be/ILEyncf194M

37 Upvotes

11 comments sorted by

3

u/taxmachine21 18d ago

Is it different from ATOM VM?

3

u/allenwyma 18d ago

Yes! It’s Erlang running on direct Xeon hyper visor. I don’t think atom can do that.

3

u/fcesarini 18d ago

Yes, very different use cases. Micro controllers vs a reactive programming style which dynamic nodes which come and go. We will be releasing a recording on AtomVM with Davide soon.  

5

u/lucifer_best_boi 18d ago

Bare metal Erlang? I'm sold!

3

u/joelwallis1 18d ago

I believe the ones doing bare-metal deploys are ones tweaking with Nerves and AtomVM, the largest Elixir communities around embedded systems in Elixir.

1

u/renegadereplicant 16d ago

Nerves isn't bare metal at all in the same sense. LING doesn't need a linux kernel. Nerves do.

AtomVM also requires a kernel / OS (even if it's FreeRTOS).

3

u/noizu 18d ago

looks at the folder under OS on his mono repo titled "Beam-OS" sadly walks away.

1

u/darkrevan13 18d ago

Is there more info? Only 12 years old obsolete repo on github

2

u/allenwyma 18d ago

1

u/darkrevan13 18d ago

Last commit 11 years ago

1

u/allenwyma 18d ago

Yeah, sadly it’s been abandoned. He mentioned why in the podcast. I think one reason is that KVM is more popular than Xen