Live data from Hacker News

A nice app on Elm street

madewithlove.be

71–80 of 84 posts

Re: A nice app on Elm street

#71
post #57
post #52

Earlier quoted context omitted.

That's interesting. How does Elm statically know if the logic of your app is correct? Since I don't know Elm I'll use some pseudocode: if condition pourCoffee() else pourTea() Is Elm able to determine that this condition is flipped the wrong way?

Neither Elm, nor any language in the Typed FP family, can do that. What it can do is to prevent us from making clerical mistakes. That's the surprising thing I learned programming in Typed FP: we very rarely make logical mistakes. Our programs are all broken, make no mistake, but they are broken not because we accidentally swapped a conditional (logical mistake), but rather because we passed in data of the wrong shap…

> Neither Elm, nor any language in the Typed FP family, can do that.

I didn't think so. So claims like:

> In my experience, Elm code is only ever in a state of "horribly broken, won't compile" or "works".

Which I find to be pretty common among fans of strongly typed functional languages, is incorrect.

Re: A nice app on Elm street

#72
post #35
post #29

Earlier quoted context omitted.

T.b.h. this is the reason why I will probably stay messing around with either PureScript or ReasonML but stay away from Elm.

Yeah, I balked at changing my apps to be 0.19 compatible. Now I'm kind of just "getting along" with 0.18 until I can do more of my front end work in Phoenix LiveView.

Complaining about unstableness, while chasing fads. Thoughts and prayers are with you ;)

Re: A nice app on Elm street

#73
post #7

How does Elm compare to ReasonReact?

To me the biggest difference is that [Reason]React focuses on components which encapsulate state, while Elm focuses on data structures and pure stateless functions. Both approaches have pros and cons. You can design a [Reason]React app similar to an Elm app, if you use pure stateless components exclusively and handle your state with few reducers, but you won't get the same smooth experience which you get with Elm. I still favor React though. React's component interface adds some friction and complexity, but it's also a nice abstraction which helps a lot with code sharing, especially when sharing with third parties. Thus the striving ecosystem (UI frameworks, UI builders, etc.) in React.

I made a round trip over the last years from React/TS to Elm to ReasonReact back to React/TS. React/TS is the least attractive, but it's the one I get most done with. Plus the situation in React has gotten much better since Hooks, PureComponents, Context API. I'm glad the mess with class components is finally over.

Re: A nice app on Elm street

#74
post #57
post #52

Earlier quoted context omitted.

That's interesting. How does Elm statically know if the logic of your app is correct? Since I don't know Elm I'll use some pseudocode: if condition pourCoffee() else pourTea() Is Elm able to determine that this condition is flipped the wrong way?

Neither Elm, nor any language in the Typed FP family, can do that. What it can do is to prevent us from making clerical mistakes. That's the surprising thing I learned programming in Typed FP: we very rarely make logical mistakes. Our programs are all broken, make no mistake, but they are broken not because we accidentally swapped a conditional (logical mistake), but rather because we passed in data of the wrong shap…

Expanding slightly, Elm (as well as others in this family), can create structures that assert certain rules. In the case of a list being empty, you can also use ADTs to create nonempty version ala `type NonemptyList a = NonemptyList a (List a)` where it's impossible to construct without that first element even if the second list is empty. A lot of languages lack this sort of feature. Then you can go about your code knowing you neither have to handle empty nor write a bunch of tests because empty construction is impossible and this is enforced by the compiler.

Re: A nice app on Elm street

#75
post #74
post #57

Earlier quoted context omitted.

Neither Elm, nor any language in the Typed FP family, can do that. What it can do is to prevent us from making clerical mistakes. That's the surprising thing I learned programming in Typed FP: we very rarely make logical mistakes. Our programs are all broken, make no mistake, but they are broken not because we accidentally swapped a conditional (logical mistake), but rather because we passed in data of the wrong shap…

Expanding slightly, Elm (as well as others in this family), can create structures that assert certain rules. In the case of a list being empty, you can also use ADTs to create nonempty version ala `type NonemptyList a = NonemptyList a (List a)` where it's impossible to construct without that first element even if the second list is empty. A lot of languages lack this sort of feature. Then you can go about your code k…

Sometimes I wonder whether Alan Perlis would mock at us for being Bible salesmen for Typed FP languages.. yet it is such a quality-of-life upgrade and a thinking tool that it feels justified to shout from the rooftops :)

Re: A nice app on Elm street

#76
post #57

Earlier quoted context omitted.

Neither Elm, nor any language in the Typed FP family, can do that. What it can do is to prevent us from making clerical mistakes. That's the surprising thing I learned programming in Typed FP: we very rarely make logical mistakes. Our programs are all broken, make no mistake, but they are broken not because we accidentally swapped a conditional (logical mistake), but rather because we passed in data of the wrong shap…

Just want to give props. This is the clearest explanation of the value of typed FP I've ever seen.

:)

Re: A nice app on Elm street

#77
post #31
post #29

Earlier quoted context omitted.

T.b.h. this is the reason why I will probably stay messing around with either PureScript or ReasonML but stay away from Elm.

Why exactly? Elm 0.19 is out on August 2018, and the only thing that's expected is 0.19.1 which barely changes anything (doesn't break any api). Seems like 0.19 is quite settled at this point.

Ok, I should have said 'one of the reasons' ... and maybe there is a better road-map, but I was dabbling with Elm around 0.16, and then watched 0.17 change a bunch of stuff I liked to bunch of stuff I didn't care about as much and I decided to stay away for a while.

But if it looks like we would be on 0.19.x for few years to come, I might dip in it again ... it's not like I ever published anything in Purescript or ReasonML and I never used Elm in anger, so it is probably just a matter of time til I jump in again :)

Re: A nice app on Elm street

#78
post #44

I like Elm as a language, but the community is extremely toxic, and it's not production-ready yet (version < 1.0, one-person project). Too bad, because it's a great project.

> not production ready (version This is FUD. Elm is being used pretty successfully in production.

This is not FUD. Using it in production is a risky bet. And I say that as someon using Elm in production. We use it in a short-term, demo project. The project was started using version 0.18. Now we're stuck, either we rewrite huge parts of the app (and we don't have time for that), or we're stuck with older versions of the libs.

This is not something you can afford to do with a long-running, critical app, or at least you have to know you're taking some risks. It's a tradeoff.

Also, what would happen to Elm if the author suddenly died?

Re: A nice app on Elm street

#79
post #44

I like Elm as a language, but the community is extremely toxic, and it's not production-ready yet (version < 1.0, one-person project). Too bad, because it's a great project.

can you site some sources for the “extremely toxic” community? genuinely curious

I've seen people banned from official forums because they disagreed with design decisions. And several threads locked with messages like "oh yeah, haha, we don't really want you to talk about that" (https://discourse.elm-lang.org/t/elm-0-19-released-what-has-... for instance)

And the github forum rules are a little "threatening" (https://github.com/elm/forum-rules/blob/master/README.md).

Re: A nice app on Elm street

#80
post #44

I like Elm as a language, but the community is extremely toxic, and it's not production-ready yet (version < 1.0, one-person project). Too bad, because it's a great project.

Anecdote to counter your anecdote: I don't find the Elm community to be toxic at all. Pretty much the opposite.

Great! That's a very subjective opinion anyway.
Post reply on HN