by k_bx · 7y ago · 0 comments
Here's my message: Elm is playing the JS world's game (obeying the rules) and it's winning it!
- you can take a JS dev and they'll be productive in two weeks in Elm
- the compiled code will be smaller than react's
- compilation time is less than in webpack (and compiler's reaction is under 0.2 secs most of the time)
- performance of your app is better
- no runtime exceptions
PureScript and others, unfortunately (at least in many cases), take a different direction: they don't play the game at all, staying in their own, very different one. But hey, they have type-classes!
I disagree, though the meaning isn't clear. Elm is interesting, but it's not part of the JS world, and it doesn't come close.
Just recently, the Norway Railways described their experience with Elm. It was largely positive, but one of the main two negative points was the difficulty to interoperate with JS libraries. They tried it, and failed hard (many runtime errors). BTW, the other pain point was the restrictions on packaging, which is quite orthogonal with the (npm) JS world. https://news.ycombinator.com/item?id=21204761
I don't claim Elm to be a part of JS world, and your points about JS interop are correct, it's somewhat difficult if it's heavy, so using Elm as a driving for some big JS library would be a bad idea, while using some small interface for drawing charts or WYSIWYG is ok.
The private packages point is specific to how they do stuff, but I agree that it would be an improvement to allow that from package.json.
I'm curious about this comment, for my current project I chose reasonML over Elm very much because reasonML plays well with old javascript and it plays nice with the rest of the web.
My bundle is very small, compile times fast, and interop with even quite old JQuery libraries is a breeze.
Is there something else I'm giving up that I'm not aware of?
I do Elm at my job every day, but it has serious competition.
PureScript is a tremendous language, and I'd be happy to see it more widely used, and your points about JS interop and SPA focus are true of course, but I would argue that the step for ditching FFIs are better for some of the same reasons that were listed.
With Elm you can't, for example, use the browsers Intl API to get plurals, currencies, dates, etc. This is the type of thing you want to partially apply/instantiate with your locale, then use it synchronously at the view level with your model for display. You just don't have the access to do this because a proposal must be made and approved by the Elm team. It'll probably be good API, but you'll be SOL in the meantime (for possibly years). This isn't a dev cycle that works for every person, team, or project.
i’ve never been a big fan of these sorts of assertions. not everyone picks things up at the same rate.