I‘m not sure why this hasn’t been mentioned by anyone: If you’re unhappy with Elm‘s constraints the obvious solution is to switch to PureScript (purescript.org). It’s basically are more powerful Elm like language with a great FFI and absolutely no constraints how to work with JavaScript. There are also a lot of compatibility packages to provide functions and workflows from the Elm ecosystem.
back
4 comments
The problem is that Elm's crowning achievement is that it took a lot of ideas from functional programming and produced an end product that is stunningly simple and easy to use -- even simpler and easier than most non-functional languages. Speaking as an avid Haskeller who revels in the arcane and abstract, PureScript is just another inaccessible and alien functional language that most people will be immediately turned off by. It's not at all a replacement for what Elm achieved.
Or go a different direction like Clojurescript and Fulcro, or Reframe / Reagent... etc.
The learning curve to PureScript is way higher than Elm. Is that not that obvious?
Do you think it is harder to learn than Ocaml/ReasonML though?
I think there is a good free introductory book [1], a welcoming community [2], the language and ecosystem are quite stable nowadays and there's good tooling (now that there's the Spago package manager).
[1] https://leanpub.com/purescript/read [2] https://discourse.purescript.org/
It's definitely harder. I have been doing O'caml for about 20 years now, and we have probably one of the largest Elm apps out there. I looked at Purescript, especially because it also compiles to other languages (C++, BEAM) but the learning curve is a bit steep.
Absolutely.
The 'Pure' is the problem here.
Not only is it nearly as high as Haskell, the PureScript guide hasn't been updated in years and is wildly out of date. You have to go searching for an unofficial rewrite, and those are incomplete as well.
On the other hand, you can pretty much just learn Haskell to learn PureScript. All of the differences fit onto a single small docs page: https://github.com/purescript/documentation/blob/master/lang...
Nope, not the same. You still need to learn how PureScript does things.
Also, these days no one want to learn Haskell just for sake of building UI. Just do it in JavaScript or TypeScript, far far far easier pill to swallow.
Yes I learned Haskell, Elm, and Rust
It is, but the community is pretty awesome and helpful, and anyone who knows Elm and takes the time to read at least one introductory Haskell book should be able to get productive pretty quickly.
Still lost many hours for asking and debugging, if it ever get answered. Companies don't care, business don't care. They care about shipping feature, easy to find developers. Try explaining that to your PM or boss. In the end money talks.
I think using Elm, PureScript, or any technology that has a community orders of magnitude smaller than well established safer alternatives would be a dubious decision. I never advocated bringing either into a professional environment. I simply stated that there is a viable alternative if someone is looking to play in the space.
I've seen people suggest learning Elm as your stepping stone into PureScript, because it does a better job with the training wheels in the beginning.
PureScript is wonderful. But it's a very steep learning curve if you don't already know Haskell, and the documentation tends to lag quite a bit behind the language.