Gleam update shines on external types
Gleam 1.14.0, a new version of the statically typed language for the Erlang VM and JavaScript runtimes, has enhanced support for external types.
Released December 25, the update can be accessed at GitHub. With this release, the @external annotation is now supported for external types, giving the programmer a way to specify an Erlang or TypeScript type definition to be used, according to Gleam creator Louis Pilfold. Gleam’s external type feature is used to declare an Erlang or JavaScript type that can be referenced in Gleam, but because the type originates from outside of Gleam, the Gleam compiler cannot produce a precise definition in generated Erlang or TypeScript type definitions. Instead, the compiler had to fall back to the correct but vague “any” type of each language.
Also enhanced in Gleam 1.14.0 is inference-based pruning, an optimization that improves performance and detects more redundant patterns when pattern matching on binary data. Gleam 1.14.0 extends this optimization to work with int segments, thus increasing its effectiveness.
Gleam 1.14.0 also offers number normalization in pattern matching analysis, resulting in faster code. Numbers can be written in different formats in Gleam (decimal, octal, hexidecimal, etc., or scientific notation could be used to represent floats). The compiler now internally normalizes these values to a single canonical representation. This representation now is used by the pattern matching analysis engine, further enabling optimizations such as interference-based pruning.
Other improvements in Gleam 1.14.0:
- Equality testing has been made faster. Performance of
==and!=has been improved for field-less custom type variants when compiling to JavaScript. - The record update syntax now can be used in constant definitions, enabling constant records to be constructed from other constant records.
- The release updates to the latest Elixir compiler API, fixing some warnings that would be emitted with previous versions of Gleam and the latest version of Elixir.
Original Link:https://www.infoworld.com/article/4117616/gleam-update-shines-on-external-types.html
Originally Posted: Thu, 15 Jan 2026 20:48:41 +0000












What do you think?
It is nice to know your opinion. Leave a comment.