ancatrusca

ancatrusca

BEAM There, Done That with Lukas Backström on Building the BEAM JIT

Sharing a recent BEAM There, Done That episode that covers the BEAM JIT in more technical depth than I’ve seen elsewhere. Lukas Backström, the OTP engineer who built it, walks through the full story from the first experiments to the current state.

A few things worth knowing for the Elixir side of the community:

The JIT benefits Elixir code directly - all BEAM code goes through the same JIT regardless of which language produced the bytecode. The optimizations are at the level of BEAM instructions, not language-specific constructs.

The current frontier is type-guided optimization. The Erlang compiler has become significantly smarter at type analysis, and that type information is embedded as metadata in compiled BEAM files. The JIT reads it at load time and can eliminate type guard checks when types are already proven. A simple integer addition on known small integers now compiles to a single assembly instruction rather than a sequence that checks types, handles big integers, and so on. This benefits code that’s type-annotated or has types that are inferable - which increasingly includes Elixir code as the type system work from the previous episode matures.

Lucas also notes that the JIT is genuinely readable. You can dump the assembly it generates for any module and the template-based design makes the translation from BEAM bytecode to native code relatively easy to follow. The native records implementation (currently in progress) is the best current example of how changes propagate through every layer: compiler, loader, JIT, runtime.

Where Next?

Popular in Podcasts Top

brainlid
Episode 137 of Thinking Elixir. After covering the week’s news, we talk about upgrading our apps to Phoenix 1.7.0 and what the experience...
New
brainlid
In episode 71 of Thinking Elixir, we catch up with German Velasco then talk about the 7-GUI Tasks online challenge and how he wanted to s...
New
brainlid
Episode 185 of Thinking Elixir. Dive into the world of structured LLM prompting with our latest guest who shares insights on their innova...
New
brainlid
In episode 67 of Thinking Elixir, we talk about ways we can all contribute to building a healthy Elixir community. The Elixir community i...
New
brainlid
In episode 56 of Thinking Elixir, Kurt Mackey, founder at Fly.io talks about what makes the Fly platform unique and why hosting Elixir ap...
New
wolf4earth
Tej Pochiraju joins the mix to discuss Progressive Web Apps and how you can support them using Elixir and Phoenix to control IoT devices....
New
brainlid
In episode 95 of Thinking Elixir, we talk with Philip Sampaio to understand the Rustler Precompiled project he created and what problem i...
New
brainlid
In episode 98 of Thinking Elixir, Dominic Letz did something I thought was impossible. He got an Elixir application packaged up, approved...
New
thiagomajesk
I saw this podcast episode on my Twitter timeline today and wanted to share it with you. I found a lot of valuable lessons packed in a 27...
New
brainlid
AI topics are all the rage right now, so we team up with Sean Moriarity to unpack what’s going on and what it means for Elixir. Sean talk...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement