Live data from Hacker News

Why Haskell Is Worth Learning

spin.atomicobject.com

101–110 of 114 posts

Re: Why Haskell Is Worth Learning

#101
post #29

Earlier quoted context omitted.

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…

Here's my challenge, echoing a comment further down: If you want to convert folks to Haskell, write something useful in it. Then people might actually be interested in learning more about it. That's the only way you'll get converts, not writing boring, condescending lectures. My programming language prof tried to use the entire course to indoctrinate students in Haskell. He failed. None of his ramblings about how "pu…

Okay, it sounds like your course managed to sour you on Haskell without teaching you anything. Your entire tirade feels like a straw man born from ignorance. You even managed to misspell "monad".

You're simply not in my audience at all--you have too much of a predisposition against Haskell. It's not worth trying to convince you, or anybody similarly biased, because there are so many other people willing to hear me out.

So yes, maybe I won't get any further than your professor. No big loss.

Anyhow, why do you think Haskell--the language with libraries dedicated to managing state--pretends that state doesn't exist? If anything, Haskell is the only language that takes any sort of mathematical approach for modelling (and thus managing) state at all!

There's a reason why some of the most progressive and mathematically sound ways of dealing with state--my favorite example is functional reactive programming--take root in Haskell. If all you want are mutable references and data structures, we have that too. Cleverly integrated with the type system, to boot. We even have some of the best concurrency features (which are naturally based on mutable state!) like STM. STM that's not only actually usable but actually easy.

As for software written in Haskell? There's already plenty. Pandoc is simply the best in its class--I don't think it has any real competition, even. XMonad is a great window manager. Darcs is a dvcs that existed before Git took off, and has a clever model. I use Hakyll for my website, as do some prolific HNers like gwern, and it's great. Gitit is a nice, lightweight wiki. Git-annex helps you manage files on top of Git. The backend for DeTeXify, which everyone using (La)TeX should be familiar with, is written in Haskell.

And these are just the things I could think of from the top of my head, mainly things I personally use.

All these are practical utilities that you might use. If you're willing to look further afield, there are all sorts of more specific tools like Agda and a host of DSLs for everything from SMT solvers to realtime embedded programming.

Then there are the rich and relatively impressive web frameworks like Snap, Yesod and Happstack. Yesod in particular is very fully featured and useable; it has some very cool sites built on top of it including the recently released School of Haskell.

What about stuff I'm personally working on? If you're playing around with the GreenArrays chip, I currently have a simple simulator for the F18A instruction set as well as simple system for synthesizing F18A code using a randomized hill-climbing algorithm. Unfortunately, both are currently limited to one core, but that should be easy to fix. I was also working on a DSL for generating F18A code, but that fell by the wayside recently.

So clearly people are writing tons of useful software in Haskell. And people are using it. But that obviously won't satisfy you. Which, as I said above, is fine.

But if you're actually somebody else--preferably either a startup founder or somebody with control over what technology to use--you should definitely give Haskell a whirl!

Re: Why Haskell Is Worth Learning

#102
post #99

Earlier quoted context omitted.

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 s…

PHP C and C++ are popular because they are imperative languages. For non mathematicians , "imperativism" is far more easier to grasp than functional , closures , first order, monads , ... it is easy to understand what a IF statement does , what a FOR loop is , and a basic PROCEDURE or FUNCTION is. It is not easy at all to think in terms of pure functions , immutability , etc ... because you need to actually design yo…

None of the languages I listed feature purity, immutability, or monads. (Granted, Scheme and Standard ML do express a clear preference for immutability, but you can mutate all you want.)

And closures are hardly an uncommon feature at this point, I'd say. Even C++ and PHP have them.

Re: Why Haskell Is Worth Learning

#103
post #99

Earlier quoted context omitted.

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 s…

PHP C and C++ are popular because they are imperative languages. For non mathematicians , "imperativism" is far more easier to grasp than functional , closures , first order, monads , ... it is easy to understand what a IF statement does , what a FOR loop is , and a basic PROCEDURE or FUNCTION is. It is not easy at all to think in terms of pure functions , immutability , etc ... because you need to actually design yo…

You say that, but it doesn't match my experience at all. I've taught high-schoolers basic Java and they had all sorts of problems with for-loops and procedures. In fact, it took me a while just to describe what a (mutable) variable was! To many of them, the idea of changing value was not intuitive at all. It didn't help that Java coopted well-known syntax from high-school algebra like x = 10 to mean something completely different.

At my university, everyone started with a Scheme course followed by a Java course. The Scheme course starts out functionally, but never mentions it. People didn't have too many problems there except with recursion, and most of them got that after a couple of lessons.

The Java course? Not so easy! People did have problems with if statements (why is it a statement and not an expression?). They also had problems with figuring out what was a reference in Java and what was passed by value. A lot of problems with that particular facet, in fact. In fact, the people without any programming experience before college had more problems with Java than with Scheme, despite the fact that the Java course was second.

Basically, you're projecting your years of experience with imperative programming onto what you imagine a beginner thinks like. I do not think this is particularly accurate--it certainly doesn't match what I've seen in practice.

For people with literally no programming experience, functional programming is not less natural at all. If anything, it makes more sense, because it fits with the minimal mathematical background everyone has.

Re: Why Haskell Is Worth Learning

#104
post #88

Earlier quoted context omitted.

> 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…

Actually, your examples serve to counter your argument. All of the things you mentioned are very simple, and are in fact implemented in terms of the core language semantics. They are also non-standard extensions, not part of haskell. You do not need to know them or use them at all. Your final part is just plain nonsense. That is like claiming C is complex because you need to learn things like hash tables and linked l…

Define simple. You're appealing to the Turing tar pit argument. The fact that some core language is simple, doesn't mean that the language is simple in a practical situation. That applies to language constructs specified in terms of the core language and even more so to the libraries. We can define Common Lisp in terms of a small core language, heck we can even consider it a library of macros. That makes all the constructs in Common Lisp "just like" hash tables by your classification. Does that mean that Common Lisp is simple? Of course not. You have to consider what has to be learned in practice.

If you think that e.g. the interaction between GADTs and functional dependencies is simple, that's crazy. These things may not be part of Haskell98, but they are part of Haskell from a practical viewpoint, and many libraries make use of these extensions. You will have to learn it if you want to do serious work in Haskell. The same applies to the library concepts.

Re: Why Haskell Is Worth Learning

#105

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…

Why does this crap always get posted, and always manage to float instead of being downvoted? You know what other programming language community blogs about their language and tools? ALL OF THEM. Why do people suddenly insist it is a problem that haskell users do the same things everyone else does? If every time something about ruby showed up on HN someone piped up to say "stop talking about ruby and actually build th…

> You know what other programming language community blogs about their language and tools? ALL OF THEM

I don't see how that's a response to my complaint about there not being many haskell blog posts about languages and tools that aren't monad tutorials or "why don't more people use haskell". My entire point was wanting blogs about language and tools for fucks sake.

> Some open source code has no documentation?! What a shocker,

Since I said that the levels of documentation on hackage are much lower than the equivalent for every other language I use I'm again not sure what you are responding to. So yeah, a lot of open source code has no documentation. No shit. And the communities/languages that have more documentation have more users. Hackage is awful in this respect relative to other language communities.

The rest is just pointing out that a better haskell platform level of release management would let more people use Haskell productively, it wasn't aimed anywhere near the writers of any of the iteratees libraries.

Skimming over a comment and responding to what you wanted me to say could be considered "insulting and stupid".

Re: Why Haskell Is Worth Learning

#106
post #99

Earlier quoted context omitted.

PHP C and C++ are popular because they are imperative languages. For non mathematicians , "imperativism" is far more easier to grasp than functional , closures , first order, monads , ... it is easy to understand what a IF statement does , what a FOR loop is , and a basic PROCEDURE or FUNCTION is. It is not easy at all to think in terms of pure functions , immutability , etc ... because you need to actually design yo…

You say that, but it doesn't match my experience at all. I've taught high-schoolers basic Java and they had all sorts of problems with for-loops and procedures. In fact, it took me a while just to describe what a (mutable) variable was! To many of them, the idea of changing value was not intuitive at all. It didn't help that Java coopted well-known syntax from high-school algebra like x = 10 to mean something complet…

I began programming with Caml. I found TurboPascal much easier to use. So definetly began with functional programming.

Re: Why Haskell Is Worth Learning

#107
post #9

Earlier quoted context omitted.

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

You mean, "identifier not found"... ?

Exactly. Ever tried running PHP, Ruby or Python code with an undefined variable somewhere? It works flawlessly... for a minute... an hour... or a month... and then it suddenly hits you out of the blue.

Re: Why Haskell Is Worth Learning

#108
post #7

Earlier quoted context omitted.

At university the very first language we are taught is Haskell. Lots of people had never programmed before, in anything and everyone managed fine. Nothing scary at all, no need for an understanding of category theory or anything. Monads are (fairly) simple things that just have a really bad reputation, partly the fault of the haskell docs which make them seem complex. Firstly: Functors are things we can map over in a…

I'm curious what school you went to, there can't be a lot of universities that teach Haskell?

University of Bristol teaches Haskell in the first year (along with C, Java and a Prolog varient called Frill) if you're doing CS or CSE (Computer Systems Engineering, four year mix of CS and EE).

I wouldn't be surprised if Oxford and Cambridge both teach it as well since last I looked (well over a decade ago now) their CS courses had a heavy theoretical slant and Haskell and the Lambda calculus go together well!

I'd imagine that the likelihood of being taught Haskell at university correlates well with the university treating CS as an offshoot of it's maths department.

Re: Why Haskell Is Worth Learning

#109

Earlier quoted context omitted.

Why does this crap always get posted, and always manage to float instead of being downvoted? You know what other programming language community blogs about their language and tools? ALL OF THEM. Why do people suddenly insist it is a problem that haskell users do the same things everyone else does? If every time something about ruby showed up on HN someone piped up to say "stop talking about ruby and actually build th…

> You know what other programming language community blogs about their language and tools? ALL OF THEM I don't see how that's a response to my complaint about there not being many haskell blog posts about languages and tools that aren't monad tutorials or "why don't more people use haskell". My entire point was wanting blogs about language and tools for fucks sake. > Some open source code has no documentation?! What…

>My entire point was wanting blogs about language and tools for fucks sake.

So go read them instead of making nonsense posts?

>Since I said that the levels of documentation on hackage are much lower than the equivalent for every other language

Bullshit. Go look at the docs for random 3rd party modules in any language. Tons of modules are totally undocumented.

Again, nothing you said is in any way reasonable. Everything you said applies equally to any other language, and would be rightfully downvoted in that context. It is sad that HN lets your turds float.

Re: Why Haskell Is Worth Learning

#110
post #104

Earlier quoted context omitted.

Actually, your examples serve to counter your argument. All of the things you mentioned are very simple, and are in fact implemented in terms of the core language semantics. They are also non-standard extensions, not part of haskell. You do not need to know them or use them at all. Your final part is just plain nonsense. That is like claiming C is complex because you need to learn things like hash tables and linked l…

Define simple. You're appealing to the Turing tar pit argument. The fact that some core language is simple, doesn't mean that the language is simple in a practical situation. That applies to language constructs specified in terms of the core language and even more so to the libraries. We can define Common Lisp in terms of a small core language, heck we can even consider it a library of macros. That makes all the cons…

You are simply making shit up at this point. You absolutely do not, ever, under any circumstances, need to learn or use GADTs or functional dependencies. That is complete and total bullshit. Using a library that uses those features does not require you to learn them, that is the entire point of a library, to hide that from the user of the library. And yes, common lisp is a simple language.
Post reply on HN