<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/gleam-doesn-t-compile-to-erlang-source-anymore-ljfylvksh" -->

---
title: Gleam doesn't compile to Erlang source anymore | daily.dev
description: Gleam v1.19.0 ships a rewritten Erlang code generator that now outputs Erlang abstract forms instead of Erlang source code, skipping the front half of the...
canonical: https://daily.dev/posts/gleam-doesn-t-compile-to-erlang-source-anymore-ljfylvksh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Gleam doesn't compile to Erlang source anymore | daily.dev
og:description: Gleam v1.19.0 ships a rewritten Erlang code generator that now outputs Erlang abstract forms instead of Erlang source code, skipping the front half of the...
og:url: https://daily.dev/posts/gleam-doesn-t-compile-to-erlang-source-anymore-ljfylvksh
og:image: https://api.daily.dev/og/posts/ljFyLVKSh.png
og:image:alt: Gleam doesn't compile to Erlang source anymore
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Gleam doesn't compile to Erlang source anymore

**[Gleam](https://daily.dev/sources/gleam)** · 17 min read · 2 upvotes · 0 comments

## Summary

Gleam v1.19.0 ships a rewritten Erlang code generator that now outputs Erlang abstract forms instead of Erlang source code, skipping the front half of the Erlang compiler. This improves compile times, gives accurate line numbers in BEAM stacktraces, and raises internal code quality. The release also brings JavaScript output optimizations (flatter decision trees, direct list literal construction for short lists), improved TypeScript declaration overloads for generated type guards, better build-tool integration commands aimed at Elixir's Mix and Erlang's rebar3, language server label support (go-to-definition, find-references, renaming), WebAssembly-based code formatting for the browser, and several improved compiler error messages.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://gleam.run/news/gleam-doesnt-compile-to-erlang-source-anymore>

## Questions this post answers

### What changed in how Gleam compiles to Erlang in version 1.19.0?

Gleam 1.19.0 no longer generates Erlang source code; it now generates Erlang abstract forms, a binary intermediate representation normally produced by Erlang's tokenizer and parser. This lets Gleam skip the front half of the Erlang compiler, improving build performance and making stacktrace line numbers point exactly to the original Gleam source instead of to generated Erlang code.

_Track BEAM-ecosystem compiler changes like this on daily.dev before they affect your Gleam build pipeline._

### Why doesn't Gleam compile directly to BEAM bytecode instead of using Erlang abstract forms?

BEAM bytecode changes with every VM release, adding or removing functionality, so targeting it directly would require Gleam's small, sponsor-funded team to continuously track Erlang VM changes and reimplement decades of Erlang compiler optimizations. Compiling to Erlang abstract forms, the same approach Elixir uses, is considered the more sustainable cost-benefit choice for a community project with limited resources.

_Developers evaluating language runtime trade-offs can follow this kind of architecture reasoning on daily.dev._

### How did Gleam optimize JavaScript output for short list literals in version 1.19.0?

Starting in Gleam 1.19.0, short list literals compiled to JavaScript generate direct nested prepend calls, such as prepend(1, prepend(2, prepend(3, empty))), instead of building a JavaScript array and converting it with arrayToList. This improves runtime performance in modern JS engines, especially for projects using many short lists like those built with the Lustre library, though no improvement was observed for longer lists.

_Keep up with JavaScript-target compiler optimizations like this on daily.dev when tuning Gleam-to-JS performance._

## Similar posts on daily.dev

- [Single file Gleam BEAM programs with escript](https://daily.dev/posts/single-file-gleam-beam-programs-with-escript-hqjxh2jmz) · Gleam · 3 upvotes · 0 comments
- [Gleam update shines on external types](https://daily.dev/posts/gleam-update-shines-on-external-types-mtgm30k2o) · InfoWorld · 0 upvotes · 0 comments
- [JavaScript source maps](https://daily.dev/posts/javascript-source-maps-fx5gq2l1b) · Gleam · 6 upvotes · 0 comments
- [Elixir v1.19.2 released](https://daily.dev/posts/elixir-v1-19-2-released-vxkzbrjy0) · Elixir Forum · 7 upvotes · 0 comments
- [Elixir v1.19 released: enhanced type checking, broader type inference, and up to 4x faster compilation for large projects](https://daily.dev/posts/elixir-v1-19-released-enhanced-type-checking-broader-type-inference-and-up-to-4x-faster-compilati-rc2s8j4bd) · Elixir · 22 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#compiler](https://daily.dev/tags/compiler), [#erlang](https://daily.dev/tags/erlang), [#gleam](https://daily.dev/tags/gleam)

[View this post on daily.dev](https://daily.dev/posts/gleam-doesn-t-compile-to-erlang-source-anymore-ljfylvksh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Gleam doesn't compile to Erlang source anymore","url":"https://daily.dev/posts/gleam-doesn-t-compile-to-erlang-source-anymore-ljfylvksh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/gleam-doesn-t-compile-to-erlang-source-anymore-ljfylvksh"},"datePublished":"2026-10-05T17:13:34.600Z","dateModified":"2026-10-05T17:13:57.583Z","description":"Gleam v1.19.0 ships a rewritten Erlang code generator that now outputs Erlang abstract forms instead of Erlang source code, skipping the front half of the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6fe056a8cc4799da1293bfe9e117f3f8?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6fe056a8cc4799da1293bfe9e117f3f8?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Gleam","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Gleam","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/13aabbd66eb74f4b9dba15b15e80e16e","url":"https://daily.dev/sources/gleam"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/gleam-doesn-t-compile-to-erlang-source-anymore-ljfylvksh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,compiler,erlang,gleam","timeRequired":"PT17M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Gleam","item":"https://daily.dev/sources/gleam"},{"@type":"ListItem","position":3,"name":"Gleam doesn't compile to Erlang source anymore"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/gleam-doesn-t-compile-to-erlang-source-anymore-ljfylvksh#faq","mainEntity":[{"@type":"Question","name":"What changed in how Gleam compiles to Erlang in version 1.19.0?","acceptedAnswer":{"@type":"Answer","text":"Gleam 1.19.0 no longer generates Erlang source code; it now generates Erlang abstract forms, a binary intermediate representation normally produced by Erlang's tokenizer and parser. This lets Gleam skip the front half of the Erlang compiler, improving build performance and making stacktrace line numbers point exactly to the original Gleam source instead of to generated Erlang code. Track BEAM-ecosystem compiler changes like this on daily.dev before they affect your Gleam build pipeline."}},{"@type":"Question","name":"Why doesn't Gleam compile directly to BEAM bytecode instead of using Erlang abstract forms?","acceptedAnswer":{"@type":"Answer","text":"BEAM bytecode changes with every VM release, adding or removing functionality, so targeting it directly would require Gleam's small, sponsor-funded team to continuously track Erlang VM changes and reimplement decades of Erlang compiler optimizations. Compiling to Erlang abstract forms, the same approach Elixir uses, is considered the more sustainable cost-benefit choice for a community project with limited resources. Developers evaluating language runtime trade-offs can follow this kind of architecture reasoning on daily.dev."}},{"@type":"Question","name":"How did Gleam optimize JavaScript output for short list literals in version 1.19.0?","acceptedAnswer":{"@type":"Answer","text":"Starting in Gleam 1.19.0, short list literals compiled to JavaScript generate direct nested prepend calls, such as prepend(1, prepend(2, prepend(3, empty))), instead of building a JavaScript array and converting it with arrayToList. This improves runtime performance in modern JS engines, especially for projects using many short lists like those built with the Lustre library, though no improvement was observed for longer lists. Keep up with JavaScript-target compiler optimizations like this on daily.dev when tuning Gleam-to-JS performance."}}]}
```

