1. 51
  1.  

  2. 10

    I am ashamed to admit that, while Haskell is still my favorite language, after stopping working with the language for a few years, my programs have become essentially unreadable and maintainable for me :(. I no longer understand the basic concepts such as Monads and Monad Transformers, and SYB which I understood reasonably well when I was using them (I still understand the concepts, but not well enough to code with them). It probably says much more about my limits than about Haskell as a language though.

    I can still read and understand my programs in pretty much all other languages from a decade back (though I cringe in shame looking at the code).

    I wish I could get back to Haskell one day.

    1. 6

      If you get back into it it’ll come back to you. I doubt it says anything about your limits. Time just makes us forget things when we aren’t doing them, when we do them we regain access to those memories again with time. Those other languages are likely similar to the language you use in your day to day. Functional programming isn’t any more complex than object oriented programming, it’s just different. OO patterns can (and do) make functional programmer’s heads spin too :).

      1. 2

        Thank you for the encouraging words.

    2. 17

      An example of [Haskell’s incredible advancement over other languages] is the concept of resumable exceptions.

      I wonder how Common Lisp managed to pull off resumable exceptions for decades then?

      1. 11

        Your citation makes it seem like they claim only Haskell supports resumable exceptions, but I don’t see that at all in the original. They just state it makes them possible in a convenient way and from the context it’s clear they mean that relative to Go and Java as possible alternatives. So I don’t think you can conclude they are unaware of the history of resumable exceptions and of the fact that other languages support them.

        Even if they were, your comment runs the risk of leading people to disqualify the author and their arguments for this single mistake. I know I was tempted to do so.

        Disqualifying the entire article would be a plain fallacy (a mistake/error should bear upon the other arguments and there are multiple unrelated arguments in this case) and disqualifying the author is also unwarranted: not knowing the entire history of a particular language feature you like and have use for is not a reason to think someone is lacking in relevant knowledge. Knowing the history was mostly irrelevant for the choice.

        Charitably what they say can be read as: “One of the things we liked about Haskell, relative to the viable alternatives, was the easy availability of resumable exceptions”.

        N.B. I don’t mean to imply you intended any of this with your comment; just the first paragraph is a direct response.

        1. 2

          Exactly! Here’s what I wrote on HN:

          During Semantic’s interpretation passes, invalid code (unbound variables, type errors, infinite recursion) is recognized and handled based on the pass’s calling context. … And given Go’s lack of exceptions, such a feature would be entirely impossible.

          Nonsense! It’s completely possible — you just have to be willing to abuse a few of Go’s features in order to do it.

          First off, Go does have a standard calling-context (i.e. dynamic context) mechanism: context.Context. All you need to do in order to track stuff in the calling context is stash an object in the … context.

          Given this dynamic context mechanism, you next need a way to represent handlers. That’s easy: a handler is a function which takes an exceptional condition and either handles it or returns; handling consists of a transfer of control. Fortunately, Go has a control-transfer primitive as well: panic. So to handle a condition, a handler just panics — something higher up the call stack can use defer to catch the panic and continue execution.

          That leads to the next component necessary: a way to provide resumption points, or restarts. A restart is just a function which is invoked by a handler, potentially with arguments, and which when invoked continues execution from its establishment point. This can be done with defer.

          So it’s perfectly possible with tremendous abuse of Go’s panic/defer mechanism, no different from Java.

          See this gist.

          Honestly, I don’t even know if I’d call it tremendous abuse, although it is somewhat abusive. Abstracted in a library, it might even be somewhat useful.

          It’s off-the-cuff — I haven’t fully considered the semantics of the different context objects being passed around.

          If you take a look at the Gist, it’s just a simplified Go version of the concepts involved. It bites that Go doesn’t have macros to clean up some of the nasty nesting involved, but it’s still a workable solution.

          1. 4

            it’s worth being skeptical when someone says you can or can’t do things in a particular language. You can nearly always do anything in any language. It just sometimes gets laborious to do so and you might not desire to, but that doesn’t mean you “cant”.

        2. 9

          In the hope of shifting this discussion from (advertising vs. feeling intimated by) Haskell, I looked through the sources a bit, with the hope of finding those resumable exceptions.

          Starting to pull from the API seems promising; it’s a protobuf API defined in proto/semantic/api/v1/code_analysis.proto, Haskell code in src/Semantic/Api though I haven’t found the actual networking code yet.

          Ah here we go, src/Semantic/Analysis.hs pulls in a number of very abstract stuff from src/Control, and we end up at the fused-effects library. Here’s the documentation for Control.Effect.Resumable.

          1. 11

            Pretty standard “why Haskell?” post.

            That opening sentence is dense enough that you could spend many hours researching the history and merits of things like “purely functional”, “non-strict semantics”, and “strong static typing”.

            We get it, Haskell programmers are smarter than everyone else.

            Reading between the lines, it sounds like the team actually has more experience on infrastructure projects than PL projects. They hand wave away writing infrastructure glue as trivial, but foresee themselves drowning in tech debt implementing the language interpretation in C++, Java, Swift, etc. That tells me they’re confident in writing infrastructure glue, but less confident writing PL code.

            I may be totally off base, but that’s the vibe I got from reading the post.

            1. 17

              We get it, Haskell programmers are smarter than everyone else.

              The odd thing is, I’ve quite often heard people say they use Haskell because they’re not smart enough to ship things reliably in most other languages. I empathise.

              1. 19

                I, for one, consider myself too stupid to not use Haskell.

                1. 5

                  I, for one, consider myself too stupid to use Haskell.

                  An abstraction too hard to understand is just magic.

                  1. 8

                    You aren’t forced to use abstractions that are too hard to understand. You can go a very long way — all the way, in fact — just using simple things in Haskell.

                2. 11

                  I prefer OCaml rather than Haskell but the point is the same. I feel much more relaxed when I write OCaml code compared to C (or C++) code. I don’t have the same anxiety of crashes and corruption issues.

                  In the same vein, I’m currently on a mixed codebase and I’m not able to test the code in actual setups and I’m not at work all 5 days of the week currently. I have to do some bugfixes currently and therefore I code, push on branch and hope for the best. I’m much more confident with my fixes for the OCaml code and they usually just work indeed. The fixes to the C and C++ codebases however will likely be partial or trigger issues elsewhere instead.

                  1. 5

                    I have similar experience with a mixed C#/F# codebase. It is not that the F# code does not have bugs – I create plenty bugs – but in F# there’s a greater proportion of interesting bugs.

                  2. 9

                    I thought the same of myself, but (to add another perspective) it turns out I’m also not smart enough to use many of the libraries on Hackage, or to reliably manage memory usage, so I moved away. I still appreciate and emulate the discipline of its type system when I have to use a less strictly-typed language, though.

                    1. 5

                      I think that’s a pithy (and therefore somewhat imprecise) way of saying that Haskell’s type system lets them encode more correctness guarantees than mainstream languages with less sophisticated type systems, so they feel they can offload more correctness-checking work to the compiler, and therefore don’t have to be as “smart” about reasoning about edge cases to write equally-reliable code. I think that more complicated statement is true enough, but I wouldn’t say that people who are smarter than those Haskell programmers are deliberately choosing to write code in languages with less-strict type systems because they can get away with it.

                      1. 3

                        I agree with you. Full disclosure: writing Haskell is 100% of my income and I say the same pithy line above. I just didn’t want to seem like I’m saying “look at me, I write Haskell, I M smrt.”

                        1. 2

                          I wouldn’t say that people who are smarter than those Haskell programmers are deliberately choosing to write code in languages with less-strict type systems because they can get away with it.

                          I think what you are saying is completely true, the asprin must follow the headache. They don’t desire an escape because they either aren’t pushing themselves to actually build at their ability level or they are naturally gifted and don’t feel any need to offload cognitive weight. It’s not that they are flexing, it’s that they don’t feel the weight. Perhaps some of them don’t really know that things would be easier if they didn’t bear it. I notice people with good working memory don’t write notes and then I’ll go to my notes and be able to “recall” something that they couldn’t. Sometimes a lack of ability leads us to use tools that expand our performance far beyond what any natural ability could accomplish. The palest ink is better than the most powerful memory. Or as I often say “Paper don’t forget”.

                        2. 4

                          I have trouble articulating why, but I find this cliche really condescending.

                          1. 4

                            It might be because the subtle implication is that other programmers are too stupid to realise they aren’t smart enough to have come to the same conclusion.

                            I’ve said essentially the same, but that’s the tone of general discourse. It isn’t reasonable to hold Haskell developers to a different social standard than any other kind of programmer.

                            1. 3

                              I think it’s because you can easily read it as saying “not only am I smart, I am also exceedingly humble.”

                              An attempt at a better formulation:

                              It’s not that I use Haskell because I’m abnormally smart—I’m not—but I was able to take the time to learn it and I love it because although of course there is some complexity and novelty to the language it is also very helpful and nice to have such a strong and expressive type system, so I find myself being able to code with more ease and confidence. Other languages may be easier to learn but there’s a big difference between how fast you can learn a language and how much that language actually helps you in the work of coding especially over time, and there I think the effort of learning Haskell is well worth it, and I feel this clearly almost every time I do some bigger refactoring and the compiler helps me step by step until it’s done.

                              1. 2

                                Would you also feel this way if someone said “I use JavaScript because I’m not smart enough to use other languages?”

                                I think within this feeling that the cliche is condescending is an implicit assumption that Haskell is a language for smart people and not the rest of us. The same statement about JavaScript doesn’t feel condescending because few feel like JavaScript is reserved for exceptionally smart people. So when a Haskell programmer (who must be smart because they’re a Haskell programmer) says they do something seen as reserved for exceptionally smart people (Haskell programming) because they aren’t that smart, where does that leave the rest of us chumps? That’s the condescension, as I understand it.

                                I think what Haskell programmers are trying to say is that they’re not exceptionally smart and Haskell isn’t Mensa for programmers. I saw a tweet recently to the effect of “I am a plumber and when I work with Haskell, I have less leaky pipes”. That’s the sentiment I find in the cliche.

                                1. 3

                                  Would you also feel this way if someone said “I use JavaScript because I’m not smart enough to use other languages?”

                                  I know you didn’t ask me, but to be fair, JavaScript doesn’t have the same elitist/academic reputation that Haskell does. People who don’t know any better think that Haskellers are all geniuses, so when a Haskeller says “I’m not very smart”, it’s interpreted as insincere. If a JavaScript user says “I’m not smart enough to use anything else”, you’d probably not try to call their bluff.

                                  1. 4

                                    That’s exactly my point. That assumption should be addressed explicitly, not emotions downstream from that assumption.

                                    1. 2

                                      The common perception is more or less completely backwards. The person who can write good software in a language that is essentially out to murder them is likely more naturally gifted than the one who needs the language to assist them. Sure some people use languages with a lot of compile time checks because they are hoping to eek out every last bit of effectiveness, but most of us are trying to make the thing work when it runs. In javascript running gives absolutely no guarantees of workingness, that makes things harder, and you have to be better to compensate. A person from my meet up group said it best “F# feels like bowling with bumpers”, and Haskell is no different. If anything Haskell has more bumpers than F#.

                                      1. 2

                                        To clarify: I already totally agree with you.

                                        I’m just also trying to empathise with the people who have this weird negative and emotional reaction to Haskell.

                                        1. 2

                                          oh yeah I wasn’t particularly fighting what you were saying, just saying there’s real javascript wizards out there.

                                2. 3

                                  Yes this is part of why I champion F# so much in the .net space. I don’t have to consider so many things at once and it makes managing my ADHD wrt programming much easier. Less burden on my working memory, and much easier to focus.

                                  1. 2

                                    Yes! When I write Haskell I only have to consider function parameters. I have been diagnosed with ADHD, and I really do have less temporary storage compared to most of my coworkers. That reduction in state space means I can write code with less effort.

                                  2. 3

                                    Yes, that’s the main take-away I got from the post, though I don’t think I fully articulated that.

                                    In my experience, using Haskell forces you to think about your design a lot more, and the language gives you tools to express and validate your design. If you’re not that confident in your design, like if you’re writing something outside of your area or expertise, that would be quite valuable. Especially if you’re going to tweak core elements of your design frequently.

                                    Writing infrastructure glue code is harder than it sounds. It’s difficult to handle all the edge cases, both for correctness and performance. Yet the team seems to have done that with little effort. This further leads me to believe they’re mostly infrastructure people, using Haskell because it’s well suited to the problem they personally find most difficult.

                                    But I stand by my sarcastic comment about the post’s opening paragraph. Common discourse about Haskell is full of humble brags like that. The “not smart enough for other languages” thing feels similarly smug to me.

                                    1. 9

                                      But I stand by my sarcastic comment about the post’s opening paragraph. Common discourse about Haskell is full of humble brags like that. The “not smart enough for other languages” thing feels similarly smug to me.

                                      Damned if we do, damned if we don’t.

                                      I feel there’s not really any approach Haskellers can take when describing the language that won’t be met with the kind of ridicule you find on r/programmingcirclejerk.

                                      We could lie and say it’s just another language, and the differences are no big deal. In that case, there’s no point learning it because we already know JS/Ruby/whatever.

                                      We can say there are truly great ideas in there, and that this makes a significant reduction to the cost of software development over time, to which we are called academics, elitists, and liars.

                                      We can say “yeah, whatever. I like it, and it’s easier for me to do this than most other languages”, and then we get called “smug”.

                                      1. 1

                                        They could have left out the opening paragraph, which added nothing to the post at all.

                                        We can say “yeah, whatever. I like it, and it’s easier for me to do this than most other languages”,

                                        That phrasing is fine with me, I don’t find it smug at all. Is the difference between that and “I’m not smart enough for other programming languages” not clear?

                                        1. 4

                                          That phrasing is fine with me, I don’t find it smug at all.

                                          Do you not hear how arrogant you sound? Like other programmers should care about what phrasing is fine with you?

                                          Is the difference between that and “I’m not smart enough for other programming languages” not clear?

                                          Not really, no. Haskellers constantly receive pithy dismissals, so you should expect to receive pithy responses in return.

                                          1. -1

                                            Like other programmers should care about what phrasing is fine with you?

                                            Sorry, when you replied to my comment I assumed you were talking to me. My mistake, I will let you soliloquize about how you’re so tragically misunderstood on your own.

                                            I hope we’re in agreement on this. After all, if you provide me nothing but pithy dismissals, you should expect to receive pithy responses in return, correct?

                                            1. 3

                                              I want to break the cycle! Less pith more content!

                                              Haskell is really cool and worth learning.

                                    2. 1

                                      Would you think that Scala is in the same space as Haskell, reliability-wise? I’m seeing rather poor performance & reliability (on many levels) when looking at existing Scala projects, whereas comparable python projects are doing fine.

                                      1. 2

                                        I worked on a Scala project at my last job and it was hot garbage, mostly due to bad tooling. I feel at least 30% of my development was wasted untangling dependency hell and swearing at sbt.

                                        1. 1

                                          I haven’t even looked at Scala in the last four years, so I honestly couldn’t tell you.

                                      2. 16

                                        Pretty standard “why Haskell?” post.

                                        I didn’t think so. The section on control flow, especially in the context of an interpreter, is one of the things I like most about writing Haskell. I don’t see it mentioned so much in “why Haskell?” posts. In fact, they explicitly avoid a discussion about the usual suspects: purely functional, non-strict semantics, and strong static typing.

                                        We get it, Haskell programmers are smarter than everyone else.

                                        I interpreted the sentence you are referring to differently. In my experience, Haskell programmers tend to avoid the larger community of programmers because talking about things they care about elicits angry and dismissive reactions like yours. The reference to the density of the opening sentence is just, in my interpretation, an admission that the sentence doesn’t mean much to someone who isn’t already familiar with those terms. I have found Haskell programmers to be, in general, humble and curious people who are quick to admit what they don’t know and eager to help others understand.

                                        They hand wave away writing infrastructure glue as trivial, but foresee themselves drowning in tech debt implementing the language interpretation in C++, Java, Swift, etc. That tells me they’re confident in writing infrastructure glue, but less confident writing PL code.

                                        This sounds like the No True Scotsman fallacy. The real PL hacker doesn’t need the power of Haskell? So if you’re using Haskell, you’re not a real PL hacker? What I read was a list of trade-offs they made. Part of that trade-off was writing more code you might find in a library in other languages. We don’t even know their level of confidence for writing that code, as you suggest. We just know what they valued most.

                                        These reactions to Haskell always make me sad. There seems to be such a disconnect between the perception of Haskell programmers and the reality of Haskell programmers. As @jgt said, Haskell programmers tend to be people who choose Haskell because they doubt they are sufficiently intelligent to program well in a less powerful language. It seems more about humility than ego.

                                        1. 14

                                          We get it, Haskell programmers are smarter than everyone else.

                                          While this line is particularly shitty, your entire comment is dripping with condescension and dismissiveness. It’s not up to the standards of the lobste.rs community as far as I’m concerned. I’ve marked your comment as a troll but I also want to be explicit:

                                          If anyone does actually start learning Haskell exclusively to feel smarter than other people, unless they are already geniuses they’ll probably come to appreciate how humbling an experience it is. And I can tell you from experience there are plenty of people who act as though they are smarter than everyone else outside of the Haskell community (generally a higher percentage in most other language communities I’ve participated in, actually). In contrast, the feeling I’ve gotten most often from experienced Haskell programmers is one of thoughtfulness, enthusiasm for learning, and a desire to share their knowledge and help others learn as well.

                                          But the reality is, if you’re misreading this piece so egregiously that your takeaway is that anyone using Haskell is a selfish egoist only intent on making other people feel small or satisfying their own desires at the expense of all else, then I’m going to say that yes, most Haskell programmers are probably smarter than you at least, just not for the reasons you are imagining.

                                          I may be totally off base, but that’s the vibe I got from reading your comment.

                                          1. 2

                                            your takeaway is that anyone using Haskell is a selfish egoist only intent on making other people feel small or satisfying their own desires at the expense of all else

                                            The opening paragraph of the post is fluff, it serves no purpose towards the topic of the article. But it does name drop a bunch of concepts, and then note that the reader may not have heard of them.

                                            Just because I commented on the self-congratulating opening of this post, you’ve extrapolated that I’m kind of crazed anti-Haskell fanatic. I’m not, I just rolled my eyes at that opening. If you’re looking for crazed fanatics, you should probably reread your own comment.

                                            So yeah, you’re so far off base it’s absurd.

                                            1. 4

                                              I’d just like to note that I got the same impression as @ddellacosta, maybe to a somewhat milder degree. That quoted line in particular is hard to not read as coming from a scratched ego.

                                              That said, as most things it’s not going to be one-sided, and the whole “no actually we’re too dumb to use other programming languages” does not come across as particularly sincere or convincing either.

                                              1. 1

                                                If you’re used to a statically typed language like C# and then you try to use javascript one day after years of C# you will definitely feel dumb. Maybe it’s just different and I’m not used to it, but it’s entirely reasonable to think that it is indeed actually harder. If you add more compiler checks on you can see how other languages might start also appearing similarly difficult.

                                              2. 1

                                                The opening paragraph of the post is fluff, it serves no purpose towards the topic of the article. But it does name drop a bunch of concepts, and then note that the reader may not have heard of them.

                                                The quote you chose was from the section “Why Haskell?” not the opening paragraph. Regardless, it is entirely reasonable of the authors to mention major features of Haskell that helped influence their decision, and it’s also entirely reasonable to suggest that interested readers unfamiliar with the language look elsewhere for topics already covered extensively by others. Along these lines, I also suggest taking a moment to consider the title of the piece, as well as the very first line of your original comment.

                                                Just because I commented on the self-congratulating opening of this post, you’ve extrapolated that I’m kind of crazed anti-Haskell fanatic.

                                                I was explicit in that I was talking about your entire comment, the line I singled out was just particularly shitty. More to the point, while I never stated that you are an anti-Haskell fanatic, it’s clear to me that you are not approaching the piece with an open mind, and it’s also clear you have a chip on your shoulder. I can’t speak to what or why that is.

                                                I’m not, I just rolled my eyes at that opening. If you’re looking for crazed fanatics, you should probably reread your own comment.

                                                I have. Since when does harshly criticizing a biased, poorly thought-out, and poorly written comment make me a fanatic?

                                                So yeah, you’re so far off base it’s absurd.

                                                I’m really not, but I am done discussing this with you.

                                                1. -4

                                                  I’m really not [off base], but I am done discussing this with you.

                                                  If you believe you know my own thoughts and feelings better than I do myself, you were done before you started.

                                                  1. 5

                                                    I mean you did come to a post about haskell to give a broad condemnation of haskell programmers. If you aren’t a crazed anti-haskell fanatic then you sure are rude.

                                                    1. 1

                                                      I wouldn’t call criticizing a comment I thought was annoyingly self-congratulating a “broad condemnation of Haskell programmers.”

                                                      1. 6

                                                        Whether or not you intended it “We get it, Haskell programmers are smarter than everyone else.” is going to be interpreted as “I think Haskell programmers are very conceited and snobby.”. I think it’s an entirely fair and reasonable interpretation of your statement, and while you’ve stated that it was in response to their article you haven’t clarified that you don’t view haskell programmers as conceited and snobby. A clear statement that you didn’t intend to condemn all haskell programmers probably would have went a long way. Next time when critiquing on a particular person in really any demographic it’s probably a good idea to not refer to the whole demographic unless of course you intend to condemn the whole demographic. That’s kinda what that does.

                                          2. [Comment removed by author]

                                            1. 0

                                              This would be an interesting blog post :)