Published 18 Sep, 2022 by Louis Pilfold
Gleam is a type safe and scalable language for the Erlang virtual machine and JavaScript runtimes. Today Gleam v0.23.0 has been released, let’s take a look at what’s new.
Elixir support
Gleam runs on the Erlang virtual machine alongside an assortment of other excellent languages, and as such we want to take advantage of all the packages written in those languages.
Previously projects using Gleam’s build tool could depend on packages written in Gleam or Erlang. With this release projects written in Elixir are also supported, giving Gleam programmers access to practically all the packages found on Hex, the package manager for the Erlang ecosystem.
The developer-experience for using Elixir packages in Gleam is the same as using Erlang packages.
# Add an Elixir package to the Gleam project
$ gleam add tzdata
// Import a function from the package
external fn tzdata_version() -> String =
"Elixir.Tzdata" "tzdata_version"
// Use it in Gleam
pub fn main() {
io.println(tzdata_version())
}
Thank you to Tynan Beatty for this feature, and thank you to the Elixir community for all they give to the BEAM ecosystem!
Package updating
We want it to be as easy as possible to use code written by others, and we want to avoid “dependency hell”, so the user experience of the build tool is an important area for Gleam.
One missing part of the puzzle so far as been upgrading the package versions that your project depends on. It has largely been a manual process previously.
With this release there is a new gleam update
command which will efficiently
resolve the latest compatible versions for dependencies using the
PubGrub algorithm.
$ gleam update
# Tada, you're on the latest versions!
Searchable documentation
Gleam generates documentation for packages and publishes the HTML to HexDocs, the documentation site for the Erlang ecosystem.
With this release generated documentation includes a search bar so that functions, types, and modules can be found faster than easier than ever. The search is powered by the Lunr JavaScript library and as such supports fuzz-matching to help with typos, or for when you can’t quite remember the name of what you’re after.
Give the documentation search a try with the standard library documentation today.
Thank you to Lucas de Ávila Martins for this feature!
And more
Those are the main features, but there’s also an assortment of other changes:
- Constant expressions can now contain and reference functions. Thank you Eddie Hatfield!
- Compiler performance has been improved by buffering outputs and lazily loading resources. In tests this quadrupled performance when compiling the standard library.
- The LSP will now provide rudimentary autocompletion for importable modules.
- The code formatter style has been improved.
- The
gleam publish
command will include thepriv
directory (for non-code package artefacts) and can be run non-interactively. Thank you Tynan Beatty!
How can I try it?
Instructions on how to install the latest version of Gleam can be found on the getting started page of the website. Once installed check out the language tour for an introduction to the language.
Supporting Gleam
If you would like to support me in making Gleam please consider sponsoring Gleam or asking your employer to sponsor Gleam. Every donation makes a difference, no matter how small, so thank you for your help.
Or alternatively give us a star on GitHub! ⭐
And thank you!
Gleam is made possible by the support of all the people who have sponsored and contributed to the project. Thank you all!
- Adam Bowen
- Adam Brodzinski
- Adam Davies
- Adi Iyengar
- Alembic
- Alex Manning
- Alexander Koutmos
- Ali Farhadi
- Andrew Varner
- Anthony Scotti
- Antoine Wendlinger
- Arnaud Berthomier
- Arno Dirlam
- Ben Marx
- Ben Myles
- Bernat Jufré Martínez
- brettkolodny
- Brian Glusman
- Bruno Michel
- Carlos Saltos
- Charlie Duong
- Chew Choon Keat
- Chris Lloyd
- Chris Young
- Christian Meunier
- Christopher Keele
- clangley
- Clay
- Cole Lawrence
- Colin
- Colin Caine
- Copple
- Cristine Guadelupe
- Damir Vandic
- Dan Dresselhaus
- Dan Mueller
- Dashuang Li
- Dave Lucia
- David Armstrong Lewis
- David Bernheisel
- David Flanagan
- Dennis Tel
- dependabot[bot]
- Dimos Michailidis
- Edon Gashi
- Edward Hatfield
- Elliott Pogue
- Eric Meadows-Jönsson
- Erik Terpstra
- Felix Sandelin
- Fernando Farias
- Florian Kraft
- fly.io
- Graeme Coupar
- Guilherme de Maio
- Gustavo Villa
- Hayleigh Thompson
- Heechul Ryu
- Henry Warren
- human154
- Ian González
- Ingmar Gagen
- inoas
- Ivar Vong
- James MacAulay
- Jan Skriver Sørensen
- Jechol Lee
- Jen Stehlik
- jiangplus
- John Gallagher
- John Palgut
- Jonathan Arnett
- josh rotenberg
- José Eduardo Monteiro
- José Valim
- Josías Alvarado
- João Veiga
- Julian Schurhammer
- Julien D
- Justin Blake
- Kapp Technology
- Khanh Nguyen
- Kieran Gill
- Lars Wikman
- Lucas Avila
- Marcel Lanz
- Marcin Puc
- Marius Kalvø
- Mark Holmes
- Mark Markaryan
- Markus
- Martin Janiczek
- Mathias Jean Johansen
- Matt Van Horn
- McKayla Washburn
- Michael Chris Lopez
- Michael Jones
- Michał Kowieski
- Michele Riva
- Mike Lapping
- Mike Roach
- Milton Mazzarri
- moogle
- Nathaniel Knight
- Nick Reynolds
- NicklasXYZ
- NineFX
- OldhamMade
- Ole Michaelis
- Oliver Searle-Barnes
- Parker Selbert
- Pema Malling
- Pete Jodo
- porkbrain
- Praveen Perera
- qingliangcn
- Quinn Wilton
- Raúl Chouza
- Redmar Kerkhoff
- Reio Piller
- Rico Leuthold
- Robert Attard
- Rodrigo Oler
- Ryan Winchester
- Sam Aaron
- Sascha Wolf
- Saša Jurić
- Scott Wey
- Sean Jensen-Grey
- Sebastian Porto
- Shunji Lin
- Shuqian Hon
- Simone Vittori
- Stefan Hagen
- Strand Communications
- Terje Bakken
- Tomasz Kowal
- Tomochika Hara
- Tristan de Cacqueray
- Tristan Sloughter
- tynanbe
- Uku Taht
- Vincent Le Goff
- Weizheng Liu
- Wilson Silva
- Wojtek Mach
- YourMother-really
- Yu Matsuzawa
- zaatas
- Zsombor Gasparin
- Štefan Ľupták
Thanks for reading! Happy hacking! 💜