Live data from Hacker News

Why Haskell Is Worth Learning

spin.atomicobject.com

81–90 of 114 posts

Re: Why Haskell Is Worth Learning

#81
post #50
post #46

Earlier quoted context omitted.

It is an issue of the language's qualities if it does not really make it easier to reason about code. I find reason to question the simplicity of something which is widely acknowledged to take a lot of time to learn, to be mind-bending, and which seems to be impossible to explain simply - without deep theoretical background, academic citations or oversimplifications acknowledged as misleading. I think it would be mat…

Simple does not imply easy. As an extreme example, a unicycle is simpler than a bicycle--fewer components, simpler structure, no gearing--but also more difficult to learn. Really, I'll just have to point you to the "Simple Made Easy" talk again. The core point being that there's a difference between something being "simple" and something being "easy", and we should generally strive for the former rather than the latt…

Watching the video now...

It seems beautiful, enlightening and wrong.

It might be described as a powerful statement of software idealism. Essentially, start simple and stay there, the problems, the mess, the mythical-man-months, etc all come because the developers refused the effort needed for simple and impatiently descended into the swamp of complexity.

I too, love starting simple and usually intend to stay there.

But the problem I would suggest, is the complexity will build up and simplity-as-the-simple-methods you've learned, simplity-as-such, can't fight this build-up. If being simple COULD put an end to complex situations, you wouldn't have to START simple, you could use simplicity to "drain the swamp of the complex". But every methodology more or less says that you have to be on the top of its mountain and to stay there (except original OO and we know how well that worked).

My contention is that this "mountain dwelling" is only possible at times, in some domains, in some organizations, etc. Humans can, at times, carve simplicity out of the swamp of complexity. But it isn't easy and it isn't a product of any fixed set of simple tools we human have come up with so-far.

Mr. Hickey's viewpoint might be useful for selling simplicity and I would be willing to use it if I thought simplicity would be a good buy for my organization. But the reality is tradeoffs never good away. Sometimes people overestimate the value of short term payoff but sometimes people overestimate the value of long term payoffs. The one thing that I think I want to keep here is the clear, simple distinction between "ease" and "simplicity". It's useful even if it might not be entirely, true.

Re: Why Haskell Is Worth Learning

#82
post #25

I have to admit that I'm really on the fence about Haskell. My major gripe with this point I think is point (3). Haskell has (IMHO) gone down a similar road to Scala. Scala has literally tied itself into knots to make statically typesafe collections (amongst other things). I see parallels with Haskell (maintaining functionality purity but dealing with the "outside world" through monads). I'm not saying this is wrong.…

Oh, a bracket-style programmer (Java / C#) spitting his poison about Scala, Haskell and Lisp dialects all in one comment and somehow this gets voted up.

I'm calling appeal to autorithy now. No, not people with lots of rep on SO for answering Java and C# question.

I'm calling appeal to pg authority.

This is ycombinator.com FFS!

Go read "Beating the average", "What made Lisp different", etc. There are many very insightful things in these essays.

After you'll have read them, you won't be upvoting these "I hate everything non-bracket styles / your language is a toy because it's not the most succesful one" comments. Actually after reading them you'll be downvoting these poisonous words...

Re: Why Haskell Is Worth Learning

#83
post #80

I love haskell but I wish there was less blogging about why everyone else should use it and more building things that will make people want to use it. The community is extraordinarily friendly to beginners, as long as you only count how they interact with beginners. If you count having resources that allow beginners to figure something out without having to ask then they are extraordinarily unfriendly. If I find a po…

I think generally the advice to beginners is to ignore most of Hackage and focus on the Haskell platform—which is frankly kind of terrible advice. It's intended to avoid things like the enumerator/iteratee/conduit/pipes madness and focus on a stable library interface, but almost all of the fun is being developed on the bleeding edge of Hackage. I'd agree completely that this is a deficiency with the Haskell community…

I don't think it's a chicken and egg problem quite. It's true that the types of people that do these kinds of things arrive when you have critical mass, but that's just statistics.

I think you can recruit people to do this kind of thing, or at least encourage people to do so, but it would require community management and such which doesn't really exist in the haskell community. If I felt cruel I would nominate dons to do it, since it's so easy to want to give more work to the guy who's already doing a ridiculous amount of good work.

Re: Why Haskell Is Worth Learning

#84
post #38
post #13

Earlier quoted context omitted.

"The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Python, etc)" Haskell will show you that when you thought you broke your code down into small functions in those languages, you were wrong in ways you currently can't even see and they're still shot through with duplication and mixing of concerns. This is really…

Learning Haskell taught me that mutation and state are good things, present both in the fundamental nature of computers and the real world. Haskell's attempts to eliminate state entirely results in a profound increase in complexity. For me, learning Haskell was like visiting a third-world country: enlightening, very different, but ultimately I leave feeling very grateful that I'm not a permanent resident. All in all,…

So obviously you were not very enlightened because it makes no such attempts.

Re: Why Haskell Is Worth Learning

#85
post #79
post #74

Earlier quoted context omitted.

you might prefer ocaml (i do) - it has a lot of the functional power of haskell, but is comfortably multi-paradigm, and in particular pushes neither purity nor laziness upon you. also, the ocaml community has been considerably revitalised in the last year or so, so now is a good time to get into it

I understand F# is in the ocaml family. Any reason why one would prefer ocaml over fsharp?

There are several reasons why one would prefer OCaml over F#:

- OCaml is not tied to .NET. Obviously the converse also applies: if you need .NET integration then F# might be a better choice.

- F# does not support some of the more advanced features of the OCaml type system, like polymorphic variants (open unions) and functors. These are very useful OCaml features, IMHO.

- OCaml has gained some very interesting features since F# branched off, which again are not present in F#: modules as first class values, GADTs, and better control over module signatures.

Overall, my recommendation is that unless you are really tied to .NET ecosystem, then OCaml is a more interesting language to learn.

Re: Why Haskell Is Worth Learning

#86
post #25

I have to admit that I'm really on the fence about Haskell. My major gripe with this point I think is point (3). Haskell has (IMHO) gone down a similar road to Scala. Scala has literally tied itself into knots to make statically typesafe collections (amongst other things). I see parallels with Haskell (maintaining functionality purity but dealing with the "outside world" through monads). I'm not saying this is wrong.…

I don't think simplicity is as much of a recipe for language popularity as you claim. Scheme is a very simple language, far simpler than any of the languages you mentioned, yet it doesn't get much use in industry. Standard ML is a simple language, simple enough to be formally specified even. Most computer science students easily pick it up and learn it as part of a compilers course, so it's not that the language is simple in theory but hard to grasp. Lua is a wonderfully simple language, and it's found a good niche in games and configuration, yet it's nowhere near the popularity of its older, more complex sibling JavaScript.

On the other hand, C++ is probably the most complex language on the planet and it's hugely popular. PHP is an incredibly complex language—it surprises almost everyone who uses it—and it's extremely popular as well.

Language simplicity is just one of many factors influencing a language's success.

Re: Why Haskell Is Worth Learning

#87
post #16

I was thinking about this the other day and I think it generalizes beyond any specific language. I'm pretty sure every time I have learned a new programming language I came away a better programmer. Different programming languages (and their standard libraries) suggest that you approach problems in different ways, and that has real cognitive benefits. I was actually trying to think if there was ever a case where I ha…

> I'm pretty sure every time I have learned a new programming language I came away a better programmer.

You might want to think a little bit about the fact that you are predisposed to believing that your efforts are not wasted.

If you spend the time to learn a new programming language, you're then predisposed to believing that it wasn't a waste of time, and are thus susceptible to confirmation bias, which causes you to ignore all evidence to the contrary.

Re: Why Haskell Is Worth Learning

#88
post #29
post #25

I have to admit that I'm really on the fence about Haskell. My major gripe with this point I think is point (3). Haskell has (IMHO) gone down a similar road to Scala. Scala has literally tied itself into knots to make statically typesafe collections (amongst other things). I see parallels with Haskell (maintaining functionality purity but dealing with the "outside world" through monads). I'm not saying this is wrong.…

Haskell is also very simple--not from an implementation standpoint but from a semantics standpoint. Having polymorphism with no sub-typing (and no casting) is conceptually simple and easy to work with. Parametric polymorphism (like Java's generics but simpler and less horrible) is actually an extremely simple concept. The difficulty comes from a) implementing it in a stupid way after the fact ( cough Java) or b) havi…

> You can fit Haskell's evaluation rules and its typing rules on one page.

Evaluation rules yes, but typing rules? Once you add in features like records, GADTs, type classes, functional dependencies, type functions, equality constraints, associated types ... you end up with quite a complicated system. Maybe you can state it on less than a page if you use a small enough font, but the system is complex. In contrast, C semantics might be large, but they're not complex. Unlike with Haskell's type system, there are no difficult interactions among all the features.

That's one of the reasons people are investigating dependently typed languages. They can offer a simpler and more powerful type system.

In addition to this, the language isn't even the most difficult part. So much of the difficulty is in learning the libraries and concepts associated with the libraries (functors, applicative functors, monads, iteratees, zippers, arrows, etc.). This may be further along the "hard" axis than the "complex" axis, but it's definitely not simple either.

Re: Why Haskell Is Worth Learning

#89
post #9
post #8

I am no Haskell expert, so I might be wrong on this, but is that code right ? I would imagine the fourth line should read isIfOfInterest (CIf cond _ _ _) = not (null (listify isFooIdent cond)) not isIfOfInterest (CIf cond _ _ _) = not (null (listify fooIdent cond))

You are correct. The nice thing is that this mistake would have been caught compile-time.

The bad thing is that people still write blog posts containing uncompiled code.

Re: Why Haskell Is Worth Learning

#90
post #79

Earlier quoted context omitted.

I understand F# is in the ocaml family. Any reason why one would prefer ocaml over fsharp?

There are several reasons why one would prefer OCaml over F#: - OCaml is not tied to .NET. Obviously the converse also applies: if you need .NET integration then F# might be a better choice. - F# does not support some of the more advanced features of the OCaml type system, like polymorphic variants (open unions) and functors. These are very useful OCaml features, IMHO. - OCaml has gained some very interesting feature…

On the other hand, if you can use .NET, F# is a more practical language to learn. The F# standard libraries and .NET libraries and IDE are miles ahead of anything OCaml has, which in practice far outweighs anything else. If you're picking a language to learn new language concepts, I'd definitely pick OCaml over F# for its modules alone.
Post reply on HN