Eager Haskell: resource-bounded execution yields efficient iteration

  • Authors:
  • Jan-Willem Maessen

  • Affiliations:
  • MIT Laboratory for Computer Science, Cambridge, MA

  • Venue:
  • Proceedings of the 2002 ACM SIGPLAN workshop on Haskell
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

The advantages of the Haskell programming language are rooted in its clean equational semantics. Those advantages evaporate as soon as programmers try to write simple iterative computations and discover that their code must be annotated with calls to seq in order to overcome space leaks introduced by lazy evaluation. The Eager Haskell compiler executes Haskell programs eagerly by default, i.e., bindings and function arguments are evaluated before bodies. When resource bounds are exceeded, computation falls back and is restarted lazily. By using a hybrid of eager and lazy evaluation, we preserve the semantics of Haskell and yet permit efficient iteration.