Navigation
Recherche
|
Gleam 1.10 improves compiler, JavaScript codegen
jeudi 17 avril 2025, 00:51 , par InfoWorld
Gleam 1.10, a new release of the type-safe programming language for the Erlang virtual machine and JavaScript runtimes, is now available. The update features compiler improvements centering on holding more information and improving exhaustive analysis. Faster execution of JavaScript code also is highlighted.
Gleam 1.10 was introduced April 14; it is accessible on GitHub. The compiler in this release retains more information about types and values and how they reference each other in Gleam programs, according to a blog posted by Gleam creator Louis Pilfold. This enables the language server included in the Gleam binary to provide a “find references” feature that enables developers to find where a type or value is used in a project. Also, the additional information has been used to improve the “rename” language server feature. Prior to this, only module-local types and values could be renamed. With the improvement, renaming can be performed across all project modules. Gleam’s builders also have improved the compiler’s unused-code detection, repairing some situations in which the compiler would fail in detecting all of the unused code. Gleam 1.10 also improves the Gleam compiler’s exhaustiveness analysis with the inclusion of string pattern analysis. Previously, only rudimentary analysis was performed on strings, and unreachable strings could not be detected. Exhaustiveness analysis ensures that all possible variants of a value are handled in flow control and that there are no redundant cases that are not reachable due to previous cases. The compiler also now emits a warning when using let assert to assert a value whose variant already has been inferred. Gleam 1.10 also features operator analysis improvements. The Gleam compiler is fault-tolerant; this means that when an error is found in code, the compiler does not stop immediately but shows the error to the programmer and makes a best effort to recover and continue analyzing the remaining code. Analysis of binary operators such as + and == has been improved so both sides will be checked even in the presence of errors. This can improve language server information and enables improved error messages. Gleam 1.10 follows the March 8 release of Gleam 1.9, which offered improvements such as more powerful bit arrays on JavaScript. Other new features in Gleam 1.10: JavaScript code generation has been improved to make the code run faster. Where possible, the compiler restructures code to no longer use JavaScript “immediately invoked function expressions,” which removes the overhead of allocating and then calling these functions. With bit array improvements, developers now can omit the:float option when used with float literals, as the intention is unambiguous. The new gleam export package-information command will write information about a Gleam package to a file in JSON format. The language server now can offer a code action to replace a.. in a pattern with all the fields that it was being used to ignore. For security and compliance, Gleam’s container images now feature a software bill of materials (SBoM) and supply-chain levels for software artifacts (SLSA) provenance information. This will help with security audits and compliance of software written with Gleam. It is part of an effort to evidence production readiness and promote Gleam adoption within enterprise.
https://www.infoworld.com/article/3964126/gleam-1-10-improves-compiler-javascript-codegen.html
Voir aussi |
56 sources (32 en français)
Date Actuelle
sam. 19 avril - 15:44 CEST
|