Live data from Hacker News

Ask HN: Anyone Using Elm in Production?

news.ycombinator.com

11–20 of 74 posts

Re: Ask HN: Anyone Using Elm in Production?

#13

Yes. The deeply nested components thing isn’t an issue at all. You build “components” as stateless views. It’s fundamentally the same as building an application out of all stateless components in redux. Your model (the central state) becomes larger and more complex, but the size of your update function doesn’t expand as much as you’d think. Meanwhile, the benefits from type-safety, pure functions, and extremely well-…

What is meant by "deeply nested components" and why can't you do them in Elm?

I think “deeply nesting components” means dropping a stateful component (view+behaviour+state) anywhere in your app without anything else changing. That’s not possible in Elm since the only place to store state is the central state storage. Which makes perfect sense, but often freaks people out, since it’s an uncommon design constraint.

Re: Ask HN: Anyone Using Elm in Production?

#15
post #7

I'm curious what Elm offers that cannot be done in TypeScript.

You can do way less in Elm than you can do in TypeScript. Counterintuitively this makes your code much more robust.

Elm is far more opinionated. There is only one framework you can use. The type system is much stronger with no escape hatches. It is impossible to mutate variables. Interfacing to javascript is much harder, and there is only one way to do it, and any results coming back from javascript have to be checked and handled to ensure it is as you expect.

Re: Ask HN: Anyone Using Elm in Production?

#16
post #3

What exactly does elm offer?

Adding to others, with disclaimer that I haven't built a large application yet so these are relative newbie comments:

1. An amazingly helpful compiler. The best I've come across for identifying problems, describing them in a meaningful way, and suggesting how to fix.

2. A wonderful synergy between language and architecture. Various others have copied Elm's model-view-update architecture (React, F# SAFE) but as they're libraries, they don't feel quite as well-integrated.

3. An excellent, helpful community.

4. A BDFL in Evan who is focused on considered design and careful evolution over "move fast and break things". Some will (rightly) challenge if this is good: Elm 19 broke a lot in 18. For me personally, I much prefer Elm's thoughtful, well-considered evolution over the volatility in the wider javascript ecosystem

5. Some nice libraries. Elm-ui, for example, provides a different way to do lay out (no CSS). Again that's not for everyone - but useful if you're not a CSS guru.

6. Strong static typing with powerful type inference.

There are definitely downsides. The full-on, no-compromises immutability means there's some overhead in dealing with e.g. http request/responses or js interop. But there's corresponding value in the resulting guarantees in the code.

As a newbie I'm really taken with Elm; it's a refreshingly stable and integrated enclave in the otherwise volatile front end space. YMMV of course

Re: Ask HN: Anyone Using Elm in Production?

#19
Elm made me hate working with Javascript in my job, and the differente is brutal. I don't believe in silver bullet but this is the domain where Elm shines: frontend development. I love every aspect of it. Elm is a very simple language, generates very small assets with a really fast compiler, gives us guarantees of no runtime exceptions in production, easy refactoring (in JS it would be a nightmare), has a time travel debugger (that shows your application state in any given moment), nice compiler error messages, and an incredible architecture which inspired redux (TEA) but is much better and simpler. There are problems ofcourse, for example not every Web API is covered yet, but it's possible to use Js ports to communicate with Elm.
Post reply on HN