Gleam is Pragmatic | software is fun

submited by
Style Pass
2024-10-05 23:00:06

I’ve spent the past several years working with functional programming languages in my free time – primarily Haskell and OCaml. I love both languages but also find aspects of each frustrating.

Haskell is terse and elegant with type classes providing a powerful mechanism for ad-hoc polymorphism. However, it can also be confusingly implicit and I personally find lazy evaluation to have more downsides than upsides.

OCaml is explicit and powerful with a best-in-class module system. However, I believe it is often exhaustingly explicit, especially when dealing with custom data types in generic containers.

Over the past few months I’ve been experimenting with the Gleam programming language and I’ve been very impressed. I believe it makes three very interesting design choices that provide the best of Haskell and OCaml, with relatively few downsides.

I’ll explore the implications of these design decisions in this post, comparing Gleam with Haskell and OCaml. I’ll be using only the standard libraries of each language.

Leave a Comment