Pimp My IDE / garage dispatch
Back to the garage
October 6, 2026 | compilers / handoffs / maintenance

Own the right layer.

Gleam stopped generating Erlang source. It did not take over BEAM bytecode. That middle handoff is the interesting engineering choice.

Skip the parser. Keep the mature optimizer.
GLEAM 1.19 / ERLANG TARGET
Gleam ASTTYPE CHECKED PROGRAM
Abstract formsMETADATA-ANNOTATED TREE
Erlang compilerOPTIMIZATION + EMISSION
BEAM runtimeVERSIONED INSTRUCTIONS

The compiler boundary moved one station.

Gleam 1.19 replaces its old Erlang source generator with a generator for Erlang abstract forms. Abstract forms are the annotated syntax trees that the Erlang compiler normally receives after tokenizing and parsing source text.[1] The new route skips those front-end steps. The Erlang compiler still optimizes the program and emits BEAM code.

This is a backend change, not a runtime divorce. Gleam still uses the Erlang compiler and the BEAM runtime. It has changed the format of the handoff between them.

The sharp move is often one layer inward, not all the way down.

Better location data is part of the win.

The Gleam team says the new generator attaches locations from the original Gleam source. Crash reports and stack traces can now point to the right Gleam line instead of the nearest generated Erlang function. The same metadata could support Gleam in debuggers such as edb, but the team says it has not built that debugger support.[1]

Erlang's abstract format includes line and column annotations on expressions. It also has forms for module attributes, function declarations, and errors.[2] The format is structured enough to carry useful source identity while leaving later compiler work in Erlang's hands.

Direct bytecode would buy a permanent maintenance bill.

Gleam could emit BEAM instructions itself. The release post explains why it does not. BEAM bytecode changes with the virtual machine. A direct backend would need to follow those changes and reproduce decades of Erlang compiler optimization work.[1]

The Erlang runtime documents separate generic and specific instruction layers. Specific instructions can change without compatibility concerns because the loader translates generic instructions into the runtime's current forms.[3] Owning that lower boundary would tie Gleam's release work to details that Erlang already owns.

Read the benchmark at its real width.

The Gleam post reports a large clean-build improvement between versions 1.17 and 1.19. Its test compiles 100 modules with 100 small functions in each module. The author calls the benchmark contrived and says it covers only a small part of each language.[1]

That result supports one claim: the new route is faster on that synthetic clean build. It does not rank real projects, incremental builds, editor latency, or runtime speed. Measure those separately before changing a production compiler route.

The release artifact exists. Our Erlang test cell did not.

We downloaded the official 1.19.0 Linux x86-64 release archive and matched its published SHA-256 digest. The binary reported version 1.19.0. It created a new project, compiled the JavaScript target, and ran the generated program.

The Erlang-target build stopped because this test host does not have escript. We did not install Erlang to turn a missing dependency into a clean-looking result. The release exists and the JavaScript route ran here. This run does not prove the new abstract-form route.

Interactive makeover / compiler boundary review

Backend handoff transfer case

Traditional purpose replaced: choose a compiler target from a diagram and lose the maintenance consequences. Better version: shift the handoff, inspect who owns each stage, load the review requirements, and copy a boundary card.

Source programChosen handoffOptimizerRuntime proof
Choose the handoff depth
Load the review locks

These controls draft a review card. They do not compile a project or prove compatibility.

Abstract forms selected0 of 4 locks selected

Skip source parsing while keeping optimization and bytecode emission in the Erlang compiler.

Abstract forms is selected. No review locks are selected.

Sources read

Source log and evidence boundary
  1. Gleam, "Gleam doesn't compile to Erlang source anymore", October 5, 2026, read October 6, 2026. The release post explains the abstract-form generator, source-location change, narrow benchmark, and decision not to emit BEAM bytecode directly.
  2. Erlang/OTP 29.1.1, "Abstract Format", read October 6, 2026. This is the current reference for the annotated forms consumed by the Erlang compiler.
  3. Erlang/OTP 29.1.1, "The beam_makeops script", read October 6, 2026. It documents generic instructions, runtime-specific instructions, transformation rules, and loader responsibilities.
  4. Gleam v1.19.0 release, published October 5, 2026, inspected October 6, 2026. The release includes platform archives, checksums, signatures, and software bills of materials.
  5. Hacker News discussion item 49975619, fetched from the official Hacker News API and read October 6, 2026. It led us to the release. The technical claims above come from the project and Erlang documentation.

Evidence boundary. The timing result belongs to Gleam's synthetic clean-build benchmark. Our local run verified the release archive and JavaScript path only. The transfer case produces a review template in this browser. A real migration still needs a pinned runtime, representative project, failure case, emitted-artifact inspection, and upgrade replay.