DEV Community

Cover image for Why is Elm such a delightful programming language?

Why is Elm such a delightful programming language?

Marcio Frayze on March 08, 2023

A Brazilian Portuguese version is available here. Elm is a programming language created by Evan Czaplicki and a recurring definition used to de...
Collapse
 
konnik profile image
konnik

What a nice read, thank you, this made my day.

My journey into functional programming was very similar to yours, struggling with Haskell and then found Elm and directly fell in love with it. It surely is a delightful language.

I'm now back into Haskell, thanks to the experience from Elm it's much more approachable this time.

Excited to hear Elm on the backend is about to happen also. Happy days.. 👊

Collapse
 
marciofrayze profile image
Marcio Frayze

Thank you very much for the comment.
I'm glad you enjoyed it! And thanks for sharing your journey.

Evan is making it clear that it's still all very experimental but it’s impossible not to get excited about the possibility of being able to use elm on the backend officially!

Collapse
 
eekee profile image
Ethan Azariah

In an old Lisp book, I once read a line something like, "Math is a describing what is. Programming is describing how to." It's quite true for imperative languages, especially those which don't incorporate any functional programming techniques. Functional programming is more mathematical; it doesn't look like a good match for the processes of the real world and the things we expect from computing, but in practice, it is. Imperative programming seems right and natural to me but over the years I've seen so many examples of functional programming being more powerful than imperative that there must be something to it. This power is present even at the deepest possible level. Modern C and C++ compilers secretly create a new variable for every assignment, turning the language into a functional language internally, so they can apply optimizations which only work with functional languages. Deeper still, modern CPU cores JIT-optimize the machine code they execute, having over 100 hidden registers so they can apply the same functional-language optimizations.

Part of me wonders if similarly powerful optimizations are waiting to be discovered in imperative programming, but this hope fades with every passing decade that functional languages continue to get more powerful and more applicable to real hardware. (Functional code is ideal for massively parallel applications.) Naturally, I've been meaning to try a functional language. I had a little go with APL already, but only half-way 'got' it. The character set was surprisingly all right, but figuring out how to get things done was a struggle. I wonder if Elm might be easier to grasp. It would help that it's a Web language; I can readily picture the transformations from input to output in functional terms.

Collapse
 
marciofrayze profile image
Marcio Frayze

I can readily picture the transformations from input to output in functional terms.

Yes! And that's the essence of The Elm Architecture: guide.elm-lang.org/architecture/

Thanks a lot for your comment and insight.

Collapse
 
vicsteiner profile image
Victor Steiner Ferreira

Hi Marcio an hello from another Brazilian here.

Man I have a similar path with FP. Started with Haskell (keep reading and learning it but ...). I think it is a super beautiful language but I agree totally with your perspective on it.

I work as a data engineer so I also have been looking at Scala (functional but not pure ... I like it but honestly sometimes seems more confuse than Haskell to me) but Elm looks much more close to what I have been learning with Haskell.

I have some plan for data tools that involve front end development and I am pretty inspired in trying out Elm for it thanks to your article.

Let's see how it goes!

Collapse
 
neysacassin73045 profile image
Neysa Cassin

Yeah ELM is nice!

Collapse
 
fyodorio profile image
Fyodor

Elm is nice and anything but delightful 😅

Collapse
 
kromdaniel profile image
Daniel Krom

AFAIK, elm is no longer maintained (last stable release, 3 years ago), was it changed?

Collapse
 
marciofrayze profile image
Marcio Frayze

Hello Daniel, thanks for the comment.

You can learn more about the Elm roadmap (the language/compiler) here: github.com/elm/compiler/blob/maste...

In short, the current situation is: "If you like what you see now, that's pretty much what Elm is going to be for a while." But I don't consider that to be unmaintained. It's more like stable ;)

The compiler's current moment goes through a stage that goes back to its origins. Something more experimental, less like a typical open-source project. And as I comment at the end of the article, Evan is trying to use Elm in the backend, but it's not something he speaks too publicly yet.

If you want to know more about how Evan sees Elm's development, I recommend this talk:
youtube.com/watch?v=uGlzRt-FYto

And if you want to understand the future of language, this podcast (from 2021 but I believe that ideas are still valid):
elm-radio.com/episode/open-source-...

But in the meantime, the community around the compiler remains very active and producing amazing things!
Not long ago elm-land (elm.land) was released and version 3 of elm-pages (elm-pages.com) is in development. Among other amazing tools, like elm-review.

The Elm Radio podcast and the Elm Weekly are great sources of information about the current status of the Elm ecosystem.

I'm currently using elm-land in production and that's the best front-end framework I ever worked with. =)

Collapse
 
mihneasim profile image
Mihnea Simian

Thanks for the bringing this topic up, there aren't many people writing on functional programming, especially in frontend.
I was lead to have the same belief as Daniel, you might want to listen to Jesse Tomchak starting at 31:09. Jesse calls it abandoned: repos exist, you can open issues, but there's no one on the other side.
But I get what you're saying, elm is a compiler, it does not need to depend on recurring updates/releases. And there's inherent value in learning and practicing functional programming, despite of the status of a language or a language-compiler.

Thread Thread
 
marciofrayze profile image
Marcio Frayze • Edited

Thanks for the comment Mihnea.

I just listened to that episode.

Well, he says that Evan "moved to something else". But, clearly Evan is still working on Elm and experimenting with new frontiers. Not only on the technical side of things, but finding a more sustanable way to maintain the project (since he is no longer working at NoRedInk).

But I can see why Jesse might feel this way. There are times I felt like that too.
The latest "news" on the official page is from 2019. Defenitly not a common thing on a active open source project, right? In the Elm forum people debate about that from time to time. It's a big contrast with React or Vue communities.

In fact because of this "fear of missing out the next web revolution", I tried many alternative to Elm. React, Vue, Angular, PureScript, Polymer, Ember, Hyperapp, ... but couln't find one that filled that void. So I went back, gave Elm a real chance last year (using in a real project at my job - an internal project, I didn't fell confortable adding a foreign tech into our main product) and I'm really happy with how it's turing out. That fear kinda went away and I never felt so productive and happy developing a front-end.

There are a few other things Jesse says about FP in that episode that I disagree with, but I have no data to backup my opinions, so I guess there is no benefits in pointing them out.

But as you said, learning Elm (and FP) by itselft is of great value for any developer.

Collapse
 
absynce profile image
Jared M. Smith

Folks who are unfamiliar with how the Elm ecosystem works can check this out: iselmdead.info/. I use Elm at work every day and love it, including that I don't have to upgrade and learn new concepts all the time. I can focus on building things instead. 🎉

Collapse
 
peterrybar profile image
Peter Rybár

Some comments have been hidden by the post's author - find out more