Skip to main content

Compiling laziness using projections

  • Contributed Papers
  • Conference paper
  • First Online:
Static Analysis (SAS 1996)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1145))

Included in the following conference series:

Abstract

Projection-based strictness analysis is a powerful technique, able to cope with non-flat domains and latent demand. By analysing the projections as embedding-projection pairs, we develop an algorithm to translate lazy functions into a strict functional language with explicit closures. The translated functions typically operate on simpler types than the originals, in particular types containing fewer liftings, which correspond to the operational notion of closures. Like the analysis on which it is based, our algorithm is restricted to first-order functions.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Torben Amtoft. Minimal thunkification. In Patrick Cousot et al., editors, Static Analysis: 3rd International Workshop, WSA '93, Padova, Italy, volume 724 of Lecture Notes in Computer Science, pages 218–229. Springer, 1993.

    Google Scholar 

  2. Andrew A. Appel. Compiling with Continuations. Cambridge University Press, 1992.

    Google Scholar 

  3. Geoffrey L. Burn, Chris Hankin, and Samson Abramsky. Strictness_analysis of higher order functions. Science of Computer Programming, 7:249–278, 1986.

    Article  Google Scholar 

  4. Geoffrey L. Burn and Daniel Le Métayer. Proving the correctness of compiler optimisations based on a global program analysis. In Fifth International Symposium on Programming Language Implementation and Logic Programming, volume 714 of Lecture Notes in Computer Science, pages 346–364, Tallinn, Estonia, August 1993. Springer.

    Google Scholar 

  5. W. Clinger and J. Rees. Revised4 report on the algorithmic language Scheme. ACM Lisp Pointers, IV, July–September 1991.

    Google Scholar 

  6. Olivier Danvy and John Hatcliff. CPS-transformation after strictness analysis. ACM Letters on Programming Languages and Systems, 1(3):195–212, 1992.

    Google Scholar 

  7. Kei Davis and Philip Wadler. Strictness analysis in 4D. In 1990 Glasgow Workshop on Functional Programming, Workshops in Computing, pages 23–43. Springer, 1991.

    Google Scholar 

  8. Karl-Filip Faxén. Optimizing lazy functional programs using flow inference. In Static Analysis, Second International Symposium, volume 983 of Lecture Notes in Computer Science, pages 136–153. Springer, 1995.

    Google Scholar 

  9. Karl-Filip Faxén. Flow inference, code generation and garbage collection for lazy functional languages. Licentiate thesis, Kungl Tekniska Högskolan, January 1996.

    Google Scholar 

  10. Cordelia V. Hall and David S. Wise. Compiling strictness into streams. In 14th ACM Symposium on Principles of Programming Languages, pages 132–143, Munich, January 1987.

    Google Scholar 

  11. Paul Hudak, Simon Peyton Jones, Philip Wadler, et al. Report on the programming language Haskell, a non-strict purely functional language (Version 1.2). SIGPLAN Notices, 27(5), March 1992.

    Google Scholar 

  12. Sebastian Hunt. Abstract Interpretation of Functional Languages: From Theory to Practice. PhD thesis, Imperial College of Science, Technology and Medicine, 1991.

    Google Scholar 

  13. Ryszard Kubiak, John Hughes, and John Launchbury. Implementing projectionbased strictness analysis. In 1991 Glasgow Workshop on Functional Programming, Workshops in Computing, pages 207–224. Springer, 1992.

    Google Scholar 

  14. T-M. Kuo and P. Mishra. Strictness analysis: A new perspective based on type inference. In FPCA '89, London, England, pages 260–272. ACM Press, September 1989.

    Google Scholar 

  15. John Launchbury and Gebreselassie Baraki. Representing demand by partial projections. Journal of Functional Programming, 6(4), 1996.

    Google Scholar 

  16. John Launchbury and Ross Paterson. Parametricity and unboxing with unpointed types. In European Symposium on Programming, volume 1058 of Lecture Notes in Computer Science, pages 204–218, Linköping, Sweden, April 1996.

    Google Scholar 

  17. Alan Mycroft. The theory and practice of transforming call-by-need into call-by-value. In B. Robinet, editor, International Symposium on Programming, volume 83 of Lecture Notes in Computer Science. Springer, 1980.

    Google Scholar 

  18. Simon L. Peyton Jones. Implementing lazy functional languages on stock hardware: the spineless tagless G-machine. Journal of Functional Programming, 2(2):127–202, July 1992.

    Google Scholar 

  19. Simon L. Peyton Jones and John Launchbury. Unboxed values as first class citizens in a non-strict functional language. In Conference on Functional Programming Languages and Computer Architecture, pages 636–666, Cambridge, MA, 1991.

    Google Scholar 

  20. Philip Wadler and John Hughes, Projections for strictness analysis. In Conference on Functional Programming Languages and Computer Architecture, volume 274 of Lecture Notes in Computer Science, Portland, OR, 1987.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Radhia Cousot David A. Schmidt

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Paterson, R. (1996). Compiling laziness using projections. In: Cousot, R., Schmidt, D.A. (eds) Static Analysis. SAS 1996. Lecture Notes in Computer Science, vol 1145. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61739-6_46

Download citation

  • DOI: https://doi.org/10.1007/3-540-61739-6_46

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61739-6

  • Online ISBN: 978-3-540-70674-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics