Gleam doesn't compile to Erlang source anymore Gleam v1.19.0 was released with a rewritten Erlang code generator by Giacomo Cavalieri that outputs Erlang abstract forms instead of Erlang source code, letting the compiler load generated code directly and skip the front half of the Erlang compiler. The change improves compiler performance and build times for Gleam projects on Erlang and makes runtime location metadata accurate to original Gleam source, so line numbers in BEAM crash reports and stacktraces are precise. The rewrite's first stage shipped in v1.18.0, and the project's langcompilebench comparison of v1.17.0 to v1.19.0 shows a considerable improvement on a full build from scratch. Gleam is a type-safe and scalable language for the Erlang virtual machine and JavaScript runtimes. Today Gleam v1.19.0 https://github.com/gleam-lang/gleam/releases/tag/v1.19.0 has been published, so let's go over what's new. A new compilation target Over the last few months Giacomo Cavalieri https://github.com/giacomocavalieri has entirely rewritten Gleam's Erlang code generator that has an entirely different design, and most notably, outputs a different format. Previously Gleam generated Erlang source code, now it generates Erlang abstract forms https://www.erlang.org/doc/apps/erts/absform.html . "Erlang abstract forms" is an intermediate representation used by the Erlang compiler. It is a metadata-annotated tree that represents Erlang syntax, and it is normally produced by running Erlang's tokeniser and parser. It has a binary encoding using Erlang's external term format https://www.erlang.org/doc/apps/erts/erl ext dist.html , and with this binary format we can load our generated code directly, skipping the front-half of the Erlang compiler. This new Erlang code generator brings several benefits: - The performance of the compiler has been improved, significantly reducing the build times for Gleam projects running on Erlang. - The location metadata available to the runtime is now accurate to original Gleam source code, rather than to the Erlang source code the compiler would generate. This means, for example, the line numbers in BEAM crash reports and stacktraces are perfectly accurate, while previously they could be inaccurate, only pointing to the nearest function. This metadata could also enable full support for Gleam in debuggers such as edb https://github.com/WhatsApp/edb , though we have not done any work on this ourselves. - The code-quality of the Gleam compiler has been improved. The Erlang code generator was one of the oldest and most stable parts of the Gleam codebase, so while it wasn't causing us any problems it wasn't conforming to the standards and conventions we have today. This new replacement is excellent, and arguably raising the bar for the compiler as whole. - We never have to hear someone use the word "transpiler" as a pejorative ever again.