skip to main content
article

Lenient evaluation is neither strict nor lazy

Published: 01 April 2000 Publication History

Abstract

What is a non-strict functional language? Is a non-strict language necessarily lazy? What additional expressiveness brings non-strictness, with or without laziness? This paper tries to shed some light on these questions. First, in order to characterize non-strictness, different evaluation strategies are introduced: strict, lazy, and lenient. Then, using program examples, how these evaluation strategies differ from each other is examined, showing that non-strictness, even without laziness, allows a more general use of recursive definitions. We also report on a small experiment that we performed to examine how, in practice, laziness was used in a number of lazy benchmark programs.

References

[1]
Goldberg, B., Functional programming languages. Computing Surveys. v28 i1. 249-251.
[2]
Traub K. Sequential implementation of lenient programming languages. Technical report MIT/LCS/TR-417, Laboratory for Computer Science, MIT, 1988.
[3]
Tremblay G, Malenfant B. Lenient evaluation and parallelism. Computer Languages 2000;26:27-41.
[4]
Stoy, J., . 1977. MIT Press, Cambridge, MA.
[5]
Osborne R. Speculative computation in multilisp. CRL 90/1, Digital Equipment Corporation, 1990.
[6]
Friedman D, Wise D. CONS should not evaluate its arguments. In: Michaelson S, Milner R, editors. Automata, languages and programming. Edinburgh University Press, Edinburgh, 1976. p. 257-87.
[7]
Henderson, P., . 1980. Prentice-Hall International Series in Computer Science, Englewood Cliffs, NJ.
[8]
Burn G, Hankin C, Abramsky S. The theory of strictness analysis for higher order functions. In: Jones ND, Ganzinger H, editors. Programs as data objects, Lecture Notes in Computer Science, vol. 217, Berlin, Springer, 1985, p. 42-62.
[9]
Hughes R, Wadler P. Projections for strictness analysis. In: Kahn G, editor. Functional prog. lang. and comp. arch., Lecture Notes in Computer Science, vol. 274, Berlin: Springer, 1987, p. 385-407.
[10]
Tremblay G. Parallel implementation of lazy functional languages using abstract demand propagation. Ph.D. Thesis, School of Computer Science, McGill University, November 1994.
[11]
Sondergaard, H. and Sestoft, P., Referential transparency, definiteness and unfoldability. Acta Informatica. v27 i4. 505-517.
[12]
Emerson A. Automated temporal reasoning about reactive systems. In: Moller F, Birtivistle GM, editors. Logics for concurrency-structure versus automata, Lecture Notes in Computer Science, vol. 1043, Berlin: Springer, 1996, p. 41-101.
[13]
Peterson J, Hammond K, editors. Report on the programming language Haskell, a non-strict purely functional language (Version 1.4). Technical report, Yale University, Department of Computer Science, April 1997.
[14]
Nikhil R, Arvind HJ, Aditya S, Augustsson L, Meassen J-W, Zhou Y. pH language reference manual, version 1.0-preliminary. Technical report 369, Laboratory for Computer Science, MIT, January 1995.
[15]
Schmidt D. Denotational semantics: a methodology for language development. Newton, MA: Allyn and Bacon, Inc. 1986.
[16]
Gunter, C., . 1992. MIT Press, Cambridge, MA.
[17]
Field A, Harrison P. Functional programming. Reading, MA: Addison-Wesley Publishers Ltd. 1988.
[18]
Arvind, N.R. and Pingali, K., I-Structures: data structures for parallel computing. TOPLAS. v11 i4. 598-632.
[19]
Clack C, Clayman S, Parrott D. Dynamic cyclic data structures in lazy functional languages. http://www.cs.ucl.ac.uk/staff/C.Clack/papers/NotSubmitted/graph.ps, October 1995.
[20]
Aho A, Hopcroft J, Ullman J. The design and analysis of computer algorithms. Reading, MA: Addison-Wesley Publishing Co. 1974.
[21]
Keller R, Lindstrom G. Applications of feedback in functional progamming. In: Proceedings of the 1981 Conference on Funct. Prog. Lang. and Comp. Arch. 1981, p. 123-30.
[22]
Tremblay G. Exemples de programmation dynamique. Course notes (in french) for an algorithms and data structures course, www.info.uqam.ca/¿¿tremblay/INF4110/prog-dynamique, 1998.
[23]
Allison, L., Application of recursively defined data structures. Australian Computer Journal. v25 i1. 14-20.
[24]
Bird, R., Using circular programs to eliminate multiple traversals of data. Acta Informatica. v21 i4. 239-250.
[25]
Hughes, J., Why functional programming matters. The Computer Journal. v32 i2. 98-107.
[26]
Karczmarczuck, J., Generating power of lazy semantics. Theoretical Computer Science. v187. 203-219.
[27]
Okasaki C. Amortization, lazy evaluation, and persistence: lists with catenation via lazy linking. In: Symposium on Foundations of Computer Science. IEEE, October 1995, p. 646-54.
[28]
Okasaki C. The role of lazy evaluation in amortized data structures. In: International Conference on Functional Programming. ACM, May 1996, p. 62-72.
[29]
Wadler P. How to replace failure by a list of successes: exception handling, backtracking and pattern matching in lazy functional languages. In: Jouannaud JP, editors. Functional Prog. Lang. and Comp. Arch., Lecture Notes in Computer Science, vol. 281, Berlin: Springer, 1985, p. 113-28.
[30]
Hutton, G., Higher-order functions for parsing. Journal of Functional Programming. v2 i3. 323-343.
[31]
Okasaki, C., Functional pearl: even higher-order functions for parsing. Journal of Functional Programming. v8 i2. 195-199.
[32]
Augustsson L. Private communication. April 1995.
[33]
Sekar R, Pawagi S, Ramakrishnan I. Small domains spell fast strictness analysis. In: Proceedings of the ACM Symposium on Principles of Prog. Lang. 1990. p. 169-83.
[34]
Allison, L., Circular programs and self-referential structures. Software-Practice and Experience. v19 i2. 99-109.
[35]
Allison, L., Lazy dynamic-programming can be eager. Information and Processing Letters. v43 i4. 207-212.
[36]
Hartel P, Langendoen K. Benchmarking implementations of lazy functional languages. In: FPCA '93, New York: ACM Press, 1993. p. 341-9.
[37]
Nikhil R. The parallel programming language Id and its compilation for parallel machines. CSG Memo 313, Laboratory for Computer Science, MIT, July 1990.
[38]
Partain W. The nofib benchmark suite of Haskell programs. In: Proceedings of the 1993 Glasgow Workshop on Functional Programming. Berlin: Springer, 1993.
[39]
Tremblay G. Compilation de pH pour une machine parallèle multi-contextes. Note interne de recherche, Dépt. d'informatique, UQAM, juillet 1997.
[40]
Msheik H. Code generation for a functional language targeted to a parallel multithreaded machine. Master's thesis, Dépt. d'Informatique, UQAM, Aoít 2000.
[41]
Augustsson L, Johnsson T. Lazy ML user's manual version 0.999.7. Obtenu via ftp, 1994.
[42]
Turner, D., An overview of miranda. SIGPLAN Notices. v21 i12. 158-166.
[43]
Brus T, van Eekelen M, van Leer M, Plasmeijer M. Clean-a language for functional graph rewriting. In: Kahn G, editor. Funct. Prog. Lang. and Comp. Arch., Lecture Notes in Computer Science, vol. 274, Berlin: Springer, 1987, p. 364-84.
[44]
. 1987. Prentice Hall, Englewood Cliffs, NJ.
[45]
Jones S. How useful is laziness? Posted to comp.lang.functional, August 1995.
[46]
Tremblay G, Gao G. The impact of laziness on parallelism and the limits of strictness analysis. In: Bohm AW, Feo J, editors. High Perf. Funct. Comp., LLNL, CONF-9504126, 1995, p. 119-33.
[47]
Milner, R., A theory of type polymorphism in programming. Journal of Computer and System Science. v17 i3. 348-375.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Computer Languages
Computer Languages  Volume 26, Issue 1
April, 2000
64 pages

Publisher

Pergamon Press, Inc.

United States

Publication History

Published: 01 April 2000

Author Tags

  1. Lazy functional programming languages
  2. Non-strict evaluation

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 0
    Total Downloads
  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 05 Feb 2025

Other Metrics

Citations

View Options

View options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media