5 ms·
I have been writing Elm for 5 years now. I work at Humio, where our front end is 100k lines of Elm code. What would you like to know? I love Elm. I'm absolutel
by Chadtech_Real 7y ago
I have been writing Elm for 5 years now. I work at Humio, where our front end is 100k lines of Elm code.
What would you like to know? I love Elm. I'm absolutely hooked. I don't want to go back to doing Frontend work in JS, and I hope one day there can be an Elm-like experience for backend development as well.
Just off the top of my head a few bits of what I like about Elm:
- You can actually write code, have no errors, and then move on, and never return to the project again. When I was doing JS, everyone I knew just took it for granted that you would be maintaining everything you ever wrote for the rest of your career. Not with Elm! You can actually finish projects and never return to them.
- Its a simple and small language that is designed to interact with human beings. The compiler really talks to you instead of spitting out error codes or spaghetti. Apis and variables have human readable names instead of mathy terms of symbols.
- For everything theres one way of doing things and the one way is usually really good. This strong consensus orientation of the Elm community means everyone is speaking the same language about every problem.
Gotta go, bye.
- excursionist 7y ago> I hope one day there can be an Elm-like experience for backend development as well. Haskell?
- ronanyeah 7y agoUnfortunately there is a large gap between the developer experience of both ecosystems.
- Chadtech_Real 7y agoThey are pretty different. They have similar syntax, and their type systems are similarly strong, but beyond that they are pretty different. Haskell has a huge syntax and a ton of language features. It has a big ecosystem. Haskell is very mathy. Elm is the opposite in each of those regards.
- owl57 7y ago> You can actually finish projects and never return to them How do you manage that? Migrating from 0.18 to 0.19 wasn't hard in my limited experience, but it wasn't "finish and never return" either.
- Chadtech_Real 7y agoI dont even think upgrading to 0.19. If you have 0.18 code that works, why upgrade? I think NoRedInk has some very old versions of Elm still in production, like 0.16 or something.
- rtfeldman 7y agoYears ago we had some 0.18 and 0.16 code coexisting, but last year we updated everything to 0.19!
- ilumanty 7y agoHow is your experience with more "advanced" stateful interactions such as drag&drop?
- Chadtech_Real 7y agoGood. I have written drag and drop functionality in Elm a few times. I have a clear enough idea on how that code looks that if I had to write a drag and drop today, I think I could crank it out quickly. You call it stateful tho. I dont know that drag and drop needs to be all that stateful. For drag and drop, the information your model needs is whether you have mouse-down-ed on something, the coordinates on the html element you mouse-down-ed, and the coordinates the mouse's current location is. 2 pairs of coordinates and a maybe type? Not too bad. I guess there is the code too, but at least the data is just few values, and not a complex and nested data structure. On my team at work, we avoid state. Complex nested state is a big code smell for us.
- no_wizard 7y agoI'm curious if you tried out ReasonML[0] at all, for any length of time, before Elm, or even after. https://reasonml.github.io/docs/en/what-and-why https://reasonml.github.io/docs/en/what-and-why I've really been digging slowly into ReasonML and the biggest gain I can see is that valid reason === valid ocaml (and there's some good server libraries out there for ocaml) I also like that JSX is the templating language, not that it matters. Also, have you had any success with manipulating Elm to output static HTML/CSS as well as JS? I know it can do it, but I've never been able to manipulate how it does it (most recent version I tried with: 0.18)
- Chadtech_Real 7y agoI havent actually written any ReasonML, but I once had to review some my former coworker wrote. Thats the extent of my ReasonML experience, so I dont have much of an opinion. However, I was surprised that the ReasonML code I looked at relied on impure functions. I like pure functions so that scares me off a bit from the OCaml as a whole. Regarding static html/css, I havent done that either, so I dont know about it.
- yawaramin 7y ago> the ReasonML code I looked at relied on impure functions. I like pure functions so that scares me off a bit from the OCaml as a whole. ReasonML (OCaml) allows impure functions but the best practice is to stay pure whenever possible. It's a very pragmatic language so despite providing all the functional and immutable programming features, it allows you to cut through the bureaucracy if you need to.
- SupremumLimit 7y agoOne way to get static HTML/CSS from Elm is to execute the JS it produces and serialise the results from the DOM. That's what I do in my static site generator Elmstatic: https://korban.net/elm/elmstatic https://korban.net/elm/elmstatic