Gleam doesn't compile to Erlang source anymore

310 points · 134 comments on HN · read original →

Points and comments are a snapshot, not live.

Gleam v1.19.0 drops Erlang source output for abstract forms, improving compilation speed and stacktrace accuracy.

Gleam v1.19.0 replaces its Erlang source code generator with one that outputs Erlang abstract forms, an AST representation. This skips the front-half of the Erlang compiler, improving build times and making BEAM crash report line numbers match original Gleam source. Benchmarks show significant compilation speed gains. The JavaScript target also gets optimizations: flatter pattern-matching code and direct preprend-based list construction for short lists. New TypeScript API overloads preserve type parameters. Build tool commands gain features to support integration with Elixir's Mix and Erlang's rebar3.

What commenters are saying

Commenters largely congratulate the team. Several defend compiling to abstract forms rather than BEAM bytecode, noting Elixir and LFE also take this route for stability. One commenter questions why this wasn't done initially; the author explains the previous approach used printing algebra without an internal AST, and the Erlang abstract forms format wasn't established early on. A few joke about still calling it a "transpiler."