Live data from Hacker News

In Praise of Haskell

drdobbs.com

11–20 of 64 posts

Re: In Praise of Haskell

#11
post #7

I have and will continue to maintain that it's Haskell's operational challenges that are holding it back from wide adoption, at least on the web. In a lazy language, your cost model is all out of whack. When your program consumes resources, you can't unambiguously identify the line of code that caused your program to consume those resources. That's because a function application itself does nothing. Needing the resul…

Avoid success at all costs!

Re: In Praise of Haskell

#12
post #7

I have and will continue to maintain that it's Haskell's operational challenges that are holding it back from wide adoption, at least on the web. In a lazy language, your cost model is all out of whack. When your program consumes resources, you can't unambiguously identify the line of code that caused your program to consume those resources. That's because a function application itself does nothing. Needing the resul…

There Is some preliminary work to add a "Strict language" mode that can be selectively enabled per module. Johan Tibbel has some experimental support worked out, and hopefully it can be polished enough to make it Ito ghc 7.10 in the next year.

Re: In Praise of Haskell

#13
post #4
post #3

The example provided is too contrived. By that logic, here's a way to "match" haskell with php: $a = range(2,100,2); $b = array_slice($a, 5);

Haskell's version is type safe. PHP, not so much.

Thanks for pointing that out. The author didn't emphasize that point, and it makes sense now.

Is it me, or was it a bad example for where Haskell "really shines"? I don't like the "use Haskell cause it has these really cool functions" approach. Feels so superficial.

Re: In Praise of Haskell

#14
post #13
post #4

Earlier quoted context omitted.

Haskell's version is type safe. PHP, not so much.

Thanks for pointing that out. The author didn't emphasize that point, and it makes sense now. Is it me, or was it a bad example for where Haskell "really shines"? I don't like the "use Haskell cause it has these really cool functions" approach. Feels so superficial.

I think the strongest argument for Haskell is what you can make it not do, not what you can make it do.

Having strong and concise type guarantees is great. Haskell's a great example of that. So is Ocaml.

Re: In Praise of Haskell

#15

One important thing in the article that was a bit obfuscated: modern OOP languages introduce a staggering amount of dependency and complexity. Things like TDD are then layered on top to try to ensure solid code is being built. In a pure functional environment, you don't have those dependency issues. Your problems boil down to types -- do you have the correct fields and definitions in your inputs? -- and transforms --…

Is it irony that the post right below this is complaining about Cabal and "dependency hell?"

Re: In Praise of Haskell

#16
post #6

This is yet another shallow puff piece on Haskell. Reading it, you would think that the author has only ever used Ruby and Haskell, as he gives the impression Haskell is the only language that supports functional/declarative style programming. In actuality the author is trying to sell Haskell because he sells Haskell IDEs. I'm not knocking Haskell, but let's not pretend that this is a useful piece of journalism.

As someone who has been curious about Haskell, I'm happy to hear someone else say this. The way this article was written feels exactly like the "ruby fever" of 5 years ago.

Re: In Praise of Haskell

#17
post #2

What's not to like? Cabal, which unsurprisingly is not mentioned. Dependency hell makes it stupidly difficult to rely on other people's code on a large scale. I'd rather write uglier code in JavaScript if it means having access to other people's packages immediately and without complications.

The latest version of Cabal (1.18) includes built-in sandboxing support, which alleviates this problem to a significant extent. Prior to that, there were/are tools [^1][^2] for doing the same thing external to Cabal itself. Dependency hell has without a doubt been problematic with Cabal, but it is fast becoming a solved issue. [^1]: http://hackage.haskell.org/package/cabal-dev [^2]: http://hackage.haskell.org/package…

I did use cabal-dev, and it only moved the problem from being a global problem to a local one. Is the problem that you cannot have several versions of the same package solved? Because this really needs to work, otherwise you effectively have a limit on how many modules you can use sensibly without expecting things to break.

Re: In Praise of Haskell

#18
post #13
post #4

Earlier quoted context omitted.

Haskell's version is type safe. PHP, not so much.

Thanks for pointing that out. The author didn't emphasize that point, and it makes sense now. Is it me, or was it a bad example for where Haskell "really shines"? I don't like the "use Haskell cause it has these really cool functions" approach. Feels so superficial.

It wasn't so much a bad example so much as it was a trivial one. Perhaps a more powerful one (that displays the advantages of lazy evaluation and higher-order functions) would be the function to generate an infinite list of Fibonacci numbers.

    fibs :: [Integer]
    fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
Even still, it's difficult to get the feel of actually using the language from one function taken from a freshman year CS class.

Re: In Praise of Haskell

#19

One important thing in the article that was a bit obfuscated: modern OOP languages introduce a staggering amount of dependency and complexity. Things like TDD are then layered on top to try to ensure solid code is being built. In a pure functional environment, you don't have those dependency issues. Your problems boil down to types -- do you have the correct fields and definitions in your inputs? -- and transforms --…

> [insert long discussion here about whether pure FP can actually scale in a large organization]

It scales for us at Standard Chartered.

Re: In Praise of Haskell

#20
post #13
post #4

Earlier quoted context omitted.

Haskell's version is type safe. PHP, not so much.

Thanks for pointing that out. The author didn't emphasize that point, and it makes sense now. Is it me, or was it a bad example for where Haskell "really shines"? I don't like the "use Haskell cause it has these really cool functions" approach. Feels so superficial.

You're right, it wasn't a particularly compelling example of Haskell's strengths.
Post reply on HN