News for hackers. Stuff that matters.
Re:Why Elm? [pdf] by antouank on Monday May 08, 2017 @04:15PM (#14295185)
Been using Elm for a few months now. Both in small side projects, and in a production app for work.

Many benefits over using js, and basically no downsides apart from the initial learning curve. And even that could be equal to the learning you have to do every time your team decides to add/use a new foo.js library or framework to the project.

With Elm:

  - you are confident about your code 
  - others ( and your future self ) can actually read it and understand it
  - it pushes you to think before you write
  - refactoring is a breeze, not a nightmare
I hope I won't have to use js on my next gig.

edit: Also, I cannot speak highly enough about how helpful the compiler is, and the community in the slack channel. Makes the whole experience a joy.

Re:Why Elm? [pdf] by ChemicalWarfare on Monday May 08, 2017 @04:32PM (#14295329)
+1. Totally digging Elm as well. Learning curve is pretty minimal, although I've spent some time "playing around" with Haskell which helped.

Love how structured things are and even though Elm is an "in progress" kind of thing - still no left-pad or js fatigue type issues (unless you really try to make them happen).

Re:Why Elm? [pdf] by savanaly on Monday May 08, 2017 @04:49PM (#14295467)
Have you been using outside libraries that were written in javascript on these projects?

I always anticipated that would be a downside of using Elm. I know there must be hooks to let you integrate pure javascript (jQuery-type) libraries and widgets into your app, but wouldn't it be really annoying?

I'm writing Angular apps these days and one of the most time-consuming tasks is this sort of integration (for instance, right now I'm trying to add FullCalendar [0] to an app), and it doesn't work so nicely with the digest cycle of Angular, or play nicely with how data is passed around. And Elm is even more alien to javascript than a javascript app using Angular would be to javascript. So how is this area for you?

[0] https://fullcalendar.io/

Re:Why Elm? [pdf] by antouank on Monday May 08, 2017 @05:40PM (#14295872)
Not really.

I guess my approach is different. I only use a library when I have to, meaning that it's of "high quality" and it will save lots of time. Otherwise, I'd rather implement the feature myself, so I know the code and I can extend it later.

In that sense, Elm covers me completely. There are many small good utility libraries to use, but I only use 2-3 of them. And most of them, you can read the code, quickly understand what it does and pick the code you want to use in your app.

Re:Why Elm? [pdf] by minikomi on Monday May 08, 2017 @11:20PM (#14297499)
As an open question to yourself, or anyone else advocating elm heavily, can you show something cool you've built using the language? That would be the most convincing argument!
Re:Why Elm? [pdf] by _greim_ on Tuesday May 09, 2017 @12:41AM (#14297782)
I don't spend a lot of time advocating, but here are my first two attempts at building stuff in Elm.

https://greim.github.io/elmsweeper/

https://greim.github.io/electron-golf/

Honestly I think it would have been easier to build the first iterations of these in JS (React or something) but with the second->nth iterations, it became easier with Elm.

Re:Why Elm? [pdf] by minikomi on Tuesday May 09, 2017 @04:49AM (#14298560)
I'm seeing a lot of simple games on the built with elm site - do you think that's a sweet spot for using elm?
Re:Why Elm? [pdf] by _greim_ on Tuesday May 09, 2017 @10:29AM (#14300270)
Not sure, maybe.

A lot of it might be that simple games are fun and relatively easy, so well suited for learning new stuff in your spare time.

Then again, the electron golf game re-renders SVG DOM at 60fps. Building web apps that way hadn't occurred to me until React came along, and I didn't attempt it until Elm.

Re:Why Elm? [pdf] by nagyf on Tuesday May 09, 2017 @03:03AM (#14298240)
Very nice, thanks for posting
Re:Why Elm? [pdf] by antouank on Tuesday May 09, 2017 @02:53AM (#14298197)
Would this help?

http://builtwithelm.co/

Re:Why Elm? [pdf] by minikomi on Tuesday May 09, 2017 @04:36AM (#14298523)
Interesting. Almost every site with multiple pages I visited had a lot of weird behavior when using browser back/forward.

There's a lot of snake games, tic-tac-toes and 2048 clones -- I was looking for more along the lines of multiple page apps where elm made it a lot easier to build, and stories thereof.

Re:Why Elm? [pdf] by boubiyeah on Monday May 08, 2017 @04:33PM (#14295333)
That's just dynamic vs static typing though :p
Re:Why Elm? [pdf] by antouank on Monday May 08, 2017 @04:36PM (#14295355)
You can say that.

But, I also tried to learn and use OCaml and Haskell in actual projects. They are nowhere near as friendly and approachable as Elm to beginners.

Re:Why Elm? [pdf] by StreamBright on Tuesday May 09, 2017 @03:35AM (#14298335)
Well comparing Elm to OCaml or Haskell does not make too much sense. OCaml is a 20 years old multi-paradigm, general purpose language that is extremely useful for so many things (writing compilers for example) while Elm is a domain-specific programming language to be used in the browser. Apples and oranges.
Re:Why Elm? [pdf] by antouank on Tuesday May 09, 2017 @04:12PM (#14303429)
I didn't compare them in that sense. I only compared how easy it is to get started with. They share some concepts, like being functional languages and having good type systems.

Elm definitely helped me understand many concepts in OCaml and Haskell. But to go beyond that, it's difficult.

Re:Why Elm? [pdf] by KurtMueller on Monday May 08, 2017 @04:53PM (#14295500)
Elm is definitely in my future - in fact, many of the ML based languages are as well: Purescript, Haskell, F#, ReasonML, etc. Elm will be and is the gateway to all of that because it gives you only 1 path to traverse and tries to set up all the initial sign posts along the way.