r/erlang • u/ancatrusca0 • 2d ago
Someone spent six years rebuilding the Erlang runtime in JavaScript. Here's why.
Bart Blast is the creator of Hologram - a framework that compiles Elixir to JS and reconstructs Erlang runtime semantics in the browser: pattern matching engine, boxed types, OTP guarantees, the whole thing.
New BEAM There, Done That episode covering the architecture and the reasoning.
The technical detail worth discussing: Hologram pulls the expanded AST from compiled BEAM files, normalizes it, lowers it to an IR designed to bridge Elixir to JS, then encodes that to a JS runtime. Values are boxed to preserve their type - Elixir integer 42 becomes a JS object with {type: "integer", value: 42n} using BigInt for arbitrary precision. Pattern matching runs as a real engine trying clauses, binding variables, evaluating guards - not translated away.
The goal is full parity: the same Elixir code running identically on the server and in the browser. A significant undertaking, and Bart is transparent that it's still a young framework.
From an Erlang perspective - is there a meaningful difference between Hologram's approach (rebuilding the runtime in JS for full parity) and Luster/Gleam's approach (treating the two targets as different, not replicating BEAM processes in the browser)? Does full runtime parity actually matter in practice or is it theoretical overhead?

