Gleam编程语言发布了v1.19.0版本,其中最重要的变化是Erlang代码生成器的完全重写1。该版本不再生成Erlang源代码,而是直接输出Erlang抽象形式作为中间表示1。这一架构调整显著提升了编译性能,对标准基准测试项目的编译时间从v1.17.0到v1.19.0实现了显著改善1。此外,BEAM崩溃报告和堆栈跟踪中的行号现在准确对应Gleam源代码而非生成的Erlang代码1,改进了运行时元数据的准确性。
本次发布还包含多项其他功能优化1。JavaScript编译器采用了新的模式匹配决策树优化,将嵌套if语句合并为单一条件并减少中间变量1;短列表字面量不再使用array-to-list转换,改用prepend函数直接构造1。TypeScript API重载得以改进,类型参数在类型检查函数中得以保留1。Gleam编译器现在能为Mix和rebar3等其他构建工具生成.app资源文件1。语言服务器添加了标签的完整支持,包括go-to-definition、find-references和重命名功能1。WebAssembly编译器新增了format_source函数,支持在浏览器内进行代码格式化1。
Gleam programming language has released version 1.19.0 with a major overhaul of its Erlang code generation system 1. The most significant change is that the compiler now generates Erlang abstract forms, an intermediate representation, rather than producing Erlang source code directly 1. This architectural shift delivers substantial improvements in compilation performance, with benchmark tests showing marked speedup from version 1.17.0 to 1.19.0 1.
Beyond the backend restructuring, the update addresses runtime reliability and developer experience. BEAM crash reports and stack traces now display line numbers that accurately correspond to Gleam source code instead of generated Erlang code, eliminating confusion when debugging intermediate artifacts 1. The JavaScript compiler has received optimization work as well, including collapsing nested if statements in pattern-matching decision trees into single conditions and reducing intermediate variables, while short list literals now use prepend functions for direct construction rather than array-to-list conversion 1.
The release further enhances tooling and language features across multiple fronts 1. The Gleam compiler now generates .app resource files for build tools like Mix and rebar3, the language server adds comprehensive label support including go-to-definition, find-references, and rename operations, TypeScript API overloads now preserve type parameters during type checking, and the WebAssembly compiler includes a new format_source function enabling in-browser code formatting 1.
评论
还没有评论,欢迎留下第一条。