DEV Community

Do you consider learning Elm?

Pragmatic Maciej on January 31, 2020

Hi devs, want to ask you to take a moment and vote in the poll if you consider learning Elm. Is the Elm the thing still? I am also very interested ...
Collapse
 
jvarness profile image
Jake Varness

If not for use in production, I found it to be the most delightful foray into functional programming languages. I'm an object-oriented programmer by academia, and Elm has helped me learn more about functional programming languages.

If you're already familiar with pure functional languages like Haskell then that's going to help you understand Elm easier. Elm boasts a lot of neat features for a language geared towards developing SPAs, such as fast renders, small bundle sizes, and no runtime exceptions.

Collapse
 
mateiadrielrafael profile image
Matei Adriel

Didnt you find it limiting? Theres a lot of stuff other fp languages have and elm just cant do, its ok for just rendering but once you want to write code which is just a little bit more generalised you find out how many things elm lacks...

Collapse
 
leobm profile image
Felix Wittmann • Edited

A limitation can sometimes be very productive.
ok, e.g. elm does not support type classes. But I can almost always understand the elm code of others very quickly compared to Haskell or Purescript code. These languages offer so many possibilities that most people can't know everything. Therefore you have to understand the concepts behind functional programming more (e.g. monads, functors, applicatives...), additionally operators overloading is often used.

As another good example for limitation I see e.g. in the programming language world is Go(lang). But you just have to see what cool stuff is built with it.
I think, simple is often better....

Thread Thread
 
macsikora profile image
Pragmatic Maciej

I share your opinion. Thanks for that!

Thread Thread
 
mateiadrielrafael profile image
Matei Adriel

Monads and stuff might be scary at first but once you learn about them they help you write more expressive code (dont tell me a bunch of binds are cleaner than do-notation)

Thread Thread
 
macsikora profile image
Pragmatic Maciej

The thing is that it is. Do notation looks like imperative code and when you don't get what is happening behind the curtain it looks familiar and you think you see what is that. When you understand Haskell concepts and Monad Typeclasses, do notation is crazy confusing to catch.

It's like somebody wanted to emulate imperative code in pure language.

Of course after a while this feeling go away. but I don't see do notation as must have.

Collapse
 
varreli profile image
varreli

Hi I read in a few places Elm is on the downswing in the job market. I've been learning Haskell for a few years. too bloody difficult. I need a good job. My only CS experience is going through a ruby book and thrashing through Haskell. I still feel like a beginner. Any comments appreciated. thanks, John

Collapse
 
drbearhands profile image
DrBearhands

I consider Elm to be one of the most interesting languages out there.
The way it leverages purity to ensure no runtime exceptions (also eliminating most bugs) and no risk 3rd party libraries greatly influenced my way of thinking about functional programming; from a bit of a gimmick to something with potentially serious business value.

In practice, it's competing with Haskell for my favourite language. Haskell has better polymorphism but Elm is way cleaner and even safer.

Collapse
 
macsikora profile image
Pragmatic Maciej • Edited

Hi, thanks for your reply. Can you elaborate about how Elm is safer from Haskell?

Collapse
 
drbearhands profile image
DrBearhands • Edited
  • Elm's functions are nearly total (you still get the halting problem). Haskell's are not.
  • Elm doesn't allow you or 3rd parties to sneak in side-effects somewhere.
  • Elm doesn't allow unsafe casting.
  • TEA is more limited than IO monads.
Collapse
 
bauneaustin profile image
Austin Baune

Haven't looked into Elm for a bit, but when I first checked it out it seemed a little framework-y and limiting when compared to PureScript. It seems like Elm might be more focused on ease of use rather than depth of functionality. When looking into FP Elm might be a good starting point with a later transition into PureScript if needed. Either way there's a lot of interesting concepts worth learning!

Collapse
 
mateiadrielrafael profile image
Matei Adriel

I learned it, wouldn't use it, everythin it does it does well, but it doesn't do much. There's a lot of stuff it's missing which makes writing generalised code impossible...

Collapse
 
macsikora profile image
Pragmatic Maciej

Hi Matei, thanks for the comment.
What exactly is missing in the language and you are pointing here? Do you mean expressiveness tools like typeclasses, or smth different?

Collapse
 
mateiadrielrafael profile image
Matei Adriel • Edited

Typeclasses, do-notation (pr computstional expressions), HKTS, row polymorphism, curried types(actuslly idk if elm has this, if it does then my bad)

Also operator overloading, or at least some operators for binding, mapping, applying etc

Collapse
 
leobm profile image
Felix Wittmann • Edited

I'd like the language design, very clean and simple, and great for beginners in functional programming. What I hate since v.19.0 that I can't write my own Javascript FFI code. I know ports, but that's more of a crutch. I understand the intention behind it, to keep the standard library clean and to prevent runtime errors, but I have the feeling that it limits me as a programmer. Therefore I don't really use elm at the moment :(

Edit:
Purescript is an interesting alternative, but very hard to learn, compared to elm. Also does not come close to the programming error help/assistance of elm.
F# is nice too (fable), but the community is very small and very windows and microsoft centered.

Collapse
 
mateiadrielrafael profile image
Matei Adriel • Edited

I did some f# on linux and had no problems with it!

If you want to learn ps and you are familiar with fp concepts just read the language reference!

Collapse
 
fyodorio profile image
Fyodor

I like it, had tried and would use if I could prioritize 😔

Collapse
 
juancarlospaco profile image
Juan Carlos

I see is nice, and does really nice job on whats designed to.

But I need to have the option to use OOP, so a functional-only lang wont do it for me.

Collapse
 
jvarness profile image
Jake Varness

Once you get the hang of functional languages you barely miss the objects.

I came from a strong OO background myself, so it was very strange at first, but it wasn't too bad after a while.

Collapse
 
juancarlospaco profile image
Juan Carlos

I know whats Functional, I wanted lang that can do both, Functional OOP hybrid.

Thread Thread
 
jvarness profile image
Jake Varness

You can make any OO language functional if you make all your methods static 🤣

Collapse
 
macsikora profile image
Pragmatic Maciej

Hi Juan, thanks for response. What is a reason that you need to use OOP?