Farewell Elm, Hello Gleam
Two posts in one month, no way!
Joking aside, since it has been a while since I was regularly posting, a lot has changed in the world programming languages, and in my opinions about them.
The last time I was regularly posting, I was fan-girling over Elm and
Elm-UI. Granted, I still
LOVE both of these pieces of tech. However, that last update that elm received was before I stopped posting. Thats right, the last update to elm was in February of 2020. It has not
received an update in 6 years. In an industry where (according to the IEEE), the half-life of knowledge is about 9 months, 6 years is an eternity. According to that half life metric, less a
half a percent should still be relevant. That practically qualifies as a dead language.
Elm’s defense is that it is complete, and has a very stable API. And I greatly appreciate that. One of the key reasons I moved to Elm in the first place was the stability of its releases. However, the last info we got on the future of Elm from Evan clearly showed its a slow future for elm, if any. I am not sure the BDFL model works in the long run, as if criticism or boredom can get in the way of progress.
In light of all of that, I have been looking for something to fill the Elm-shaped hole in my heart and development kit. Purely functional and strictly typed with a good compiler made Elm by far my favorite development experience. Even 6 years later, I still love programming in Elm, but with waning library support and lack of innovation, I was looking for something in that vein.
Typescript wasnt it. It did have the benefit of being Isomorphic, which saved me a lot of time context switching between server and client. So while it is light-years ahead of javascript, its type system felt lacking and its general hueristics felt as clunky as javascript. However, it added a new requirement to the list, isomorphisim.
Purescript is the next obvious choice. A lot of the elm
community went that way, and for good reason. It looks and feels like Elm (more accurately, it looks and feels like Haskell, which elm is heavily influenced by). It’s type system is far more powerful than elm, rivialing that of Haskell. It has an easy FFI layer, which means you can integrate into existing libraries easier (as opposed to Elm’s port system). I really wanted to like Purescript. Learning it forced me
to get a lot better at Category Theory and when
I could work out problems in it, it felt magical (and more specifically made me feel like a
wizard encanting ancient math magic). However the serverside libraries were incredibly scant, relying more on the underlying NodeJS than purescript, and there was a lot of chaos in the community around what frontend library to use. The tooling also changed a lot, resulting in the
same breaking changes I left Angular for Elm in the first place. It is still a great language to learn,
but requiring what feels like a degree in math to join a team in it doesnt feel like a great
language to build big things that require team-members in.
Rust makes a special appearance on this list. I have written backends
in Rust and they have been super fast and easy to express. There are frontend frameworks that use rust, using WASM to get the isomorphic property, but support is harsh, and its probably best left for major applications in browsers, instead of simple web applications.
However learning rust is a lot of fun, and something I absolutely recommend. The compiler is super nice, but it also lacked some of the functional programming niceties and hueristics I liked.
My previous experiences with Scala prevented me from deeply exploring the Scala/Scalascript ecosystem, and I am not unhappy about that.
All of which lead me to Gleam.
Purely Functional - Check!
Strictly Typed - Check!
Nice compiler messaing - Check!
Isomorphic - Check!
Bonus points that it is built on top of erlang and BEAM for the server side, making it really fast
and have first class access to OTP. It has
wonderful Elm-Based frontend framework, Lustre and an easy to write, incredibly performant server in Mist. It is a minimalistic language,
like Elm - heavily contrasting the things I did not like about purescript. It has a robust pattern
matching system, a |> operator (one of my favorite things about elm), clean module definitions with pub and things like opaque types. And it has a growing community and a lot of active development
I did 2025’s Advent of Code in gleam (my solutions available on my github). It really is a joy to work with. Some of
the minimalism (like no if statement or loop structure) take a little bit to get used to,
but having
one– and preferably only one –obvious way to do it.
from the Zen of Python goes a long way, and is one of my favorite parts of Python.
It is not entirely without its flaws. The language got rid of lazy evalutation, one of my favorite features from Haskell and working with pipelines in python. The language has a built-in
type Result a b = Ok(a) | Err(b) which is a good Either type or exactly like Rust’s Result. Love that. But a lot of the library use uses Result(a, Nil) in place of a Option(a) which is
incredibily annoying. They have the same type space, (Result(Bool, Nil) = Ok(True) | Ok(False) | Nil which is space 3 and so does Some(Bool) = Some(True) | Some(False) | None), but there the Nil does nothing. If you are not going to carry error information, just use the Maybe or Option type. I get the argument of handling result everywhere, but the mismatch in type intent makes me angry.
All in all, gleam has become my new little obsession, even if sometimes its minimalism gets in its own way,
I think its a lot of fun to program in and gives me a nice replacement for Elm for personal projects, with the added bonus of Isomorphism. Now I all I need is a port of elm-ui…
New Project Post coming soon.