Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
What I've learned since quitting Elm (qiita.com)
98 points by ff_ on Aug 26, 2018 | hide | past | favorite | 79 comments


Upon reading the post, I realized how click-baity the title really is.

There’s only a brief statement about Elm, in the beginning, describing why the author has quit using Elm, and then:

> In this post, I'll just highlight some of the most important things I've learned since the beginning of 2016 by using PureScript.

Quitting Elm has little relevance to what the author has learned about PureScript.

I guess the title could’ve just simply been What I learned in PureScript


You can learn things in one language that you might as easily learn in another. The argument here is that you wouldn't learn these things from Elm.


Anyone getting deeper and deeper into fp is destined to end up with Haskell or purescript. No matter if you start with elm, scala, elixir or reason. Then, of course you work with Haskell for a bit and end up going back to whatever you started with unless your work in PL research or similar


> Then, of course you work with Haskell for a bit and end up going back to whatever you started with

Why do you think that? Haskell sees pretty widespread industry usage these days.


In my experience Haskell is exactly what one of it's creators called it "a DSL for writing DSls". Elm can be viewed as one of such dsl, occam razor focused on web front-end. Otherwise,90% of the time you are stuck in IO along with some really hard to grasp libs to help your pl learnings and rarely anything else


I'm not really sure what you're trying to get at? While, sure, Haskell excels at making (e)DSLs, it's far from the only usage for it. For web development it's quite good as well, a long with a ton of other areas. There are plenty of practially oriented libraries, and at the same time, also plenty of libraries focused on using as much of the advanced type system as possible.


I'm not really sure what you mean by "stuck in IO" but that's a consequence of laziness so it's pretty much unavoidable in FP in general.

As for "hard to grasp libs," I find them much easier to use than C libraries. They're actually quite well suited to certain domains.


This is simply not true.


I think you're mistaking Haskell for Lisp?


> Haskell sees pretty widespread industry usage these days.

Yes, just for one example:

https://www.reddit.com/r/haskell/comments/86cg1u/jobs_obsidi...


Did you have to link to a 5 months old post? :)

Each week some new job gets posted on r/haskell.


I linked to this one because it is relevant to Elm, also because I now work here :)


Reminder that lisps are FP too.


Depends on which lisp and who you ask.

For many, functional programming is just as much about expressive type systems, purity, and immutability as is about robust first-class funtions and higher order functions.

Lisp is like the python version of Haskell (as compared to Java I guess?) It's a rough metaphor but I think it makes enough sense.


I know that many today use "functional" to mean ML-derived languages but that definition is incorrect.

Lisps are not very much like Haskell at all, and have different goals. Which is why today's ML-centric worldview of functional programming so often forgets about them.


JS is a bad lisp


Why do you include Reason? Reason is just an alternate syntax for OCaml which has a "fancy" type system like Haskell or purescript.


Well, typeclasses and monads are not easy to implement in ocaml, to the best of my knowledge


We use monads extensively (with monad syntax provided by the ppx_let extension) and OCaml also has a sophisticated module system that is useful in a similar way that type classes are. I would say type classes and a good module system are essentially incomparable language features though, and programming in Haskell always feels painful to me once you get to a few files without modules.


monads are; there's just no syntactic support for them in the language, so they're a little clunkier to work with than they are in haskell


I am currently employed full-time writing Haskell.


Laziness is a superficially useful anti-feature.

I'd suggest waiting with OCaml until dependently-typed languages become more practical.


This is simply false. One can debate laziness as a default, but pure immutable languages need laziness.


> pure immutable languages need laziness

https://mercurylang.org/

If you put the most valuable thing in the universe inside a box that can't be opened or permeated by any force in the universe--then that thing is no longer valuable. Go find the former #2. If you have a programming ideal and that ideal requires laziness--then you've messed up. You have to conclude that there was something flawed about the ideal.

I'm a lot more confident about laziness being bad than about what you're thinking of as "a pure immutable language" being bad, but part of the problem about laziness is that it's a feature apart from the language it's in. If you implement a cache with a hash table in any normal language, then you can later on check and see how much data you have cached, keep track of your cache hit rate, empty the cache, pre-load your cache from a previous run, and so on. To work with your cache, you have the language itself at your disposal. If you implement a cache with a lazy list in language X, then language X can't help you. You'll need to hope that whatever Gods dangled laziness before you, also have some tools dangled elsewhere.


> If you put the most valuable thing in the universe inside a box that can't be opened or permeated by any force in the universe--then that thing is no longer valuable. Go find the former #2. If you have a programming ideal and that ideal requires laziness--then you've messed up. You have to conclude that there was something flawed about the ideal.

Not at all what I am talking about.

Please consult the literature on the subject and then we can continue this conversation as equals.


> I'll just bet that you haven't read anything, because you disagree with people I think are, like, super-duper smart :)

Maybe if I read enough Foucault, or drink enough bleach, we'll be able to continue this conversation as equals :)


> I'll just bet that you haven't read anything, because you disagree with people I think are, like, super-duper smart :)

It is quite obvious from what you have said you are not aware of the literature surrounding laziness.


Please do not cross into incivility regardless of how wrong someone is or you feel they are.

https://news.ycombinator.com/newsguidelines.html


Yeah, there's no amount of bigoted "Haskell uber alles" posturing that can replace a simple, supported argument. None of the reading you think you've done, and I haven't, has succeeded in distinguishing your output from that of a complete poser.


Please don't become uncivil on HN, regardless of whether the other person started it or did worse.

https://news.ycombinator.com/newsguidelines.html


Why do you think so? I don't even remember the last time that I used lazyness myself. Not to mention that there are other pure functional languages (such as Idris) that are strict.


You can consult Okasaki's thesis (regrettably it is somewhat out of date) for a list of functional data structures. Some of them are lazy, some of them are strict. But being able to use all them is essential to getting good asymptotic complexity.


Qiita is a really interesting Japanese alternative to StackOverflow. It's rare someone writes something in English, but fun to practice your Japanese and technical Japanese is often cleaner and easier to understand than written or heaven forbid spoken colloquial Japanese.


Oh I guess that explains why the 'break-word' word-wrapping. I thought it was an odd choice!


Yeah, I was losing my mind trying to read that. Now it makes sense in context, but still.


To me it looks more Medium-like, not Stack Overflow Q&A form.


It's more of a 'Medium for tech' than StackOverflow. The Japanese equivalent for SO would be teratail [0]

[0]: https://teratail.com


I feel like I went through all of the same frustrations as the OP starting from Elm. It's a fun language, but the restrictions the bdfl puts in place make you quickly outgrow it.


I'm using elm so I don't have to learn any of these things. I enjoy knowing almost all parts of the language. Also, in 95% of the cases, it provides enough flexibility to solve the task at hand.


The problem is in the last 5% though. If Evan thinks it's a bad idea or requires more thought, you literally can't do it. The websocket package is currently being held hostage because he wants to improve the API. Since you can't include native code even in private projects now, you can't fork and fix numerous bugs that have an open PR for 2 years+. That means I have to stick with 0.18 which has several compiler bugs because 0.18 is not gonna get a bugfix release.


I don't think it's 5% though. In my feeling it's like 30%. File stuff alone is huge. How about localStorage and other web stuff (yeah websocket and friends)

Anything port talks to is NOT Elm. Any custom element is also NOT elm. I really like some smart people in Elm community, they are kind. But I think they are like 3% of all. The real problem is development process and communication.


> The real problem is development process and communication.

Agreed. It's a non-open-access open source project.


I agree, this is definitely a problem, especially for more ambitious use cases. I've done quite well without e.g. typeclasses, though.


I say keep Elm weird, and simple. Just use socket.io with ports and chill.


I don't know if you inteded this, but in many contexts telling a person to "chill" is implicitly insulting.

You may find it distracts from whatever technical point you were trying to make.


Fair point. I'm just saying, maybe don't get too hung up on it. Just use ports and move on. I don't see why this is ever a big deal with Elm.


Right now, “Elm is Bad” is the new “Javascript is Bad”. It’ll blow over when it gets trendy to whine about something else.


It's a good demonstration of how nobody can resist a good lynch mob no matter how ridiculous the topic.

It's absolutely hilarious how Elm of all things was the #1 enemy of HN the last couple days. A language just about nobody uses (except me).

Yet suddenly everyone is just three degrees away from someone else who was irreparably wronged by Elm's creator. People coming out of the woodwork to show that they, too, are offended by such reprehensible behavior like removing a couple features from a programming language.

Web developers are literally the most oppressed people on the planet. This Evan guy messed with the wrong motherfuckers!


What's even MORE hilarious, to me, is how Elm was the #1 Best Thing Ever for about a week sometime last winter, which is why I got into it in the first place.

It's a great language. The community has been nothing but stellar to me - a complete novice at not just FP, but also JS and web in general.

The entitlement is unreal. "How DARE you create this great free thing, and have the AUDACITY to make it work the way you want it to?!"


On the contrary, I read the referenced post like: “keep Elm weird” as a play on “keep Austin weird” (Portland, etc.) and thus chill came across as more of a “Netflix and Chill” sort of “don’t worry about it”.

Someone’s always going to get bent out of shape (<— I expect I’m creating a demonstration of that right here) with language usage, but please don’t write like a computer when talking with humans so as to avoid these sorts of remarks.


“chill” coming across as “Netflix and chill” would still be squarely in the offensive manner of its usage though — the presumption that the parent comment was too tightly wound or something, and thus needs to “chill” (relax in some capacity). It undercuts the parent comment.

It’s kind of like interrupting someone when they are trying to make a point that is important to them by saying, “hey, you’re having a bad hair day” and then acting like this shouldn’t impact the confidence they have in their point.


"Just use javascript" to workaround the many language limitations then? :D

In that case, why not use typescript for everything? Being pure is nice and all but it's not a goal in itself, especially if the language is extremely limited as a result.


Being pure is nice, and you don't have to compromise if you use GHCJS + Miso or PureScript + whatever.



That's cool.

I've quickly learned that I much more enjoy scrapping redundant code and relying even more on the type system, with things like Higher-kinded types, GADTs, etc.

Elm for me fills the niche of stepping stone into Pure FP (pure as in purity). It's a language I would be able to convince my coworkers to try out, and once they've gotten their feet wet, they can move onto PureScript or GHCJS.

The reason why stopping at Elm, IMHO, is bad, is that it does not foster innovation and trying out things, but restricts itself purely to the subset of what the core team has discovered/learned. This makes it impossible to try out new exciting things like this "A proof-of-concept UI library based on the incremental lambda calculus"[0] that does away with the need for VDOM diffing, and other interesting things.

Don't get me wrong, there is certainly appeal to having a simple language that everyone can quickly master (like Go), but it isn't the be all end all.

[0] https://github.com/paf31/purescript-purview


I mainly use Elm these days because it does exactly what it says on the tin: it helps me build robust client-side applications and fight off technical debt, which is a harder problem to solve than accumulating abstractions.

It's kind of like how Java and Go are shitty when all you want to do is masturbate over clever solutions, but there's something to appreciate about them for that same reason.


Not to mention it actively removes features that are heavily used. An egregiously disrespectful way to treat your library authors and community members, frankly.


"I've never used generics, and I've never missed them"


Haskeller here. I don't want to use Elm myself, but I think this is really unhelpful. Elm is bringing new people to static functional programming environments that emphasize immutability, purity, algebraic data types, pattern matching and a lot of other great features. Yes, writing serialization instances by hand over and over is a huge drag, and like, there is a better way. But the better way doesn't need to include condescending mockery.


Why is everyone talking about some email client from the early 90s. Switch to pine if you don't like elm.


Man I need to do a sudo apt upgrade on my brain: I read the title and thought he was talking about ELM the email client, and was like: yeah, we all stopped using that in the early 90's when zmail showed up.


Every single Elm language thread there exists at least a person makes joke of ELM email client. And then somewhere there exists Elm developers make fun of those people.


i'm new here and learning that HN is more serious than /. or reddit. probably because people here refrain from posting obvious / useless comments like mine. getting the hang of it...


I'm also new :) and didn't intent to discount any comment (it's not useless)

I agree that HN is quite serious, that's why I rarely comment. I'm actually a fun person lol


Lies. Elm users switched to mutt.


I used elm until late-90s when Y2K looked likely to end it. What I've learned since quitting elm is that mutt was better at processing large mailfiles, and then Apple Mail is easier to automate with AppleScript.

This "Elm" is some sort of JS precompiler, claiming a better program's name? Join the post-ES6 scrapheap with CoffeeScript, TypeScript, and every other joke precompiler. Write JavaScript in JavaScript, and if it's not sufficient, file bugs on ES6/7.


Same thing happened to me when slack turned up and I was still using slackware.


OK, thanks for letting us know your thoughts on this.


OT: I’ve never seen this before, but for some reason when reading this on my phone the line breaks are... anywhere. In the middle of words in places that make no sense.

“... spare time trying o

ut Elm, to render...”

It’s basically unreadable without Safari’s reader mode.


Cause:

    word-break: break-all


It certainly did break-all of it!


For some reason he has word-break: break-all in the css


>To prevent overflow, word breaks should be inserted between any two characters (excluding Chinese/Japanese/Korean text).

I assume this is normally a Japanese language site.


The "word-break" property is set to "break-all" on paragraphs: https://developer.mozilla.org/en-US/docs/Web/CSS/word-break


Same on firefox, desktop. Call me shallow but I wont read an article on programming from someone who spends their time tweaking css, poorly.


It happens in Chrome on Linux, too.


Same on desktop/Firefox. Yikes.


click the "reader view" icon (ctrl-alt-r)


You tricked me. I thought this was about the email client named Elm.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: