Live data from Hacker News

Why I never finish my Haskell programs

blog.plover.com

201–210 of 228 posts

Re: Why I never finish my Haskell programs

#201
post #186

Earlier quoted context omitted.

Mozart/Oz??? I never heard of it. Now there is another rabbit cave to spelunk in my search for the perfect programming language.

It's an academic-only language, mostly used for teaching students about programming. Anyone sane would not use it in production, as the output would likely be "ill-typed".

There's also AliceML, an evolution of SML with Oz-like semantics. Sadly not in very active development.

Re: Why I never finish my Haskell programs

#202
post #104

You could also just: write the less general version and stop listening to folks who flip and scoff at every piece of code isn't maximally general. Crazy, I know, but especially when were doing labor in industry, even without maximal generality your code is probably going to outlive its patron corporation and then die in obscurity.

The only person who flips and scoff at every piece of code isn't maximally general is... the author the code. That's the problem.

That's not true. There are folks in the community who absolutely DO put pressure on open source libraries to be maximally general (or to use THEIR abstractions over others).

This fosters an environment that might already lead people to second guess themselves, because it's so big and new.

Re: Why I never finish my Haskell programs

#203
post #193
post #68

Earlier quoted context omitted.

The type system forces you to solve this problem in a very specific way by structuring your entire app around pushing IO to the edges. There are plenty of other ways to address the problem that work perfectly fine in practice. For example, you can specify what should happen is IO fails in your logging configuration. This handles the exceptional case consistently and in a single place without forcing you to structure…

> For example, you can specify what should happen is IO fails in your logging configuration. This handles the exceptional case consistently and in a single place without forcing you to structure your whole app around it. In Haskell you can write a function that does "unsafe" logging and handles exceptions if that's the behaviour you want. You can even make that function change its behaviour based on a config file if…

All I can say is that we clearly have divergent experiences here. I've worked with statically typed languages for about a decade, I used Haskell specifically for about a year. I've since moved to Clojure, and I've been using it for the past 8 years professionally. My experience is that the team I work on is much more productive with Clojure than any static language we've used, and we have not seen any increase of defects in nearly a decade of using the language compared to similar sized projects we've developed previously in statically typed languages like Java and Scala.

If dynamic typing was problematic we would've switched back a long time ago.

Re: Why I never finish my Haskell programs

#204

Earlier quoted context omitted.

A big one is lazy I/O[1]. It is really easy to mess up the order that operations happen in when using IO operations from Haskell's standard library. The non-standard library alternatives like conduits or pipes are more complex, but much harder to mess up. [1] https://stackoverflow.com/questions/5892653/whats-so-bad-abo...

I agree lazy file I/O can be dangerous and needs to vanish, but I'm not sure this counts as an "algorithmic" complaint, which is what I was really curious about. I also don't think you need Conduit or Pipes or any other performance destroying free Monad libraries to deal with it. My hot take: Conduit is in fact awful and radically overused and multiple superior options exist.

By saying "algorithmic," I used the wrong word. Lazy IO is a great example of what I meant.

Re: Why I never finish my Haskell programs

#205

Earlier quoted context omitted.

What makes you think the Haskell community is toxic? I usually hear the exact opposite.

I find that the Haskell community is very friendly as long as you buy into their approach to solving problems. However, my experience is that if you question the effectiveness of static typing, or ask for evidence in support of the claimed benefits you'll get a very hostile reaction. The comment above where pka snidely claims that using any alternative to types amounts to yolo is quite representative. He outright dis…

> However, my experience is that if you question the effectiveness of static typing, or ask for evidence in support of the claimed benefits you'll get a very hostile reaction.

That's an interesting thing to say, seeing how representative figures of (specifically) the Clojure community get really defensive really quickly once somebody questions the effectiveness of dynamic typing - which I specifically didn't do.

> He outright dismisses that any valid alternatives are possible

I was merely dismissing your incorrect claim about logging in Haskell. And yes, not taking advantage of the type system when you are already programming in a language with a type system amounts to #yoloing it, in my opinion. Doing the same in other languages is fine, since you don't have another option really.

Re: Why I never finish my Haskell programs

#206
post #186

Earlier quoted context omitted.

Mozart/Oz??? I never heard of it. Now there is another rabbit cave to spelunk in my search for the perfect programming language.

It's an academic-only language, mostly used for teaching students about programming. Anyone sane would not use it in production, as the output would likely be "ill-typed".

So you're saying: don't use an unfinished programming language to write unfinished programs ;)

Re: Why I never finish my Haskell programs

#207
post #186

Earlier quoted context omitted.

Mozart/Oz??? I never heard of it. Now there is another rabbit cave to spelunk in my search for the perfect programming language.

It's an academic-only language, mostly used for teaching students about programming. Anyone sane would not use it in production, as the output would likely be "ill-typed".

[deleted]

Re: Why I never finish my Haskell programs

#208
post #144
post #61

Earlier quoted context omitted.

When people wonder why my typical comments run on to multiple screenfuls, it's because I'm armoring them against this sort of dismissive snark. I was in between tasks today and lacked time to make it longer.

OK, long form: you whooshed on the point of the linked article entirely. Software exists to solve problems, not to achieve some sort of aesthetic ideal. Time spent in pursuit of abstractions (or skill in the expression of abstractions) is wasted, by definition. You seem to be conflating the two. To wit: spending hours giting gud at Haskell doesn't translate to hours saved solving real problems (like the one in the li…

"spending hours giting gud at Haskell doesn't translate to hours saved solving real problems"

As long as we're playing "make baseless assertions at each other", my experience says otherwise. That's going to be hard for you to talk me out of.

Programmers still seem to have this bizarre belief that programming, uniquely among all the skills in the world, is not possible to improve via deliberative practice, and an equally bizarre belief that improved skills can't possible translate into better programs or even worse, must inevitably translate into worse programs. I can't wrap my mind around it.

I don't deny that there certainly is a trap where you learn these skills in a sort of greenhouse environment, then fail to translate them out of that environment properly. But that's the fault of the practitioner, not the skills, and I prove by demonstration that the skills can come out of the greenhouse and improve real code. I mostly write my professional code in Go, so you can be quite assured my production code is anything but a mess of functional paradigms inappropriately applied, since that's basically impossible in Go. I find what I learned in Haskell to be incredibly useful in Go.

Re: Why I never finish my Haskell programs

#209
post #208
post #144

Earlier quoted context omitted.

OK, long form: you whooshed on the point of the linked article entirely. Software exists to solve problems, not to achieve some sort of aesthetic ideal. Time spent in pursuit of abstractions (or skill in the expression of abstractions) is wasted, by definition. You seem to be conflating the two. To wit: spending hours giting gud at Haskell doesn't translate to hours saved solving real problems (like the one in the li…

"spending hours giting gud at Haskell doesn't translate to hours saved solving real problems" As long as we're playing "make baseless assertions at each other", my experience says otherwise. That's going to be hard for you to talk me out of. Programmers still seem to have this bizarre belief that programming, uniquely among all the skills in the world, is not possible to improve via deliberative practice, and an equa…

I genuinely don't think you read the linked article. The author clearly is quite good at Haskell and hasn't fallen into this "trap" you're positing. It's not a failure of the "practitioner" at all. It's a fairly insightful point about the psychology of programming and the diminishing returns of the kind of skills we're talking about here.

> you can be quite assured my production code is anything but a mess of functional paradigms inappropriately applied

The point of the article was precisely that functional paradigms appropriately (which is to say, "appropriately") applied are themselves a design smell.

Re: Why I never finish my Haskell programs

#210

Earlier quoted context omitted.

> you can say that any `b` in the result list _must_ have come from applying the function to some `a` in the input list. Morally correct... but consider the function `\f xs -> [undefined]`, which can be typed as `(a -> b) -> [a] -> [b]`. (Obviously it could be given other types as well.)

When discussing Haskell and theorems about its types it's common to simply ignore non-termination; if we don't ignore non-termination there's basically nothing we can say about Haskell programs at all. Interested readers should check out Agda and Theorems for free!

Fair enough. On reflection, `\f xs -> []` is a better example of the point I was trying to make.
Post reply on HN