by doctor_stopsign · 8y ago · 0 comments
On an attempt to use Elm in production I ended up switching back to Javascript. The biggest issue I faced was lack of type-classes, which made certain parts of the code feel like I was pulling teeth to get Elm's type system to be happy. Perhaps this is more of an issue of expecting Elm to be more like Haskell than it is.
I hope Elm is able to get more adoption, and with it more examples of idiomatic approaches to problems in Elm's style. However this somewhat feels like a chicken-and-egg problem.
Regardless, this release looks great for people using it in production already!
Yep, that's it right there.
I wonder if there's some way we could make it clearer that Elm is not Haskell, and trying to use it like it's Haskell won't likely to lead to a good experience.
At any rate, thank you for the feedback! It's definitely an ongoing communication challenge since the two languages have so much syntax in common.
Some people have a hard time in Elm because they expect Elm to behave like a language that they are already familiar with. The most frequent impedance mismatch issues I've seen are reaching for `type-classes` or attempting to implement various polymorphic behaviors and people who are too hungover on imperative constructs (Elm is declarative).
Once people start using Elm the way it was designed to be used, things become simple and start to flow.
But how will anyone ever get anything done, when they can't make everything in their code exceptionally clear by wrapping it all up in a 15 monad thick monad-combinator? /s
But yes, I totally agree. Elm is a simpler, safer and easier Haskell for the front-end. I just love it :)
To me, rather than principled, that just feels incomplete.
It's cool if you prefer the way Haskell does it, though! You should check out PureScript, which chose to do it the way Haskell did it.
Elm is not going to change, however fortunately there are alternatives. Pick something like PureScript or GHCJS and move on like I did.
I now write Haskell professionally[1] both for frontend and backend, something that you'd be hard-pressed to achieve with the likes of Elm.
edit: I'm not saying Elm should change, the time for that is long gone. Just that the idea someone would want an interface (to do things like bound on generically) isn't that far fetched.
What makes you say that? Elm has yet to reach 1.0, anything can happen. It's not likely it will happen any time soon, however.
All high-level programming languages are on board with abstractions, pretty much by definition!
They all provide abstractions, but they're not necessarily on board with letting users build new abstractions. Go is famously absolutely not on board with it for instance. Elm significantly less so — and I think the more restricted use-case also makes the issue significantly less problematic, at least it was in my (admittedly limited) experience — but it's still way downslope from the likes of Haskell or OCaml.