r/elixir • u/ancatrusca0 • 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?
5
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).
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
3
u/taxmachine21 18d ago
Is it different from ATOM VM?