Gleam is a type‑safe language that targets both the Erlang virtual machine (BEAM) and JavaScript. Prior to version 1.19.0, the Gleam compiler produced human‑readable Erlang source code when targeting BEAM, which then had to be compiled again by the Erlang compiler into BEAM bytecode. The v1.19.0 release, announced on 5 October 2026, replaces that step so the Gleam compiler now emits Erlang abstract forms directly.
This shift yields two concrete benefits. First, by skipping the Erlang compiler’s initial tokenising and parsing stages, overall compilation speed increases, noticeably reducing build times for Gleam projects on BEAM. Second, the generated abstract forms preserve location metadata that maps directly to the original Gleam source, so BEAM crash reports and stacktraces show exact line numbers rather than approximating to the nearest function, improving debugging experience.
The Gleam team considered generating BEAM bytecode outright but rejected the idea because BEAM bytecode changes with each Erlang VM release, requiring ongoing maintenance to keep up with those changes and to reimplement decades of Erlang compiler optimisations. Targeting abstract forms provides a sustainable middle ground that captures most of the performance gain without that burden, a strategy already used by the sister language Elixir.