August 2nd, 2024

Supercharged Labels – Gleam v1.4.0

Gleam v1.4.0 enhances code readability and developer experience with new shorthand syntax, improved error messages, updated build tools, and expanded support for JavaScript, among other features.

Read original articleLink Icon
Supercharged Labels – Gleam v1.4.0

Gleam v1.4.0 has been released, introducing several enhancements aimed at improving code readability and developer experience. A new shorthand syntax for labelled arguments allows developers to omit variable names when they match the parameter names, streamlining function calls. Additionally, two new code actions have been added: one to convert existing code to the shorthand syntax and another to automatically add labels to function calls. The language server now supports completion for labelled record fields and provides signature help, displaying function documentation and highlighting required arguments during calls.

The build tool has been updated to ensure that warnings are emitted each time a project is built, addressing issues with cached warnings. Improvements in Erlang typespec generation have also been made to silence new warnings introduced in Erlang OTP27. The documentation generation process now includes a target flag for specifying the platform, and the compiler has enhanced fault tolerance, allowing it to analyze code even when errors are present.

Error messages have been improved for common syntax mistakes, and the string concatenation operator can now be used in constant expressions. Support for JavaScript bit arrays has been expanded, and the language server can now list document symbols for better navigation. Lastly, case correction suggestions and a new code action for converting assert expressions into case expressions have been implemented, further enhancing the development experience in Gleam.

Link Icon 9 comments
By @alphazard - 6 months
Programming language syntax has come such a long way.

It's not just a matter of taste; we used to deal with language particulars which were objectively hard for humans to adhere to, for no good reason. No one seriously advocated for semi-colons as a matter of aesthetic preference.

Gleam just looks like a modern language. It looks like it was made for humans to deal with, given what we now know about the human visual system, memory, habit formation, etc.

By @areichert - 6 months
Does anyone have a good comparison of using Gleam vs Elixir in 2024 (i.e. the pros and cons of each)? I've only used Elixir, but definitely curious to tinker with Gleam...
By @ducdetronquito - 6 months
Congrats on the release, it like every bit of it !

I hope Gleam will find more sponsors for Louis and the core contributors, especially one from a stable company !

On this side, have you thought about publishing paid educational content to both pay the bill and still contribute to Gleam’s growth ? I don’t know for others but I would love to pay for something like Luca Palmieri’s book Zero To Production in Rust but in Gleam !

Cf: https://www.zero2prod.com/index.html

By @giacomocava - 6 months
I love how every new release becomes my new favourite one, so many nice additions! And I wanted the label shorthand syntax for a long time
By @Alupis - 6 months
What kind of projects are people using Gleam for?
By @Alupis - 6 months
A ton of Language Server improvements as well - this release is a good one!
By @isaacharrisholt - 6 months
Loving this! The shorthand syntax is a game changer