Live data from Hacker News

Learning Elm by porting a medium-sized web frontend from React (2019)

benhoyt.com

91–95 of 95 posts

Re: Learning Elm by porting a medium-sized web frontend from React (2019)

#91
post #83
post #71

Earlier quoted context omitted.

For anyone new to Elm, please know that you have a stable language with no major changes since 2018 and no official release since end of 2019, see https://iselmdead.info and decide if that is a bad or a good thing for you. And if you are thinking of starting now, you should not focus on what undocumented feature (or hack) was taken away in 2018 that allowed injecting arbitrary JavaScript code that easily broke all gu…

The "no updates for past five years" is my favourite feature of Elm. I have some five or so projects written in Elm and enjoy every time I don't have to upgrade them because no new version was released!

That's high on my list, too.

The only fear I have is that I won't be able to install packages that no longer exist when I switching machines.

But by running

  ELM_HOME="$PWD/deps" elm make ...
I can get those downloaded into the directories and add them to the VCS.

Re: Learning Elm by porting a medium-sized web frontend from React (2019)

#92
post #88
post #64

Earlier quoted context omitted.

In my case, it was a regex supplied by the user. Elm 0.18 had no support for constructing a regex at run-time. So I made a package that wraps native RegExp. When 0.19 was released, I couldn't upgrade because of those 5 lines. The regex package eventually got regex.fromstring(). So I could've upgraded. But at the time I was bumping against limits accessing Intl and I really hated the prospect of begging some maintaine…

> So I made a package that wraps native RegExp. When 0.19 was released, I couldn't upgrade because of those 5 lines. The regex package eventually got regex.fromstring(). So I could've upgraded. The last commit to the regex package was in May 2018, and Elm 0.19 was released later in August. https://github.com/elm/regex/commits/1.0.0/ So it seems like by the time of the official release you could have replaced your fiv…

Thanks for the correction regarding the Regex timeline. Git commits are generally more reliable than my memory.

Re: Learning Elm by porting a medium-sized web frontend from React (2019)

#93

Earlier quoted context omitted.

I’ve been working with Go for 10 years and I have no idea what you mean by maps being generic before generics came along, nor did maps ever cause me to have over-verbose code bases. The links didn’t seem to help.

Trying to summarise what they were likely saying: Not having generics makes code verbose because you end up copying and pasting your library code to make it handle different types. The complaint about maps being generic was that the Go team clearly saw a need for generics (as they implemented them for maps and some other types) but decided that others wouldn't need them. So they had one rule for them and another rule…

How were maps generic before generics, I am not sure I understand. Didn’t you still have to declare them as map[type1]type2?

Re: Learning Elm by porting a medium-sized web frontend from React (2019)

#94

Earlier quoted context omitted.

Trying to summarise what they were likely saying: Not having generics makes code verbose because you end up copying and pasting your library code to make it handle different types. The complaint about maps being generic was that the Go team clearly saw a need for generics (as they implemented them for maps and some other types) but decided that others wouldn't need them. So they had one rule for them and another rule…

How were maps generic before generics, I am not sure I understand. Didn’t you still have to declare them as map[type1]type2?

So when something is generic, it means it is a type parameterized by other types. So the type map[string]int is indeed generic, but no language users could create their own type btree[X]Y, for example.

Essentially, the go developers saw a need for generics and then decided that only they get to create them, where most modern language developers either make them available for everyone to implement or don't add them at all.

Re: Learning Elm by porting a medium-sized web frontend from React (2019)

#95
I'm interested in applying Elm principles but in a standard React and Typescript app. Anyone have experience doing this?

It looks like redux has some inspiration from Elm, but I think the way effects are handled in Redux isn't as predictable as Elm.

Post reply on HN