9 ms·
This reminds me that when I was interested in learning haskell I was completely put off by their "introduction" page on their homepage. It was a couple of years
by simias 14y ago
This reminds me that when I was interested in learning haskell I was completely put off by their "introduction" page on their homepage. It was a couple of years ago but it doesn't seem to have changed much:
http://www.haskell.org/haskellwiki/Introduction 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 http://perldoc.perl.org/perlintro.html
[1] http://www.haskell.org/haskellwiki/Introduction/Direct_Translation http://www.haskell.org/haskellwiki/Introduction/Direct_Trans...
- amirmc 14y agoCurious to know what you think of http://ocaml.org http://ocaml.org, specifically the code example on the front page and the further examples it links to (http://ocaml.org/taste.html http://ocaml.org/taste.html)
- rtpg 14y agoFunny, I've never seen that page, I always land on Inria's page(http://caml.inria.fr/ http://caml.inria.fr/).
- agumonkey 14y agoMe too. Quite delighted to see ocaml having a refreshed page and active community.
- simias 14y agoLooks like what I would expect from a language introduction. Explains the syntax, shows off some features, gives you snippets of code and tells you how to feed them into a REPL. It's a good way to start and get people interested in the language I think.
- looser 14y agoProbably the reason Haskell's introduction has more explanation is because for most, functional programming language is unusual. 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.
- davorak 14y agoIt is linked from the main page to answer the question "What is Haskell?" It is not supposed to an example driven page at all. The title of the wiki page could be changed to fix this though. The very next link is http://tryhaskell.org/ http://tryhaskell.org/ to learn Haskell in a example driven way.
- simias 14y agoI agree that I'm nitpicking a bit but I do think it's significant. It says something about the mentality of the community. First impressions matter. 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.
- polymatter 14y agoI highly recommend (http://learnyouahaskell.com/ http://learnyouahaskell.com/)
- efnx 14y agoYes! That's a great introduction, but you must have a sense of humor. I love that book.
- rtpg 14y agoIs there any language intro page that shows a good sized working program?
- shriphani 14y agoYes. Racket has a great intro-page and download links etc. No BS. http://racket-lang.org/ http://racket-lang.org/
- riffraff 14y agothe question was "a good sized working program", the racket page is a great page but only has a few haikus, so "no" should be your first word, even if the rest of the comment is correct :)
- deleted 14y ago[deleted]
- aphexairlines 14y agoThe haskell analogue to perlintro.html is http://www.haskell.org/tutorial/index.html http://www.haskell.org/tutorial/index.html Some code to chew on, some features shown off: http://lambda-the-ultimate.org/node/2427 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/marktoberdorf/ http://research.microsoft.com/en-us/um/people/simonpj/papers...
- revelation 14y agoThat wiki link to an actual implementation of quicksort in Haskell is pure comedy gold (1): "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_Translation http://www.haskell.org/haskellwiki/Introduction/Direct_Trans...
- jberryman 14y ago> and it's a completely unreadable mess that is clearly a line by line copy of the C code given 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.
- sltkr 14y agoTo be fair, QuickSort is particularly suitable for imperative languages that allow in-place modification of arrays. For functional languages, merge sort is a much more natural solution that is simple to implement, guaranteed to be efficient, and probably reasonably fast (though still unlikely to beat a QuickSort implementation in C).
- ajross 14y agoTo be fair, QuickSort is particularly suitable for actual computation hardware which has hardware features like numerically addressed, stateful random access memory. Imperative arrays happen to feature "in-place modification of arrays" not because it's a useful language feature but because it's a straightforward abstraction of the actual machine being programmed. 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.
- tsahyt 14y ago> After a couple of paragraphs brainwashing you about how good functional programming is, you finally get to some code. 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.
- jmount 14y agoPlus quicksort is a classic morass- by the time you harden it enough to deal with real world data you could have written a proper merge sort with similar average case performance and much better worst case guarantee. My rant on quicksort: http://www.win-vector.com/blog/2008/04/sorting-in-anger/ http://www.win-vector.com/blog/2008/04/sorting-in-anger/
- gnuvince 14y agoInteresting read, thanks for linking it. When I need to write a sorting algorithm, I usually for Merge Sort, because I can never remember the exact details of swapping/partitioning of QuickSort. It seems much more natural to say "split your data in two, sort them, merge them together". And when I'm feeling damn fancy, I use an InsertSort when the size of the dataset is less than 7-8, another algorithm that I find difficult to forget (at least, the recursive definition; I usually need some paper and pencil to do the in-place version).
- davorak 14y agoThat is not the best introduction to the programming language by means of practical examples, but it does not look like it is supposed to be either. At least from Haskell.org it links from "What is Haskell?" Which is a very different question then what can I do with Haskell.
- zobzu 14y ago"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" that made me laugh a few years (?) ago and it still does :)