Skip to main content

Gleam 1.19.2

Release Date: October 12, 2026

Gleam 1.19.2 was released on October 12, 2026. It is the second patch on the 1.19 line and contains two bug fixes. This page documents the patch contents, the preceding 1.19.1 release, and the substantive changes introduced in 1.19.0 on October 5, 2026.

Overview

Release date: October 12, 2026. Version: 1.19.2. Scope: bug fixes only. No language changes, no new syntax, no deprecations. 1.19.1 preceded it on October 7, 2026 with a single fix.

Fixes in 1.19.2

  • The build tool did not reject invalid application names when one was returned by the Hex API. It now does. Reported and fixed by Louis Pilfold.
  • The compiler could generate invalid Erlang code for user defined types, which caused external tooling such as Dialyzer to crash. Fixed by Giacomo Cavalieri.

The second item is the one that matters in practice. Type definitions reaching Dialyzer in a malformed form produced failures in downstream analysis rather than in the Gleam compiler, which made the source of the problem hard to isolate.

Fixes in 1.19.1

  • The export javascript-prelude and export typescript-prelude commands would not run. Fixed by Louis Pilfold.

Both commands were extended in 1.19.0 to write their output to a file. The command wiring broke in the process and was restored four days later.

Changes in 1.19.0

The 1.19.0 release, announced as "Gleam doesn't compile to Erlang source anymore", replaced the Erlang code generator. Giacomo Cavalieri rewrote it to emit Erlang abstract forms, the metadata-annotated intermediate representation normally produced by Erlang's tokeniser and parser, instead of Erlang source text. With the binary encoding of that format, generated code loads directly and skips the front half of the Erlang compiler.

Three consequences follow. Build times for Gleam projects targeting Erlang are reduced, since the compiler no longer emits and re-parses source. Location metadata now refers to the original Gleam source rather than generated Erlang, so line numbers in BEAM crash reports and stack traces are accurate instead of pointing at the nearest function. And the code generator itself is now written to current conventions rather than carrying the oldest surviving design in the compiler.

The team also explained why it stopped short of emitting BEAM bytecode. Bytecode is not a stable interface; it evolves with each virtual machine release, and reproducing decades of Erlang compiler optimisations is not a reasonable commitment for a community-funded project. Erlang abstract forms are the same route Elixir takes.

JavaScript output received separate attention:

  • Pattern matching now compiles to flatter JavaScript. John Downey changed the divide-and-conquer branch generation so that nested if statements collapse into a single condition where possible, with fewer intermediate variables. Bundled size is largely unchanged after minification and gzip, but there are fewer branches for the engine to optimise.
  • Short list literals no longer round-trip through an array. Literals within the short threshold compile to direct prepend chains instead of an array plus conversion, which helps code that builds many small lists. Longer lists keep the array approach.
  • TypeScript declarations for generated variant check functions gained overloads. A function such as Box$isFull previously generalised its type parameter to unknown, discarding information. It now carries an overload that preserves the parameter when the input type is known, falling back to the general signature otherwise.

For build tools other than the official one, several improvements landed with the intent of enabling Gleam support in Mix and rebar3. The gleam executable now generates the .app resource files that the virtual machine requires, so supporting build tools no longer have to produce them. compile-package accepts --no-dev to load only src and skip dev dependencies. The export package-information and export package-interface commands can print to stdout, and export javascript-prelude and export typescript-prelude can write to a file. These changes were contributed by Rodrigo Álvarez.

Upgrade

Install 1.19.2 through your usual channel: asdf, mise, Homebrew, or a prebuilt binary from the release page. Projects already on 1.19.0 or 1.19.1 need no source changes. Projects on 1.18.x should build once and check any assumptions about stack trace line numbers, since the mapping is now accurate and previously offset.

Dialyzer users on 1.19.0 or 1.19.1 should upgrade to 1.19.2 before filing issues against analysis output.

Other Versions

We use cookies for ads and analytics.