Navigation
Recherche
|
Gleam 1.7 brings faster record updates
mardi 7 janvier 2025, 22:47 , par InfoWorld
Gleam 1.7 has arrived with faster record updates and a dynamic coder for a custom type. Overall, the latest version of Gleam touts performance and package publishing improvements.
This latest update to Gleam was announced January 5 and is accessible from GitHub. Created by developer Louis Pilfold, Gleam is described as a type-safe and scalable language for the Erlang virtual machine and JavaScript runtimes. For faster record updates, the Gleam compiler now “monomorphises” record updates, meaning it generates the most-efficient code to construct the new record on a case-by-case basis, removing the runtime conditional logic and its associated cost entirely. The optimization is for both the Erlang and JavaScript targets. Another benefit of record update monomorphisation is that developers can change parameterized types of a generic record with the update syntax. Also new in Gleam 1.7, the Gleam language server now includes a code action to generate a dynamic decoder for a custom type. This new feature addresses a drawback of Gleam’s sound type system, whereby converting untyped input from the outside world into data of known types requires additional code that would not be required in unsound systems. This decoder code can be unfamiliar and confusing, Pilfold said, and in simple cases it can seem a chore. The code action streamlines this task. Other features of Gleam 1.7 include the following: More secure credential handling is offered for the Hex package manager. Hex credentials are only requested once. This is used to create a long-lived API token to be stored in the user’s file system and encrypted via a local password. For package namespace checking, the gleam publish command now will check for top-level namespace pollution, explaining the problem and asking for a confirmation if it is present. The Gleam 1.7 post explained that some people from other ecosystems may place all their code in the top-level namespace, using generic names, which could result in problems for users of the package. For semantic versioning, Gleam now will ask for confirmation if a package is published with a v0.* version, as it does not respect semantic versioning. Gleam’s bit array literal syntax provides a way to build up and to pattern match on binary data. When targeting JavaScript, the compiler now generates faster and smaller code for int values in these bit array expressions and patterns by evaluating them at compile time when possible. The language server now offers an action to extract a value into a variable. Gleam 1.7 follows the November release of Gleam 1.6, featuring improvements such as context awareness for errors.
https://www.infoworld.com/article/3633168/gleam-1-7-brings-faster-record-updates.html
Voir aussi |
56 sources (32 en français)
Date Actuelle
mer. 8 janv. - 22:49 CET
|