Close

26.09.2024

Gleam Language Reaches Version 1.5 with Key Enhancements

The statically typed language Gleam, built for both the Erlang virtual machine and JavaScript environments, has just reached its 1.5 version, bringing a host of productivity upgrades—most notably, improved compile-time error messages.

Released on September 19, the new Gleam 1.5 version is now available on GitHub. A significant focus of this update is improving compile-time messages for scenarios involving incomplete pattern matching. Now, when a pattern is missing, the error message will display the unmatched values using the same syntax the developer would typically use, fully respecting any module imports or aliases. This adjustment makes it much easier to interpret and address errors directly. In fact, developers can copy the missing pattern from the error message and paste it right into their code, speeding up troubleshooting.

Another notable addition in Gleam 1.5 is automatic “todo” expression insertion. When a developer writes a placeholder expression without filling out the block, the compiler now automatically inserts a “todo” marker, making it clear that the function is incomplete. To reinforce this, the Gleam formatter will now explicitly add the “todo” tag, enhancing code clarity and reminding developers of incomplete sections.

Gleam 1.5 follows the major release of version 1.0 back in March, which was followed by incremental updates. Gleam aims to be a go-to language for building robust, type-safe systems that can scale efficiently. Other key updates in Gleam 1.5 include:

  • Enhanced Language Server Features: The language server now supports code actions, such as automatic suggestions for completing local variables and function parameters.
  • Silent Compilation Mode: Developers can now run commands like gleam run or gleam test without seeing progress logs cluttering the output. A new flag has been introduced to suppress progress information, and logs will now be redirected to standard error instead of standard output, making it easier to manage in shell environments.
  • Improved Build Efficiency: The build tool has been optimized to skip recompiling code when only a dependency module is executed, further speeding up development cycles.
  • HTML Documentation Upgrades: Documentation generated in HTML format has received improvements to enhance readability and navigation.
  • Improved Compiler Feedback: A more user-friendly error message has been added for situations where developers mistakenly attempt to write an if expression in Gleam, which only supports the case pattern-matching construct for flow control.

These updates demonstrate Gleam’s continued commitment to both developer experience and language clarity, making it an increasingly attractive option for those looking to build type-safe applications that scale. For full release notes and to access Gleam 1.5, developers can visit the official GitHub repository.