AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Buying for a business?Offer from Amazon

Get business pricing on monitors, keyboards and dev gear

  • Business-only prices and quantity discounts
  • Tax-exempt purchasing
  • Multiple users, one account, clear invoices
As an affiliate, we earn on qualifying purchases.

Gleam 1.19.0 replaces generated Erlang source code with Erlang abstract forms, an intermediate representation consumed by the Erlang compiler. The project says the change improves Erlang-target build times and makes runtime line information more accurately reflect the original Gleam code; its published benchmark is a small, synthetic test rather than a measure of every project.

Gleam 1.19.0 no longer generates Erlang source code as the output of its Erlang code generator. The release, announced by the Gleam project, instead emits Erlang abstract forms—a structured representation that the Erlang compiler can consume directly—bringing reported build-time improvements and more accurate links between runtime errors and the original Gleam source.

The project says Giacomo Cavalieri rewrote the Erlang code generator over several months. Previously, Gleam generated Erlang source text, which then passed through the front portion of the Erlang compiler, including tokenisation and parsing. The new generator creates an annotated syntax tree in the format used internally by the Erlang compiler and serializes it using Erlang’s external term format. That lets Gleam load the generated code into the compiler without first processing generated Erlang text.

The change affects the Erlang compilation path, not the basic description of Gleam as a language that targets both the Erlang virtual machine and JavaScript. According to the release report, the earlier stage of the rewrite was released in Gleam 1.18.0; version 1.19.0 is the current release highlighted in the announcement. The project says the new generator also brings its implementation more in line with current codebase standards.

The announcement reports better compilation performance and more precise source-location metadata. Gleam says line numbers in BEAM crash reports and stack traces can now correspond accurately to the original Gleam code, rather than sometimes pointing only to the nearest function in generated Erlang. The project says the metadata may also make full Gleam support in debuggers such as edb possible, but it has not undertaken that debugger work.

At a glance
announcementWhen: Announced with Gleam v1.19.0; the code-…
The developmentGleam 1.19.0 introduces a rewritten Erlang code generator that emits abstract forms instead of Erlang source files.

Faster Builds, Clearer Crash Locations

For developers compiling Gleam applications to Erlang, the practical gains described are less time spent compiling and more useful information when a running program fails. More accurate source locations can make it easier to connect a BEAM runtime report to the code a developer wrote, rather than having to infer which part of the generated Erlang corresponds to the problem.

The change also illustrates a middle course between generating source text and writing a separate backend for BEAM bytecode. Abstract forms let Gleam bypass some Erlang compiler front-end work while still relying on the Erlang compiler for later stages. That reduces duplicated compiler work without requiring Gleam’s maintainers to track every change to the virtual machine’s bytecode format or recreate the Erlang compiler’s mature optimisations.

The performance evidence should be read narrowly. The report’s benchmark compiles 100 modules with 100 simple functions each, each returning a “hello world” string, and compares Gleam 1.17.0 with 1.19.0 in a full build without caching. The project describes the improvement as considerable, but the test does not establish how much faster every real project will build. Gleam compilation is incremental, so ordinary development builds may also compile less than the benchmark’s from-scratch run.

Amazon

Erlang abstract forms developer tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Why Gleam Uses Abstract Forms

Erlang abstract forms are a representation of program syntax used by the Erlang compiler. Ordinarily, Erlang source text is tokenised and parsed to create that representation. Gleam’s new generator creates the representation itself, with metadata, then passes its binary encoding to the compiler. In practical terms, the project has changed the format at the compiler boundary: Gleam still uses the Erlang compiler, but no longer needs to produce Erlang source as an intermediate file for that path.

The project considered whether it should go further and generate BEAM bytecode directly. Its report says that would mean maintaining compatibility with bytecode changes across virtual-machine releases and reproducing work already built into the Erlang compiler. Gleam is a community project funded through sponsorship, the report says, so its maintainers weighed the long-term engineering burden against the possible benefits. They describe abstract forms as the current balance between performance and sustainable maintenance.

For its speed comparison, the report uses a benchmark based on José Valim’s langcompilebench. The project expanded the comparison to include other languages and Gleam’s JavaScript target, but cautions that the test covers only a small set of simple program features. Its results are an introductory comparison, not a general ranking of how quickly the languages compile varied production code.

““Compiling to Erlang abstract forms is the cost-benefit sweet-spot for Gleam today.””

— The Gleam project

Amazon

Gleam programming language books

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Limits of the Performance Evidence

The release report gives no single build-time figure in its accompanying text, and its chart uses a narrow synthetic project. It does not quantify expected gains across different application sizes, code patterns, machines or dependency configurations. The reported improvement should not be treated as a guaranteed speedup for every Gleam project.

It is also unclear when, or whether, the improved metadata will lead to full Gleam support in edb or other debuggers. The project says the metadata could enable that work but has not done it itself. The announcement does not provide a separate timetable for debugger integration or describe a direct bytecode backend as planned work.

Amazon

Erlang debugging tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Adoption and Debugger Support

The new generator is part of Gleam 1.19.0, so developers can assess it through the released compiler and its Erlang-target builds. The next useful evidence will come from use in varied projects, where compilation time and the source locations shown in runtime reports can be compared with the project’s stated benefits.

Debugger support remains a possible follow-on rather than a delivered feature: Gleam says its metadata could help debuggers such as edb understand Gleam source, but it has not committed to or announced a schedule for that work. The project’s stated rationale also leaves the Erlang compiler in the pipeline, with direct BEAM bytecode generation not selected as the current approach.

Amazon

BEAM virtual machine development kit

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Does Gleam still use the Erlang compiler?

Yes. Gleam still feeds code to the Erlang compiler, but its Erlang code generator now supplies abstract forms rather than generated Erlang source text.

What are Erlang abstract forms?

They are an annotated tree representation of Erlang syntax used by the Erlang compiler. Gleam’s new generator creates this representation directly, skipping the compiler’s initial processing of Erlang source text.

Does the release make every Gleam build faster?

The project reports faster Erlang-target compilation in its benchmark, but that test uses a small, repetitive program and a full uncached build. The results do not establish a speedup for every project; real results depend on the project and build conditions.

Does Gleam 1.19 generate BEAM bytecode directly?

No. The new output is Erlang abstract forms, which are still passed to the Erlang compiler. The project says maintaining a direct bytecode generator would add substantial ongoing compatibility and optimisation work.

Is debugger support included in the release?

The project says the improved location metadata could enable fuller Gleam support in debuggers such as edb, but it has not done that work. No debugger-support schedule is given in the announcement.

Source: hn

FALL

Fall Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

We Want You To Build The Next Git Platform On Cloudflare

Cloudflare is running a competition for developers to build agent-focused Git platforms using its Artifacts repository service and Workers.

How To Speed Up The Rust Compiler In September 2026

Rust compiler performance work cut mean benchmark wall time 4.57% from July 29 to Sept. 28, according to compiler contributor Nicholas Nethercote.

Why Don’t More Developers “Use The Platform”?

A commentary examines why developers reach for libraries or custom code instead of browser features, including history, familiarity and learning.

Gewerkton’s Two-Day Design Sprint: Rebuilding A Brand Look With AI

Gewerkton says AI coding agents implemented its HORIZON redesign across apps and a 529-page site, with human approvals and fixes.