Laziness by need

  • Authors:
  • Stephen Chang

  • Affiliations:
  • Northeastern University

  • Venue:
  • ESOP'13 Proceedings of the 22nd European conference on Programming Languages and Systems
  • Year:
  • 2013
  • Profiling for laziness

    Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages

Quantified Score

Hi-index 0.00

Visualization

Abstract

Lazy functional programming has many benefits that strict functional languages can simulate via lazy data constructors. In recognition, ML, Scheme, and other strict functional languages have supported lazy stream programming with delaytt and forcett for several decades. Unfortunately, the manual insertion of delaytt and forcett can be tedious and error-prone. We present a semantics-based refactoring that helps strict programmers manage manual lazy programming. The refactoring uses a static analysis to identify where additional delaytts and forcetts might be needed to achieve the desired simplification and performance benefits, once the programmer has added the initial lazy data constructors. The paper presents a correctness argument for the underlying transformations and some preliminary experiences with a prototype tool implementation.