
Hi guys, Having completed a simple parser project using Haskell, I'm getting more and more "hooked" on functional-programming in general and Haskell in particular. And learning the language has been a real treat as well, using the tutorial with occasional peeks at the report. However, when I'm considering undertaking more complex projects, I realize that there is one important erea of the Haskell language that is still pretty much a "black-hole" for me: the run-time environment. I honestly can't say that I completely understand how the actual control and data flows work when a Haskel program is executed, and I seem to be constantly surprised by the garbage-collection, which sometimes seems as if it doesn't work at all, and at other times seems to do magic. I've tried reading some of the articles related to the design of GHC's run-time. But they don't seem to be much help. They either assume that the reader has prior knowledge of functional-programming run-time environments, or get into very low-level details. And at the end of the day, this is very confusing, and I find terms like thunks, entries, partial-function-applications, etc. floating in my head hoplessly seeking anchor. So, where can one find a good introductory book / article on the subject? Thanks, -Jony __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

[Jonathan Holt
I've tried reading some of the articles related to the design of GHC's run-time. But they don't seem to be much help. They either assume that the reader has prior knowledge of functional-programming run-time environments, or get into very low-level details. And at the end of the day, this is very confusing, and I find terms like thunks, entries, partial-function-applications, etc. floating in my head hoplessly seeking anchor.
So, where can one find a good introductory book / article on the subject?
I found the book: Simon Peyton-Jones and David Lester "Implementing Functional Languages: A Tutorial" Prentice Hall, 1992 very helpful. The actual techniques discussed differ from the technique used by most Haskell compilers, but the book provided the background I needed to follow Simon's newer papers on the subject, particularly: "Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine" "The Glasgow Haskell compiler: a technical overview" "Compiling Haskell by program transformation: a report from the trenches" The book I mentioned is, I believe, out of print, although I found my copy new just a couple of years ago. The complete text is available on-line at: http://research.microsoft.com/~simonpj/Papers/pj-lester-book/ This book should not be confused with the similarly named: Simon Peyton-Jones "Implementation of Functional Programming Languages" Prentice Hall which is also out of print. I've never seen the latter book, but someone's currently selling it used on Amazon for $300, if you're so inclined... ;) All the papers I mentioned (and plenty more, all worth a look) are at: http://research.microsoft.com/~simonpj/Papers/papers.html#compiler If you still find this stuff going over your head, perhaps you should check out the following, both of which I've found useful in their own ways: Chris Reade "Elements of Functional Programming" Addison-Wesley, 1989 An interesting mix of practical programming instruction and more theoretical stuff, using SML. Introduces lambda calculus and normal forms, lazy and eager evaluation, denotational semantics, basic type checking and inference Hindley-Milner style, and several implementation techniques. Dated in many ways, but good. Dick Grune, Henri E. Bal, Ceriel J.H. Jacobs and Koen G. Langendoen "Modern Compiler Deign" J. Wiley, 2000 Chapter 7 is devoted to compiling functional languages, and uses Haskell as its example. I realize that there's really a lot of material there, but it's very much worth understanding! It definitely makes one realize how much one takes for granted a relatively complete understanding of the implementation of one's usual languages. I suppose we've just slowly absorbed so much of that info wrt procedural and OO languages that we don't tend to realize just how much we actually learned. In any case, enjoy learning all this stuff. I know I have! Matt -- Matt Hellige matt@immute.net http://matt.immute.net
participants (2)
-
Jonathan Holt
-
Matt Hellige