Cheap eagerness: speculative evaluation in a lazy functional language

  • Authors:
  • Karl-Filip Faxén

  • Affiliations:
  • Dept. of Teleinformatics, KTH, Stockholm

  • Venue:
  • ICFP '00 Proceedings of the fifth ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2000

Quantified Score

Hi-index 0.00

Visualization

Abstract

Cheap eagerness is an optimization where cheap and safe expressions are evaluated before it is known that their values are needed. Many compilers for lazy functional languages implement this optimization, but they are limited by a lack of information about the global flow of control and about which variables are already evaluated. Without this information, even a variable reference is a potentially unsafe expression!In this paper we show that significant speedups are achievable by cheap eagerness. Our cheapness analysis uses the results of a program-wide data and control flow analysis to find out which variables may be unevaluated and which variables may be bound to functions which are dangerous to call.