Heap recycling for lazy languages

Pure functional programming languages preclude destructive updates of heap-allocated data. In such languages, all newly computed algebraic values claim freshly allocated heap space, which typically causes idiomatic programs to be notoriously inefficient when compared to their imperative and impure counterparts. We partly overcome this shortcoming by considering a syntactically light language construct for enabling user-controlled in-place updates of algebraic values. The resulting calculus, that is based on a combination of type-based uniqueness and constructor analysis, is guaranteed to maintain referential transparency and is fully compatible with existing run-time systems for nonstrict, pure functional languages.

[1]  Martin Hofmann,et al.  Static prediction of heap space usage for first-order functional programs , 2003, POPL '03.

[2]  Clifford Stein,et al.  Introduction to Algorithms, 2nd edition. , 2001 .

[3]  Marinus J. Plasmeijer,et al.  Uniqueness Typing Redefined , 2006, IFL.

[4]  Erik Barendsen,et al.  Conventional and Uniqueness Typing in Graph Rewrite Systems , 1993, FSTTCS.

[5]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[6]  Daniel Le Métayer,et al.  Computer-Time Garbage Collection by Sharing Analysis , 1989, FPCA.

[7]  Mark P. Jones Qualified Types: Theory and Practice , 1994 .

[8]  Richard S. Bird,et al.  Introduction to functional programming , 1988, Prentice Hall International series in computer science.

[9]  Philip Wadler Monads for Functional Programming , 1995, Advanced Functional Programming.

[10]  Rinus Plasmeijer,et al.  Concurrent Clean Language Report - version 1.3 , 1998 .

[11]  M. Hofmann A Type System for Bounded Space and Functional In-Place Update , 2000, Nord. J. Comput..

[12]  Urban Boquist,et al.  Code Optimisation Techniques for Lazy Functional Languages , 1999 .

[13]  John Launchbury,et al.  Advanced Functional Programming , 1995, Lecture Notes in Computer Science.

[14]  Torben Æ. Mogensen,et al.  A Backwards Analysis for Compile-time Garbage Collection , 1990, ESOP.

[15]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[16]  Thomas Johnsson,et al.  The GRIN Project: A Highly Optimising Back End for Lazy Functional Languages , 1996, Implementation of Functional Languages.

[17]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[18]  R. Bird Introduction to functional programming using Haskell, Second Edition , 1998 .

[19]  Simon L. Peyton Jones,et al.  State in Haskell , 1995, LISP Symb. Comput..

[20]  John Launchbury,et al.  A natural semantics for lazy evaluation , 1993, POPL '93.

[21]  William H. Winsborough,et al.  Compile-time memory reuse in logic programming languages through update in place , 1999, TOPL.

[22]  Jurriaan Hage,et al.  A generic usage analysis with subeffect qualifiers , 2007, ICFP '07.