Yan Yi

TIL: Setting Up Gleam with asdf

· Yan Yi Goh· 1 min read

I have been eyeing Gleam since 2023 but never really got to it. It’s a functional programming language. Also, Large Language Models (LLMs) are likely not well-trained on it as compared to mature languages.

v1 of Gleam was released in March 2024. Moreover, statically and strongly typed languages with a good compiler will be great for agentic programming.

Setting Up with asdf

I wanted to use asdf to install Gleam and Erlang. I followed the instructions on the repositories:

  1. https://github.com/asdf-community/asdf-gleam
  2. https://github.com/asdf-vm/asdf-erlang

Gleam was straightforward. Erlang was a little tricky. I had to do something like the following before I could even use asdf to install Erlang:

apt-get update
apt-get -y install build-essential autoconf m4 libwxgtk3.2-dev libwxgtk-webview3.2-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk

For Rebar3, I had to install it by following the guide in https://rebar3.org/docs/getting-started/ and then add it to my PATH.

For asdf, I needed to reference “Set a version” in order to set my Gleam and Erlang versions:

asdf set -u gleam 1.12.0
asdf set -u erlang 28.0.2