Technology

Gleam v1.18.0 Brings Record-Field LSP Intelligence and JS Data Singleton Optimization

Martin HollowayPublished 2d ago4 min readBased on 3 sources
Reading level
Gleam v1.18.0 Brings Record-Field LSP Intelligence and JS Data Singleton Optimization

Gleam v1.18.0 was released on July 29, 2026, shipping substantial language server enhancements and a JavaScript compiler optimization, as announced in the official release post (gleam.run). The release had been preceded by a v1.18.0-rc1 candidate for testing.

The headline changes land in Gleam's language server, which now supports go-to-definition, find-references, and rename operations for record fields. This closes a gap that has long been table stakes in mature language toolchains. Erlang and Elixir developers familiar with OTP's record and struct semantics will recognize the workflow friction that field-level LSP intelligence eliminates: navigating a codebase by symbol rather than by grep, and refactoring field names without manual multi-file search.

Type variable renaming has also been added, covering functions, types, and constants. A developer can now rename a type parameter in a function signature and have the change propagate across all references within the relevant scope. This is the kind of ergonomic improvement that goes unnoticed once it exists but is felt acutely in its absence, particularly in codebases that make heavy use of generic types.

The language server gained two further features. First, module file renames now trigger automatic import updates across dependent modules, removing a class of mechanical edits that are both tedious and error-prone. Second, a "pattern match on value" code action can be invoked on function calls and their returned values, generating a case expression skeleton against the expected result type. For a language whose idioms lean heavily on explicit pattern matching rather than method chaining, this reduces the boilerplate of constructing match arms by hand.

On the compiler side, the JavaScript backend received an optimization around data singletons. Where all instances of a data structure are equivalent, the compiler now reuses a single value rather than constructing a new instance on each evaluation. This reduces allocation pressure in generated JavaScript output, which matters for Gleam code targeting the browser or Node.js runtimes where garbage collection pauses affect application responsiveness. The optimization is conceptually straightforward but requires the compiler to prove instance equivalence at compile time before eliding the allocation.

Gleam occupies a specific niche: a statically typed, functional language that compiles to both Erlang/BEAM and JavaScript. The BEAM target gets the runtime benefits of Erlang's concurrency model; the JavaScript target extends reach to environments where BEAM is impractical. The v1.18.0 changes touch both sides of this story. The LSP improvements deepen the developer experience around the type system's constructs (records, type variables), while the JS optimization improves the quality of one compilation target's output.

Looking at what this means for Gleam's adoption trajectory, the language server work is the more consequential set of changes. Developer experience in the editor is a primary driver of language adoption, and the absence of field-level navigation and rename support has been a concrete limitation for teams evaluating Gleam against more established typed functional languages. A "pattern match on value" code action is a particularly good fit for Gleam's semantics, where pattern matching is the dominant control-flow construct, not a niche feature. The JS singleton optimization is a meaningful but incremental improvement; it will register in profiling traces and benchmark suites more than in developer workflow.

The release follows what has been a steady cadence of versioned improvements to Gleam's tooling, with each release narrowing the gap between the language's type-system ambitions and the ergonomics of working with them day to day. Whether that narrowing translates into broader adoption depends on factors well beyond any single release, but v1.18.0 removes friction in the places developers spend the most time: the editor and the generated output.