Re: First steps in Haskell

From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Paul Moore
I suspect that the reference documentation is fine, and the tutorials are great, given what they are trying to do. But there is scope for a very prominent "Getting going" document. Daniel's "40-second intro to Haskell" looks good. Expand it a little with a few lines showing tow to build and compile a "Hello, world" program in GHC and Hugs (with a disclaimer that the code itself is magic for now, you'll understand when you read about monads and the IO monad) to help people who need to get over the "but how do I write a *program*" hump, and you're pretty much there.
For someone getting started, in IMO the Learning Haskell page has too much stuff on it. The total beginner doesn't have the knowledge they need to decide which implementation to install, which tutorial to read, or which textbook to buy. At the risk of alienating some tutorials and implementations, we ought to pick one of each and say "here, start with these". There's a balance to be struck between being fair to all resource producers (be it implementation, textbook, tutorial, or reference), and being as easy as possible for someone to get started, and I think the needle is currently too far over to the "fair" side of the scale. There should be a "getting started" page which says: - download and install this interpreter (Hugs or GHCi) - run it, type these expressions, and see the results - create a HelloWorld program, compile and execute. - now start the following tutorial... (BTW, the link to Hal Daume's tutorial from the Learning page needs fixing) As an example (checking out the competition), the Ruby community have a good free book. The book is fairly easy to find from the ruby-lang.org homepage, although it could be more prominent. The preface contains a brief tutorial for working with the interpreter (how to build & install, the REPL, and a Hello World program): http://www.rubycentral.com/book/preface.html And there's this interesting site, which demos a interpreter running in your browser (although it really seems to be showcasing some AJAX-ish javascript libraries): http://tryruby.hobix.com/ The Ruby community have put quite a bit of effort into easing beginners into the langauge and tools. Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************

Bayley, Alistair wrote:
For someone getting started, in IMO the Learning Haskell page has too much stuff on it. The total beginner doesn't have the knowledge they need to decide which implementation to install, which tutorial to read, or which textbook to buy. At the risk of alienating some tutorials and implementations, we ought to pick one of each and say "here, start with these". There's a balance to be struck between being fair to all resource producers (be it implementation, textbook, tutorial, or reference), and being as easy as possible for someone to get started, and I think the needle is currently too far over to the "fair" side of the scale.
As a newbie I agree with Bayley. I didn't say that before because I didn't want to be more critical than I had already been.
There should be a "getting started" page which says: - download and install this interpreter (Hugs or GHCi) - run it, type these expressions, and see the results - create a HelloWorld program, compile and execute. - now start the following tutorial... (BTW, the link to Hal Daume's tutorial from the Learning page needs fixing)
I'll try to put something together on the Wiki. Cheers, Daniel. -- /\/`) http://oooauthors.org /\/_/ http://opendocumentfellowship.org /\/_/ \/_/ I am not over-weight, I am under-tall. /

Hello Alistair, Tuesday, December 20, 2005, 1:13:50 PM, you wrote: BA> And there's this interesting site, which demos a interpreter running in BA> your browser it's a neat idea! I/O-stripped version of hugs can be runned in such way btw, i send to newcomers the following recommendations: ======================================================== i can recommend you two books for beginners: "Gentle inroduction to Haskell" http://www.haskell.org/tutorial/haskell-98-tutorial-html.tar.gz "Yet Another Haskell Tutorial" by Hal Daume III http://www.isi.edu/~hdaume/htut/tutorial.pdf and book + PowerPoint tutorial by Graham Hutton: http://www.cs.nott.ac.uk/~gmh/preview.pdf http://www.cs.nott.ac.uk/~gmh/mgs-appsem1.ppt http://www.cs.nott.ac.uk/~gmh/mgs-appsem2.ppt http://www.cs.nott.ac.uk/~gmh/mgs-appsem3.ppt http://www.cs.nott.ac.uk/~gmh/mgs-appsem-exam.pdf http://www.cs.nott.ac.uk/~gmh/countdown.pdf btw, in the "another haskell tutorial" we can read: There have been many books and tutorials written about Haskell; for a (nearly) complete list, visit the http://haskell.org/bookshelf (Haskell Bookshelf) at the Haskell homepage. A brief survey of the tutorials available yields: - A Gentle Introduction to Haskell is an introduction to Haskell, given that the reader is familiar with functional programming en large. - Haskell Companion is a short reference of common concepts and definitions. - Online Haskell Course is a short course (in German) for beginning with Haskell. - Two Dozen Short Lessons in Haskell is the draft of an excellent textbook that emphasizes user involvement. - Haskell Tutorial is based on a course given at the 3rd International Summer School on Advanced Functional Programming. - Haskell for Miranda Programmers assumes knowledge of the language Miranda. - PLEAC-Haskell is a tutorial in the style of the Perl Cookbook. ======================================================== to this list, link to page "A Tour of the Haskell Prelude" can also be added -- Best regards, Bulat mailto:bulatz@HotPOP.com

On Tue, 20 Dec 2005, Bayley, Alistair wrote: ...
There should be a "getting started" page which says: - download and install this interpreter (Hugs or GHCi) - run it, type these expressions, and see the results - create a HelloWorld program, compile and execute. - now start the following tutorial... (BTW, the link to Hal Daume's tutorial from the Learning page needs fixing)
Is the interactive interpreter exercise worth the trouble? Don't ask me, I have barely learned to use any of the interpreters in interactive mode, but I have the impression that they're different (where we came in), and you absolutely have to learn some things about them that don't otherwise contribute to your ability to write programs, and after all there are significant limits to what you can do there. I understand that interactive mode can be useful, I'm just wondering whether it belongs with Hello world in the scheme of things, or if at that first step it would be better to focus on the language. Donn Cave, donn@drizzle.com

Donn Cave wrote:
I understand that interactive mode can be useful, I'm just wondering whether it belongs with Hello world in the scheme of things, or if at that first step it would be better to focus on the language.
Let's compare sample instructions: Interactive mode: ----------------- 1. Write this on a file and save it as prog.hs ---- fac 0 = 1 fac n | n > 0 = n * fac(n-1) ---- 2. Type ghci on a terminal. 3. Load the program with ":load prog.hs" 4. Type "fac 12" Compiled mode: --------------- 1. Write this on a file and save it as "prog.hs" ---- main = print fac 12 fac 0 = 1 fac n | n > 0 = n * fac(n-1) ---- 2. Type "ghc prog.hs -o prog" on a terminal. 3. Run the program with "./prog" Comparison: ~~~~~~~~~~~ 1. The "compiled mode" instructions are only 1 step smaller, and that's because that step was moved into the program itself. You still need to explain that bit. 2. The "compiled mode" instructions also introduce "main" and "print". Over-all, I think that the compiled mode instructions are *marginally* more complicated. Not enough to choose one over the other. I would choose the interactive mode because it is friendlier to experimentation. Cheers, Daniel. -- /\/`) http://oooauthors.org /\/_/ http://opendocumentfellowship.org /\/_/ \/_/ I am not over-weight, I am under-tall. /
participants (4)
-
Bayley, Alistair
-
Bulat Ziganshin
-
Daniel Carrera
-
Donn Cave