Live data from Hacker News

I tried Haskell for 5 years

metarabbit.wordpress.com

211–220 of 273 posts

Re: I tried Haskell for 5 years

#211
post #199

Earlier quoted context omitted.

This sounds a bit FUD-ish. Programming in any language involves understanding the evaluation strategy. You seem to be advocating languages that can be used with a level of ignorance or innocence which in practice just isn't possible. https://en.wikipedia.org/wiki/Evaluation_strategy

I disagree. I contend that most of the time folks ignore the evaluation strategy for eagerly evaluated languages because they're simply easier to reason about. That strikes me as objectively true on its face and I believe most Haskellers would concede that point. The only time I can think of where that's not the case is when microoptimizing for performance, where the exact instructions being produced and their impact…

You're taking issue with material that is covered in every haskell 101 course worth it's salt (how to understand the properties of foldl and foldr).

We typically don't evaluate the efficacy of a language contingent on someone who is missing fundamental, well-known concepts about the language.

Also, I don't think folks "ignore the evaluation strategy for eagerly evaluated languages". They simply learn it early in in their programming experience.

Re: I tried Haskell for 5 years

#212

Earlier quoted context omitted.

Would you also feel that a strict-by-default language which adds support for lazyness is a tacit admission that strict-by-default is wrong?

In C# or Java, it's easy to get a lazy collection and force it into a list or an array. Is it possible to do the same with haskells (lazy) lists?

Array.fromList?

Re: I tried Haskell for 5 years

#213

I will never, ever use Haskell in production because of its default evaluation strategy, the wrongness of which was tacitly conceded not long ago with the addition of the strictness pragma (which only works per-module) to GHC. I think it's especially telling that its community skews so heavily towards this blogger/monad tutorial writer dilettante demographic rather than the D. Richard Hipp/Walter Bright 'actually get…

> I will never, ever use Haskell in production because of its default evaluation strategy, the wrongness of which was tacitly conceded not long ago with the addition of the strictness pragma (which only works per-module) to GHC. Why must you publicly post something so wrong?

Because they have an axe to grind and a throwaway to burn?

Re: I tried Haskell for 5 years

#214
post #205

Earlier quoted context omitted.

The fact that he mentions type driven development probably means that he has dependent typing around, probably as seen in the language Idris, whose recently published book is called the same. Idris is very much not just an abstract language.

Yes, the author mentioned Idris shortly afterwards, but I get the impression that this is just the tip of an iceberg. Idris was presented as the one example that is most likely to evolve from a research-only language, to a production language.

There's also agda and coq, at various points on the spectrum between programming language and theorem prover.

Re: I tried Haskell for 5 years

#215
post #108
post #27

Earlier quoted context omitted.

The point is that it's not inherently inscrutable—it's different. And being different is a virtue: at the very least, you'll learn something from Haskell, and it's going to let you do things other languages won't. It's not just an Algol reskin.

If it had Algol syntax and Algol naming conventions it might actually have succeeded outside of academia. The decision not to go with an Algol-derived syntax was probably the biggest mistake ever done in Haskell's design.

Maybe... I'm not convinced the semantics would feel as good in that setting.

Re: I tried Haskell for 5 years

#216
post #211

Earlier quoted context omitted.

I disagree. I contend that most of the time folks ignore the evaluation strategy for eagerly evaluated languages because they're simply easier to reason about. That strikes me as objectively true on its face and I believe most Haskellers would concede that point. The only time I can think of where that's not the case is when microoptimizing for performance, where the exact instructions being produced and their impact…

You're taking issue with material that is covered in every haskell 101 course worth it's salt (how to understand the properties of foldl and foldr). We typically don't evaluate the efficacy of a language contingent on someone who is missing fundamental, well-known concepts about the language. Also, I don't think folks "ignore the evaluation strategy for eagerly evaluated languages". They simply learn it early in in t…

You're taking issue with material that is covered in every haskell 101 course worth it's salt (how to understand the properties of foldl and foldr).

Oh, I'm not "taking issue". This isn't personal. It's just my observations.

And yes, that one needs to explain the consequences of lazy evaluation and the potential for space leaks to a complete neophyte to justify foldr/foldl is literally exactly what I'm talking about! :)

Space leaks are complicated. And they're nearly unavoidable. I doubt even the best Haskeller has avoided introducing space leaks in their code.

That's a problem.

Are you saying it's not? Because that would honestly surprise me.

Furthermore, are you saying eager languages have analogous challenges? If so, I'm curious what you think those are! It's possible I'm missing them because I take them for granted, but nothing honestly springs to mind.

Re: I tried Haskell for 5 years

#217
post #211

Earlier quoted context omitted.

You're taking issue with material that is covered in every haskell 101 course worth it's salt (how to understand the properties of foldl and foldr). We typically don't evaluate the efficacy of a language contingent on someone who is missing fundamental, well-known concepts about the language. Also, I don't think folks "ignore the evaluation strategy for eagerly evaluated languages". They simply learn it early in in t…

You're taking issue with material that is covered in every haskell 101 course worth it's salt (how to understand the properties of foldl and foldr). Oh, I'm not "taking issue". This isn't personal. It's just my observations. And yes, that one needs to explain the consequences of lazy evaluation and the potential for space leaks to a complete neophyte to justify foldr/foldl is literally exactly what I'm talking about!…

I didn't claim space leaks aren't a problem. But one has to size the magnitude of the problem appropriately. And one should also cross-reference that with experience reports from companies using Haskell in production.

Re: I tried Haskell for 5 years

#218

Earlier quoted context omitted.

>> I'd say that people mostly do not know what is running in industry well if anyone does know what's out there then HN crowd would be a pretty good suspect in that regard. I personally have done my fair share of consulting and prof services engagements - dozens of them across all kinds of industries - I've never seen a Haskell shop. Java, Python, JS, Golang, Scala, Clojure, .Net, C, PHP - definitely out there in the…

well if anyone does know what's out there then HN crowd would be a pretty good suspect in that regard. HN is a comically bad barometer for anything other than what's trendy in norcal.

It's not as bad as you say, exactly. Yes, some trendy languages are overrepresented (coughRustcough), and there are people with blinders on about what programming outside the Valley is like. But there's way too much .NET, Java and such posted for HN to be wholly unaware of trends in the broader industry. Java may see some use in NorCal, but I really doubt C# does anywhere near as much as it pops up here.

Re: I tried Haskell for 5 years

#219
post #74

We have a code base of roughly 200,000 lines of Haskell code, dealing with high performance SQL query parsing, compilation and optimizations. I only remember one situation over the past 5 years that we had a performance issue with Haskell, that was solved by using the profiling capabilities of GHC. I disagree that performance is hard to figure out. It could be better, yes - but it's not that different than what you'd…

but it's not that different than what you'd get with other programming languages. Until you have to solve a (maddeningly common) space leak issue. That's a problem unique to lazily evaluated languages (basically Haskell) and is godawful to debug. It reminds me of solving git problems... you suddenly find yourself having to tear back the abstraction layer that is the language and compiler and start thinking about thun…

> Until you have to solve a (maddeningly common) space leak issue.

Hm, I've been making useful things with Haskell for a couple years including quite a few freelance projects and haven't encountered many space leaks.

Definitely not enough to say they are maddeningly common, or even enough to say they are common.

Re: I tried Haskell for 5 years

#220

Earlier quoted context omitted.

I am not holding that (joke's) view, but monad came to mind as an ongoing academic research (to original Haskell at least) in order to solve a rather trivial stateful programming (trivial in an imperative style). To generalize that example, there are solutions that are trivial to express in an imperative style but seems convoluted in pure functional programming. How to retain the trivialness are subject of ongoing ac…

This confuses me. You don't really need monads to perform io or specify sequencing in Haskell, although do notation is very convenient for sequencing sctions. Ultimately, if you want imperative style, you can just write imperative code that's well typed in Haskell.

> You don't really need monads to perform io or specify sequencing in Haskell.

By implying certain logic dependence? It would be rather un-natural, which I assume is the reason for the invention of monad.

> Ultimately, if you want imperative style, you can just write imperative code that's well typed in Haskell.

It is not just a style. There are logic implications. In imperative programming, the states are always assumed. That is, the operations are assumed to have different effect switching orders. Note this is a much stricter assumption than the alternative that some/all operations are stateless. The benefit of such stricter confinement provides certain convenience. For example, because the order of instruction is meaningful and can convey ideas, contexts can take place, and local ideas can be focused (rather than carrying the whole states). In the real world (compared to the mathematical world), most action affects vast states that are impossible to quantify, and we (as an adaptive species) are well adapted to stateful imperative thinking. How do you perform rigorous logic thinking when the inputs (states) are never complete?

In computer programming, the states can always be fully described. However, if you always want to fully describe your states, you'll either restrict your functions and programs with limited states (input/output) or you will be constantly writing cumbersome functions/programs with a long description of all its states. The solution is to share and imply some of those states in the types, monad, for example. So yes, monad is not strictly a necessity but a convenience. Since Haskell never makes assumptions of hidden states, merely imitating an imperative style is still not imperative programming. Because the states are still not assumed, but rigorously specified and carried. So even with a seemingly similar code style, the cognitive process in Haskell and a conventional imperative language is very different.

Which is better? It depends. If you are holding the view that everything computer solves are mathematical problems, or when you are solving mathematical problems, certainly you would think only Haskell's approach makes sense. On the other hand, if you understand that computers are merely a tool for solving real-world problems, then you are often not looking for mathematically correct answers but practically good enough solutions. Practically good enough solutions allow room for shortcuts or undefined behaviors. Embracing these uncertainties (shock to mathematicians) allows for efficient means. Under the latter context, a pure mathematical restriction can be a burden rather than help. The latter approach, in fact, carries much more complexity. For example, calculating pi to one millionth digit. In functional approach, it is solving a mathematical problem and a correct answer is what you looking for. In imperative approach, memory cost, speed efficiency, various shortcuts are all part of the consideration and part of solution. It is not always just the answer matters, how you get the answer also matters. But do they really matter? It depends.

Real programming is often a mixture of both -- in C or in Haskell. C defaults to imperative style with explicit stateless when needed. Haskell defaults to stateless with explicit stateful when necessary. Trivial in one is difficult in the other.

Post reply on HN