首页›Gleam News›文章

Gleam doesn't compile to Erlang source anymore

Louis Pilfold · 2026年10月5日

AI 摘要 AI 生成,可能有误

Gleam v1.19.0 采用重写的 Erlang 代码生成器,现在编译为 Erlang 抽象形式(abstract forms)而非 Erlang 源代码,显著缩短了构建时间,并使栈跟踪行号等运行时元数据能够准确引用原始的 Gleam 源代码。此版本还带来了 JavaScript 编译方面的改进(更扁平的决策树和更快的短列表字面量)、可保留类型信息的 TypeScript API 重载,以及对 Elixir 的 Mix 和 Erlang 的 rebar3 等外部构建工具更好的支持。其他更新包括语言服务器对标签(label)的支持(跳转到定义、查找引用、重命名),以及通过 WebAssembly 编译器构建版本在浏览器中格式化 Gleam 代码的功能。

Gleam is a type-safe and scalable language for the Erlang virtual machine and JavaScript runtimes. Today Gleam 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 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.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Gleam News

Gleam Gathering 2027 is coming to London!

AI 摘要Gleam Gathering 2027 is coming to London, with tickets already available and the call for talks now open. The article celebrates the success of the first-ever 100% Gleam conference in Bristol earlier this year, whose 2026 talks have all been released online. Community members are encouraged to submit talk proposals if they have interesting Gleam projects, learnings, libraries, tools, or topics worth sharing.

Help from the Github Security Lab

AI 摘要The Gleam project participated in the 4th GitHub Secure Open Source Fund, which provided a 3-week security training program, a 12-month engagement, and $10,000 in sponsorship, and it turned out the project was already in an excellent security position with no vulnerabilities uncovered. Key takeaways include the value of expert guidance in converting security unknowns into knowns, the importance of evidencing security through policies, documentation, and compliance frameworks rather than just being technically secure, and the striking cost-effectiveness of investing in open source security across the fund's 50 projects.

A field day for Gleam’s language server

AI 摘要Gleam v1.18.0 has been released, bringing major language server improvements such as go-to-definition, find-references, and rename support for record fields, type variable and module renaming with automatic import updates, plus new code actions for pattern matching on values, converting integer bases, generating missing types, and converting comments. The release also delivers performance gains through data singletons that speed up generated JavaScript and compiler memory arenas that make the formatter up to 13% faster, alongside deprecation of ambiguous pipe syntax, git dependency path support, and various Hex package manager improvements.

Single file Gleam BEAM programs with escript

AI 摘要Gleam v1.17.0 has been released, introducing the `gleam export escript` command for bundling BEAM projects into single executable files, alongside JavaScript pattern matching optimisations and various language server improvements such as document highlighting, context-aware type printing, and new code actions. The release also includes build tool enhancements like a quiet development mode, an outdated dependencies summary in `gleam deps outdated`, better Git repository detection for monorepos, and support for `todo` in constant expressions. Additionally, the first videos from the all-Gleam Gleam Gathering conference have been published on YouTube.

JavaScript source maps

AI 摘要Gleam v1.16.0 has been released, introducing JavaScript source maps that enable runtime debugging with proper stack traces and breakpoints, along with package-level fault tolerance so compilation continues past broken modules. The release also brings faster string pattern matching on the JavaScript target (nearly 30% faster for some packages), new compiler warnings and error messages, and multiple language server improvements such as code actions for anonymous functions, function extraction, and type hole replacement.