Skip to main content
×
Home
    • Aa
    • Aa

Modular, higher order cardinality analysis in theory and practice

  • ILYA SERGEY (a1), DIMITRIOS VYTINIOTIS (a2), SIMON L. PEYTON JONES (a2) and JOACHIM BREITNER (a3)
Abstract
Abstract

Since the mid '80s, compiler writers for functional languages (especially lazy ones) have been writing papers about identifying and exploiting thunks and lambdas that are used only once. However, it has proved difficult to achieve both power and simplicity in practice. In this paper, we describe a new, modular analysis for a higher order language, which is both simple and effective. We prove the analysis sound with respect to a standard call-by-need semantics, and present measurements of its use in a full-scale, state-of-the-art optimising compiler. The analysis finds many single-entry thunks and one-shot lambdas and enables a number of program optimisations. This paper extends our preceding conference publication (Sergey et al. 2014 Proceedings of the 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2014). ACM, pp. 335–348) with proofs, expanded report on evaluation and a detailed examination of the factors causing the loss of precision in the analysis.

Copyright
Linked references
Hide All

This list contains references from the content that can be linked to their source. For a full set of references and notes please see the PDF or HTML where available.

J. Breitner (2015b) Formally proving a compiler transformation safe. In Proceedings of the ACM SIGPLAN Workshop on Haskell. ACM, pp. 3546.

A. Gill , J. Launchbury & S. L. Peyton Jones (1993) A short cut to deforestation. In Proceedings of the 6th ACM Conference on Functional Programming Languages and Computer Architecture. ACM Press, pp. 223232.

J.-Y. Girard (1995) Linear logic: Its syntax and semantics. In Proceedings of the Workshop on Advances in Linear Logic. Cambridge University Press, pp. 142.

B. Goldberg (1987) Detecting sharing of partial applications in functional programs. In Functional Programming Languages and Ccomputer Architecture. LNCS, vol. 274. Springer-Verlag.

J. Gustavsson (1998) A type based sharing analysis for update avoidance and optimisation. In Proceedings of the 3rd ACM SIGPLAN International Conference on Functional Programming (ICFP'98). ACM, pp. 3950.

J. Gustavsson & J. Sveningsson (2001) A usage analysis with bounded usage polymorphism and subtyping. In Implementation of Functional Languages (IFL 2000), Selected Papers. LNCS, vol. 2011. Springer, pp. 140157.

J. Hage , S. Holdermans & A. Middelkoop (2007) A generic usage analysis with subeffect qualifiers. In Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming (ICFP 2007). ACM, pp. 235246.

S. Holdermans & J. Hage (2010) Making “stricternes” more relevant. In Proceedings of the 2010 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM 2010). ACM, pp. 121130.

P. Hudak (1986) A semantic model of reference counting and its abstraction. In Proceedings of the 1986 ACM Conference on Lisp and Functional Programming. ACM, pp. 351363.

R. Jones (1992) Tail recursion without space leaks. J. Funct. Program. 2 (1), 7379.

Kahn . (1987) Functional Programming Languages and Ccomputer Architecture. LNCS, vol. 274. Springer-Verlag.

J. Launchbury , A. Gill , J. Hughes , S. Marlow , S. L. Peyton Jones & P. Wadler (1993) Avoiding unnecessary updates. In Workshops in Computing, J. Launchbury & P. M. Sansom (eds). Springer.

J. Launchbury & P. M. Sansom (eds). (1993) Workshops in Computing. Springer.

S. Marlow & S. L. Peyton Jones (2006) Making a fast curry: Push/enter versus eval/apply for higher-order languages. J. Funct. Program. 16 (4–5), 415449.

A. Moran & D. Sands (1999) Improvement in a lazy context: An operational theory for call-by-need. In Popl'99: Proceedings of the 26th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, pp. 4356.

W. Partain (1993) The nofib benchmark suite of Haskell programs. In Workshops in Computing. Springer.

S. L. Peyton Jones (1992) Implementing lazy functional languages on stock hardware: The spineless tagless G-machine. J. Funct. Program. 2 (2), 127202.

S. L. Peyton Jones & W. Partain (1994) Measuring the effectiveness of a simple strictness analyser. In Proceedings of the 1993 Glasgow Workshop on Functional Programming. Springer, pp. 201220.

S. L. Peyton Jones , W. Partain & A. Santos (1996) Let-floating: Moving bindings to give faster programs. In Proceedings of the 1st ACM SIGPLAN International Conference on Functional Programming (ICFP'96). ACM, pp. 112.

S. L. Peyton Jones & A. Santos (1998) A transformation-based optimiser for Haskell. Sci. Comput. Program. 32 (1–3), 347.

A. Sabry & M. Felleisen (1992) Reasoning about programs in continuation-passing style. In Proceedings of the 1992 ACM Conference on Lisp and Functional Programming. LISP Pointers, vol. V, no. 1. ACM, pp. 288298.

I. Sergey , D. Vytiniotis & S. L. Peyton Jones (2014) Modular, higher-order cardinality analysis in theory and practice. In Proceedings of the 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2014). ACM, pp. 335348.

P. Sestoft (1997) Deriving a lazy abstract machine. J. Funct. Program. 7 (3), 231264.

D. N. Turner & P. Wadler (1999) Operational interpretations of linear logic. Theor. Comput. Sci. 227 (1–2), 231248.

D. Van Horn & M. Might (2010) Abstracting abstract machines. In Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming (ICFP 2010). ACM, pp. 5162.

P. Wadler & J. Hughes (1987) Projections for strictness analysis. In Functional Programming Languages and Ccomputer Architecture, G. Kahn (ed.). LNCS, vol. 274. Springer-Verlag, pp. 385407.

K. Wansbrough & S. L. Peyton Jones (1999) Once upon a polymorphic type. In Popl'99: Proceedings of the 26th Annual ACM sigplan-sigact Symposium on Principles of Programming Languages. ACM, pp. 1528.

Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 25 *
Loading metrics...

Abstract views

Total abstract views: 186 *
Loading metrics...

* Views captured on Cambridge Core between 16th February 2017 - 24th June 2017. This data will be updated every 24 hours.