Abstract
This paper develops a source-to-source transformation that seeks to delay the creation of thunks as much as possible, often eliminating them altogether. The generated programs make use of simpler representations, including types in which all expressions terminate. The transformation is guided by an abstract interpretation, with the abstract values of basic comportment analysis concretized as representation types related by injections.
The transformation of functions is polyvariant, with functions mapped to natural transformations. This leads to a clean treatment of higher order functions.
Preview
Unable to display preview. Download preview PDF.
References
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.
Patrick Cousot and Radhia Cousot. Higher-order abstract interpretation (and application to comportment analysis generalizing strictness, termination, projection and PER analysis of functional languages). In International Conference on Computer Languages, pages 95–112. IEEE Computer Society Press, 1994.
Olivier Danvy and John Hatcliff. CPS-transformation after strictness analysis. ACM Letters on Programming Languages and Systems, 1(3):195–212, 1992.
G.W. Hamilton. Higher order deforestation. In Programming Languages: Implementations, Logics and Programs, volume 1140 of Lecture Notes in Computer Science, pages 213–227. Springer, 1996.
A. Reza Haydarlou and Pieter H. Hartel. Thunk lifting: Reducing heap usage in an implementation of a lazy functional language. Journal of Functional and Logic Programming, 1995.
Brian T. Howard. Inductive, projective, and pointed types. In ACM International Conference on Functional Programming, pages 102–109, Philadelphia, May 1996.
Sebastian Hunt and David Sands. Binding time analysis: A new PERspective. In ACM Symposium on Partial Evaluation and Semantics-based Program Manipulation, pages 154–165. ACM SIGPLAN Notices 26(9), September 1991.
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, Springer
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, pages 270–281. Springer, 1980.
Alan Mycroft and Kirsten Lackner Solberg. Uniform pers and comportment analysis. In Programming Languages: Implementations, Logics and Programs, volume 982 of Lecture Notes in Computer Science, pages 169–187. Springer, 1995.
Ross Paterson. Compiling laziness using projections. In Static Analysis Symposium, volume 1145 of Lecture Notes in Computer Science, pages 255–269, Aachen, Germany, September 1996. Springer.
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.
Philip Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.
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, pages 385–407, Portland, OR, 1987. Springer.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Paterson, R. (1997). Transforming lazy functions using comportment properties. In: Glaser, H., Hartel, P., Kuchen, H. (eds) Programming Languages: Implementations, Logics, and Programs. PLILP 1997. Lecture Notes in Computer Science, vol 1292. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0033840
Download citation
DOI: https://doi.org/10.1007/BFb0033840
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-63398-3
Online ISBN: 978-3-540-69537-0
eBook Packages: Springer Book Archive