10 ms·
How to use Elm at work
- mkawia 10y agoI wish there was a way/documentation to embed in a vanilla js app ,like with IIFE or something instead of required the whole <div id="app"></div>
- _Codemonkeyism 10y agoI still always think "Why don't they use mutt?" when a headline features elm.
- methehack 10y agoFor those of you who aren't getting the joke, this comment is not disparaging elm (I noticed a downvote earlier), it's a reference to later day terminal based email clients (two of which were 'elm' and 'mutt'). As in: http://www.guckes.net/mutt/vs.elm.html http://www.guckes.net/mutt/vs.elm.html
- blacksmith_tb 10y agoPine is not elm - my mind goes there right away too, but to be fair many three or four letter nouns will be reused like this (partly to save keystrokes).
- the_duke 10y agoThe docs / language manual is emberassingly sparse right now. The Elm dev(s?) really need to fix the Architecture Tutorial and write a proper language handbook. Right now, the bad docs are pretty off-putting to someone coming to the language. It's a shame, really, because I think Elm is great.
- zalmoxes 10y agoWhile it's a WIP right now, Evan has been writing http://guide.elm-lang.org/ http://guide.elm-lang.org/ I wish Evan allowed others to contribute to the official documentation. Right now Elm feels more like Evan's personal project than a project that is owned by the community. Other then that, the community has done a good job of writing up documentation, and Richard Feldman is working on a proper book.
- the_duke 10y agoAgreed, there are some really good tutorials out there, way better then the official docs. But you need to go hunting for those, and a lot are a bit outdated, with the recent changes. I'm really rooting for Elm, I so prefer it to TypeScript and alternatives. Sadly, no time on my hands to get involved.
- justusw 10y agoThat is the guide that helped me start, but is a long way to go until your first elm-only app. IMO the biggest weakness in the elm package ecosphere is that there is no proper solution to do url routing. While elm-lang/navigation and evancz/url-parser get you 80% there, the remaining 20% cause a lot of pain. I am very optimistic that in the coming months this situation is going to improve tremendously. If we all share more knowledge, tutorials, guides, the whole community will win!
- EduardoBautista 10y agoYes, I have not found a way to do url pasting in a way that looks clean and simple. It's the main thing keeping me from building big projects with Elm.
- rofrol 10y agoHave you tried https://github.com/rgrempel/elm-route-url https://github.com/rgrempel/elm-route-url ? http://www.gizra.com/content/faithful-elm-amazing-router/ http://www.gizra.com/content/faithful-elm-amazing-router/
- chickenfries 10y agoYeah, I tried playing with Elm several months ago, came back to try it again after 0.17, all of the docs are out of date, examples dont work... I'll be back in another few months, hope the situation improves. Also, I could totally make a case for Elm at work right now... if it had usable documentation.
- fiatjaf 10y agoSame case with me.
- snorremd 10y agoI think this could be one of the main challenges Elm face in terms of gaining support. I've been playing around with Elm the past week (creating a fun little web app to learn a new language) and the documentation would likely keep some developers from pursuing the language much further. What helped me was familiarity with functional programming via Clojure, and component based web apps with Om and React. I think the docs could use a chapter on functional programming and how that works in the land of ML languages, and perhaps a few walk through examples of some simple, but not overly simplistic, apps. So far though I think the language is pretty interesting, but I've yet to do anything really fancy with it.
- the_duke 10y agoFor those unfamiliar with elm: I would sum it up as: -) a stripped down, simplified version of Haskell -) with a good concept for side effects -) that compiles to Javascript -) gearded towards writing type safe frontend code for the Browser -) strongly nudging you towards a clean, well architected app structure (see 'the Elm Architecture'). I think it's on the tipping point right now: if enough people jump on board, the language get's good documentation, and the library ecosystem grows, I see a great future for Elm. Otherwise, it will dwindle away soon into the endless annals of forgotten languages.
- david-given 10y agoI really like the look of Elm --- to me it seems to hit the sweet spot of being enough like Haskell to be awesome while also being understandable by humans. It also fixes some of the rougher edges of the Haskell syntax; I vastly prefer Elm's record syntax to Haskell's, for example, which apart from being much cleaner and obvious also avoids some of the more common Haskell namespace traps. The one piece I'm really looking for is server-side Elm, though. I've love the ability to write both my client and my server in Elm. I know there are some projects to allow Elm via node.js but they're still quite rough. (Is anyone looking into transpiling Elm to Standard ML, so that it can be compiled to fast native code with MLton? Because that'd be, like, really cool.)
- tunaoftheland 10y agoAgreed! While I do tell myself "right lang for the right job", I've come to the conclusion that I am lazy. :) So if Elm can run on Erlang/OTP like Elixir, that would be an interesting option for the webdev space. I don't even know if something like that is feasible, but I wonder someone's thought of such a thing?
- david-given 10y agoI hadn't thought of BEAM. Apparently it's on the roadmap. https://news.ycombinator.com/item?id=11916096 https://news.ycombinator.com/item?id=11916096
- sotojuan 10y agoIs it me or is the bundle generated by Elm a bit too big? Maybe it's gotten better lately but I've always thought it overkill for simple apps.
- jose_zap 10y agoIt is considerably smaller that React is... actually it is a lot smaller than jQuery, a library most webpages have in one way or another
- sotojuan 10y agoThanks, looks like last time I tried Elm was too long ago!
- grayrest 10y agoI didn't remember this being too bad. I just checked with Elm 0.17 using the tutorial's [1] nesting/3-gif-pair.elm as the main. Size is 209k out of elm-make, 60k minified (closure compiler advanced), and 19k gzipped. I wouldn't use it for validating a form field but the size seems completely reasonable for a language runtime. [1] https://github.com/evancz/elm-architecture-tutorial https://github.com/evancz/elm-architecture-tutorial
- sotojuan 10y agoI stand corrected—thanks!
- bjz_ 10y agoIt used to be huge (including the entire standard library for simple apps). Afaik though the generated code has been improved in the last update to be compatible with google's closure compiler and things like browserify or webpack that can greatly optimise the size of your code. Could be wrong though.
- srpablo 10y agoWhile I love Elm, after the recent release that replaced Signals, it's going to take a long time for me to bet anything with money on it. My toy app didn't have many dependencies, but when so much breaks on upgrading the runtime it's a hard sell. (Not to disparage the change or the work behind it! I think it was the right call, and again, love the language and community. Just expressing, after the last experience, that I'll wait until 1.0 since the language is still undergoing drastic changes)
- meddlepal 10y agoIsn't this basically the same strategy every challenger technology takes to replacing an incumbent one? The problem is your organization has to be willing to bet on Elm as a tool. What does the org do if you leave, get sick, or are terminated? In many ways choosing niche technologies with esoteric syntax or paradigms is like holding your organization hostage IMO. Now does that mean nobody should ever choose a new language or other tool? No, but the cost of adoption needs to be evaluated. I use Kotlin where I work right now and I had to address the same questions initially. The argument for Kotlin was that it's not that different than Java and most good Java developers can pick it up easily OR Scala developers (though they might do that begrudgingly...).
- innocentoldguy 10y agoI've never been a fan of doing front-end web programming because of my distaste for Javascript. Elm solved that problem for me. I like the syntax, type checking, and I've never had any code that passed the Elm compiler error out on me in production. I also like the functional programming aspect of Elm, and the syntax is quite nice (similar to Haskell, only smaller and easier to learn). I found this site useful for getting started with Elm 0.17: https://www.gitbook.com/book/evancz/an-introduction-to-elm/details https://www.gitbook.com/book/evancz/an-introduction-to-elm/d...
- fiatjaf 10y agoBy Elm you mean that language that changes all its core functionalities[1] every day? I've tried it some months ago, now when I was about to try it again in a new project, I discovered everything I had learn is useless. [1]: http://elm-lang.org/blog/farewell-to-frp http://elm-lang.org/blog/farewell-to-frp
- danappelxx 10y agoThe idea is really still the same, just the naming and structure changed a little bit. I'm not sure why he labeled it a farewell since the core concept is the same. Either way, it's not like it changes every day - it just hasn't left beta yet. This change is definitely for the better, and its usually good to make big, beneficial changes as soon as possible rather than waiting for a 2.0 release.
- rattray 10y agoShocked to see no mention of PureScript [0] on this thread, which is also a Haskell-like language that compiles to JavaScript. PureScript has the notable advantages of generating mostly-readable JavaScript and working in node. [1] [0] - http://www.purescript.org/ http://www.purescript.org/ [1] – http://try.purescript.org/ http://try.purescript.org/ – click "Show JS Output"
- rattray 10y agoHere's an example of a PureScript React application: https://github.com/ethul/purescript-react-example/blob/master/src/Main.purs https://github.com/ethul/purescript-react-example/blob/maste...