Episode Details

Back to Episodes
Inside the BEAM JIT: How Lukas Backström Made Erlang Faster

Inside the BEAM JIT: How Lukas Backström Made Erlang Faster

Season 1 Episode 19 Published 2 weeks ago
Description

In 2021, Erlang got something it had been promised for years: a Just-In-Time compiler. The person who built the first working prototype, spent years on failed experiments before it, and quietly shipped it to every Erlang and Elixir system on the planet is Lukas Backström — OTP team member since 2009, Francesco Cesarini's former student, and one of the most consequential engineers in the ecosystem that most people have never heard of.

In this episode, Alan Wyma and Francesco Cesarini sit down with Lucas for a deep dive into how the BEAM JIT actually works, what it took to get there, and where it's heading next.

Topics include:

  • the difference between interpreter, ahead-of-time compilation, and JIT — and why the BEAM's threaded code interpreter was already unusually fast

  • why tracing JITs — the first several approaches Lucas's team tried — worked great on microbenchmarks but failed on real Erlang code, which is highly branchy and unpredictable

  • the key insight that killed LLVM: faster code generation with AsmJIT was worth more than LLVM's optimizations, once you account for startup time

  • how the template JIT design — copy-pasting assembly from templates into memory, then specializing a few bits — became the architecture that shipped

  • why WhatsApp was running the JIT from the tip of master the day it was released, nine months before the official OTP 24 tag

  • how type-guided optimizations now flow from the Erlang compiler into the JIT — and why a simple integer add can now compile to a single assembly instruction

  • the Apple M1 announcement that changed the release timeline and forced ARM64 support a year ahead of schedule

  • what's actually left to do: smarter code loading, better startup time, and the native records implementation touching every layer of the system

  • why the BEAM JIT is one of the simpler JITs you could read — and how to inspect the assembly it generates for your own code

Recorded May 27, 2026.

Listen Now

Love PodBriefly?

If you like Podbriefly.com, please consider donating to support the ongoing development.

Support Us