by simias · 13y ago · 0 comments
http://www.haskell.org/haskellwiki/Introduction
It looks like a very pretentious sales pitch to me. You have quotes like "Writing large software systems that work is difficult and expensive. [...] Functional programming languages, such as Haskell, can make it easier and cheaper." and a whole bunch of very vague and poorly backed up assertions.
After a couple of paragraphs brainwashing you about how good functional programming is, you finally get to some code. The first code you get is (of all things) a quicksort which is not used as an introduction to the language but as a way to boast that haskell is so much better and more expressive than C. I mean, look at that C code just after it, disgusting isn't it.
What they don't say is how much slower their implementation is, of course. They also give a link to a more direct (and faster) C-to-haskell version of the quicksort[1]. Hey, it's actually longer than the C version! And it uses 3 imports. And it's still slower than the original C. Oops. I wonder why they didn't put that one in the tutorial. I went back to common lisp after that, I have yet to write 1 line of haskell.
TL;DR: when I want an introduction to your language, I want to know what I can do with it and how I can do it. Give me some code to chew on, show off some features. Don't spend 10 pages telling me you're the best of the best and everything else is crap. This is the kind of article I expect: http://perldoc.perl.org/perlintro.html
[1] http://www.haskell.org/haskellwiki/Introduction/Direct_Trans...
"Unfortunately none of the above "real" quicksorts seems to compile as given"
"The program below is working very very slowly. It's probably slowsort."
"A more specific/direct translation (neither this nor the C version is polymorphic) is offered by Daniel Fischer, who reports that this version runs within 2x of the C version"
(and it's a completely unreadable mess that is clearly a line by line copy of the C code given)
What a complete and utter trainwreck.
[1]: http://www.haskell.org/haskellwiki/Introduction/Direct_Trans...
That distinction is really important, and something I think many language nerds completely fail to understand. Sure, often all that's "really" important is the abstraction of the "Human Design Space" idea being implemented, and that's a regime where high level language abstractions have lots of value.
But sometimes you want to actually direct the hardware. And there, as everywhere, it helps to use a language with the proper abstractions. C has them, Haskell doesn't. There's absolutely no shame in that!
But somehow people get fooled into thinking that somehow Haskell (or whatever language is involved in the argument, but it seems like Haskell people fall into this hole more than most) doesn't need those abstractions to be "as fast a C". And that's just insane.
I didn't find it unreadable, and I think the point was to copy the C implementation. I'm not sure what you were expecting.
In any case the unfortunate state of parts of the haskell wiki isn't a good reason to feel one way or the other about the language.
Some code to chew on, some features shown off: http://lambda-the-ultimate.org/node/2427
and a great writeup of what happens behind the curtain: http://research.microsoft.com/en-us/um/people/simonpj/papers...
Evaluating a language by just reading the introduction is like reading the introduction of a book and saying that you didn't like it. Read it! :)
It seems we are focusing too much in a possible weak point and forgeting about several strong points Haskell has.
But perhaps you could recommend me and others who'd like to try haskell a better introduction to the language? I'm still curious to try it.
Whenever I see a page about a new programming language I usually skip all the marketing speech at first and look for a code fragment to examine first. After that I'll start reading the actual text.