hn.today

Gleam doesn't compile to Erlang source anymore

gleam.run10 points0 comments
Screenshot of Gleam doesn't compile to Erlang source anymore

Gleam v1.19.0 (released 05 October 2026) replaces its Erlang code generator so it emits Erlang abstract forms instead of human-readable Erlang source. That intermediate representation is fed directly to the Erlang compiler, skipping tokenisation and parsing, which yields much faster full builds, more accurate source-location metadata in BEAM crash reports/stack traces, and cleaner compiler code. Benchmarks based on José Valim’s langcompilebench show a substantial compile-time improvement over v1.17.0, and comparisons against several other languages suggest Gleam compiles competitively fast. The team - led by contributors including Giacomo Cavalieri - explains why targeting BEAM bytecode directly is impractical given changing bytecode formats, existing Erlang compiler optimisations, and limited project resources, so abstract forms are the pragmatic long-term choice (as used by Elixir).

The release also ships JavaScript backend improvements: pattern-match decision trees are flattened into simpler combined conditions for fewer branches, and short list literals now compile to direct persistent-list constructors rather than array conversions, improving runtime performance for common cases. TypeScript declarations for variant-checking functions gain overloads to preserve type information. Build-tool integrations were enhanced: Gleam can generate .app resource files, added a no-dev compile flag, and export commands can write to stdout or files - facilitating use from Mix/rebar3 and other ecosystems.

Read on gleam.run0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Worth Building

Worth Building

Building tools without the need to monetize allows for more personal, enjoyable, and quick development of useful applications. This shift enables more people to create small, polished tools for their own needs or ideas, regardless of broader market appeal. (armstr.ng)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.