Lambda the Ultimate

inactiveTopic Eager Haskell
started 6/4/2002; 4:00:11 PM - last post 6/5/2002; 6:15:29 AM
Bryn Keller - Eager Haskell  blueArrow
6/4/2002; 4:00:11 PM (reads: 2356, responses: 2)
Eager Haskell
Jan-Willem Maessen's dissertation, Hybrid Eager and Lazy Evaluation for Efficient Compilation of Haskellthesis has recently been released, and the author says an implementation is on the way:

I'm presently working hard on making a production-quality version of the Eager Haskell compiler. If you have any questions about Eager Haskell, or would like to see a pre-release version of the compiler along with the programs I used as benchmarks, drop me a line. A full release of the unified pH / EH compiler is slated for mid-August.

Here's the first paragraph of the abstract:

The advantage of a non-strict, purely functional language such as Haskell lies in its clean equational semantics. However, lazy implementations of Haskell fall short: they cannot express tail recursion gracefully without annotation. We describe resource-bounded hybrid evaluation, a mixture of strict and lazy evaluation, and its realization in Eager Haskell. From the programmer's perspective, Eager Haskell is simply another implementation of Haskell with the same clean equational semantics. Iteration can be expressed using tail recursion, without the need to resort to program annotations. Under hybrid evaluation, computations are ordinarily executed in program order just as in a strict functional language. When particular stack, heap, or time bounds are exceeded, suspensions are generated for all outstanding computations. These suspensions are re-started in a demand-driven fashion from the root.


Posted to functional by Bryn Keller on 6/4/02; 4:09:29 PM

Ehud Lamm - Re: Eager Haskell  blueArrow
6/5/2002; 3:39:06 AM (reads: 707, responses: 0)
From the site: Why use eager evaluation? There are a number of good reasons. First, eager evaluation is more intuitive. Every month there is a posting to the Haskell mailing list of the form "I wrote a tail-recursive loop, and hugs is running out of stack. This should be efficient. What's going on?" The answer is that the space behavior of lazy programs is difficult to grasp, and it can be especially frustrating to express iteration. Often explicit strictness annotations are required. This detracts severely from the declarative nature of the language. In Eager Haskell, tail-recursive computations will run in constant space just as they would in ML or C.

I don't think C is properly tail-recursive.

Ehud Lamm - Re: Eager Haskell  blueArrow
6/5/2002; 6:15:29 AM (reads: 701, responses: 0)
Also check this classic paper about lazy vs. eager evaluation (We have shown ... that lazy evaluation of functional programming languages is strictly more powerful than eager evaluation, as measured by the asymptotic complexity of evaluating certain programs).