• DocumentCode
    746589
  • Title

    A Space-Efficient Optimization of Call-by-Need

  • Author

    Burton, F. Warren ; Maurer, Dieter ; Oberhauser, Hans-Georg ; Wilhelm, Reinhard

  • Author_Institution
    Department of Computer Science, University of Utah
  • Issue
    6
  • fYear
    1987
  • fDate
    6/1/1987 12:00:00 AM
  • Firstpage
    636
  • Lastpage
    642
  • Abstract
    Call-by-need is widely regarded as an optimal (to within a constant factor) parameter passing mechanism for functional programming languages. Except for certain special cases involving higher order functions, call-by-need is optimal with respect to time. However, call-by-need is far from optimal with respect to space. We examine some of the space problems which can arise with call-by-need and other parameter passing mechanisms. A simple optimizing technique, based on work by Mycroft [1], is proposed. If it can be determined both that an expression must be evaluated eventually and that the evaluation of the expression is likely to reduce the space required by the program, then the evaluation is performed as soon as possible. This optimization does not result in optimal space performance in all cases. However, in most of the common cases where call-by-need causes a problem the proposed optimization avoids the problem. Since our technique is not always optimal, it is likely to be of greatest advantage in situations where efficiency is important but not critical. For example, functional languages with call-by-name semantics are increasingly being used as specification languages. Since such a specification is runnable, it may be used as a prototype. This makes it possible to experiment with a program and refine the specification before the implementation in the target language is started.
  • Keywords
    Call-by-need; functional programming; optimization; space; strictness; Calculus; Cities and towns; Computer science; Functional programming; Parallel processing; Performance evaluation; Program processors; Prototypes; Specification languages; Call-by-need; functional programming; optimization; space; strictness;
  • fLanguage
    English
  • Journal_Title
    Software Engineering, IEEE Transactions on
  • Publisher
    ieee
  • ISSN
    0098-5589
  • Type

    jour

  • DOI
    10.1109/TSE.1987.233474
  • Filename
    1702269