A language that doesn't affect the way you think about programming, is not worth knowing.
-Alan Perlis
My story - How I got into it…
TLDR - The promise of Elm is hard to ignore and the enthusiasm of Elm developers is infectious.
Back in 2021, I was helping my brother out with a project, and decided to go all in with Elixir and Phoenix for the backend, as I really wanted to try out functional programming. Coming from Swift, I had a great time, as I had to wrap my head around the beauty of pipes, pattern matching and the simplicity of functional constructs like “nothing but functions”, “immutability”, “composition”, etc.
Elixir really is a great language to get started with FP, TDD & getting hands dirty with building distributed systems. As the codebase grew over time however, I started feeling a little unhappy without a type-system. Also, as I kept digging deeper into the magical world of functional programming, I was intrigued by the beauty of pure functions without side-effects and type systems - how would that world look like ? I heard Julie Moronuki & Christopher Allen on a podcast discussing their book Haskell Programming From First Principles and also their story of how they got into Haskell. It sounded beautiful - I concluded that from there on, all roads for me would lead to Haskell.
I was working at a friend’s startup as a UI designer at the time, and the guy had been raving on and on for ages about this language called Elm, trying different tactics in order to get me to try it (I had been dabbling with React & Redux in a past life, pre-pandemic days). It was pretty ballsy that the startup had decided to go all in on Elm early on for their front end, and managed to hire a small team of 4-5 Elm developers. I was working with these code stallions on the company design system as well as the UI design for a product. I realized all of them spoke about Elm in an almost religious manner… it was a holy artifact to them, and the more they would speak about it, the more mythical the language felt, shrouded in mystery and magic. One of them once mentioned that “Elm was therapeutic” 🤔.
I discussed with my friend about my new obsession with Haskell, and he told me point blank to start with Elm. “Elm is baby Haskell - You write Elm code, and it will compile with GHC”. Sounded fair, given how intimidating Haskell looked at first glance with its funny syntax and quirks (still need to understand type classes beyond Functors. Also, <insert ‘What’s a Monad’ question here>). Reading around, I also learnt that Elm was the gateway to Haskell for countless developers.
Elm is baby Haskell - You write Elm code, and it will compile with GHC”
Given this context, I decided to finally give Elm a try. I got my hands on Richard Feldman’s Elm in Action and also immersed myself in the guides on the Elm website. My initial goal was simple - to migrate the search interface from Phoenix LiveView to Elm, in a pretty barebones manner. Surprisingly, didn’t take that long. After dabbling for a while with ElmUI (a library to build UI in pure Elm - imagine not having to deal with HTML & CSS ? 🤯) I took baby steps and started submitting tiny, noobish PRs to my company’s design system (mostly related to pixel perfection) (Also, shoutout to my colleagues esp Pedro - they were super encouraging and also patient in the code reviews with a Git-idiot like me).
A couple of small projects later, am still learning patterns and practices on how to write good Elm code, but am totally hooked on.
Ok, so why Elm ?
There are a lot of reasons why developers love different languages. There are a lot of technical reasons to love elm, (zero runtime errors, performance, size, etc) but after thinking a lot about it, I realized that the main reason I love Elm is that I find it to be a “Humane” programming language:
It helps you be a better version of yourself : No messy mutations, no cutting corners - pure functions coupled with a robust type system ensure you’re not dropping those accidental boogers around the codebase. The language itself ends up being a forcing function for discipline.
Simplicity / Minimalism - There really is not a lot to learn! You have types, functions that return something, wired according the Elm architecture (Model - View - Update) - that’s it. The language & the runtime do a stellar job of abstracting away complex stuff like concurrency and running side-effects.
It is ok to be “dumb”
Start with a single file
Refactor with ease later
Compiler as an assistant - Helpful error messages & hey - if it compiles, it works !
Permanence - Once you figure out a few patterns, you’ll end up thinking the same way now or when you’re writing code 6 months later.
The biggest reason I love Elm is that it changed my perspective on programming.
As someone who aspires to be a code craftsman, this is the biggest reason to learn Elm. Crazy story - I tried really hard to bring the Elm architecture with me when I started a project in Rust. It really makes you think about what goes into building deterministic systems. Still not an expert, but the way I write code in Swift has changed, thanks to Elm!
10 years on, and the simplicity of the Elm and the Elm architecture still feels timeless and beautiful. It is still an inspiration for how to do things in a lot of different languages/domains, especially when building frontends - here’s an example. Also, if you’re a React developer can you guess what inspired Redux ? Take a look here.
I hope I didn’t over-obsess. And if you haven’t tried Elm I hope I could convince you to at least take a look. All Elm developers that I personally know have been super kind and encouraging in helping me take my first steps in learning the language, and the broader Elm community on Twitter feels the same.