Gleam 1.5, the latest version of a statically typed language for the Erlang virtual machine and JavaScript runtimes, has been published, with productivity improvements such as upgraded compile-time error messages.
Launched September 19, Gleam 1.5 can be accessed from GitHub. With this release, compile-time error messages for inexhaustive pattern matching have been upgraded to show the unmatched values using the syntax the programmer would use in their code, respecting aliases and imports in modules. The change makes it easier to understand an error message. Missing patterns can be copied from the error directly into the source code.
Also with Gleam 1.5, implicit todo
formatting is featured. If developers write a use
expression without any more code in that block, the compiler implicitly inserts a todo
expression. With this release, the Gleam code formatter will insert the todo
to make it clearer what is happening.
Version 1.5 follows the March announcement of Gleam 1.0, which then was followed by several point releases. Gleam itself is positioned as a language for building type-safe systems that scale. Elsewhere in Gleam 1.5:
- Language server code actions are featured, including auto-completion for local variable and function arguments to the language server.
- Silent compilation is featured, tending to a situation in which when a command such as
gleam run
orgleam test
is run, progress information is printed. Sometimes, developers only want to see the output from tests or programs; ano-print-progress
flag has been added to silence the additional output. Also, this information is now printed to the standard error rather than standard out, making it possible to redirect it elsewhere in a developer’s command line shell. - The build tool now skips compiling code if a dependency module is being run.
- HTML documentation has been improved.
- The compiler now shows a helpful error message if developers try writing an
if
expression instead of acase
. Gleam has one single-flow construct: the pattern matching thecase
expression.