skip to main content
10.1145/1328408.1328436acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article

Heap recycling for lazy languages

Published:07 January 2008Publication History

ABSTRACT

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.

References

  1. Erik Barendsen and Sjaak Smetsers. Conventional and uniqueness typing in graph rewrite systems. In R. K. Shyamasundar, editor, Foundations of Software Technology and Theoretical Computer Science, 13th Conference, Bombay, India, December 15--17, 1993, Proceedings, volume 761 of Lecture Notes in Computer Science, pages 41--51. Springer-Verlag, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Richard Bird. Introduction to Functional Programming using Haskell. Prentice Hall, London, 2nd edition, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Urban Boquist. Code Optimization Techniques for Lazy Functional Languages. PhD thesis, Chalmers University of Technology and Goeteborg University, 1999.Google ScholarGoogle Scholar
  4. Urban Boquist and Thomas Johnsson. The GRIN project: A highly optimising back end for lazy functional languages. In Werner E. Kluge, editor, Implementation of Functional Languages, 8th International Workshop, IFL'96, Bad Godesberg, Germany, September 16--18, 1996, Selected Papers, volume 1268 of Lecture Notes in Computer Science, pages 58--84. Springer-Verlag, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Cliff Stein. Introduction to Algorithms. The MIT Press, Cambridge, Massachusetts, 2nd edition, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Luís Damas and Robin Milner. Principal type-schemes for functional programs. In Conference Record of the Ninth Annual ACM Symposium on Principles of Programming Languages, Albuquerque, New Mexico, January 1982, pages 207--212. ACM Press, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Edsko de Vries, Rinus Plasmeijer, and David Abrahamson. Uniqueness typing redefined. In Zoltán Horváth, Viktória Zsók, and Andrew Butterfield, editors, Implementation and Application of Functional Languages, 18th International Workshop, IFL 2006, Budapest, Hungary, September 4--6, 2006, Revised Selected Papers, volume 4449 of Lecture Notes in Computer Science, pages 181--198. Springer-Verlag, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Gudjón Gudjónsson and William H. Winsborough. Compile-time memory reuse in logic programming languages through update in place. ACM Transactions on Programming Languages and Systems (TOPLAS), 21(3):430--501, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jurriaan Hage, Stefan Holdermans, and Arie Middelkoop. A generic usage analysis with subeffect qualifiers. In Ralf Hinze and Norman Ramsey, editors, Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, ICFP 2007, Freiburg, Germany, October 1--3, 2007, pages 235--246. ACM Press, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Martin Hofmann. A type system for bounded space and functional in-place update. Nordic Journal of Computing, 7(4):258--289, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Martin Hofmann and Steffen Jost. Static prediction of heap space usage for first-order functional programs. In Conference Record of POPL 2003: The 30th SIGPLAN--SIGACT Symposium on Principles of Programming Languages, New Orleans, Louisiana, January 15--17, 2003, pages 185--197. ACM Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Thomas P. Jensen and Torben Æ. Mogensen. A backwards analysis for compile-time garbage collection. In Neil D. Jones, editor, sium on Programming, Copenhagen, Denmark, May 15--18, 1990, Proceedings, volume 432 of Lecture Notes in Computer Science, pages 227--239. Springer-Verlag, 1990. ESOP'90, 3rd European Symposium on Programming, Copenhagen, Denmark, May 15--18, 1990, Proceedings, volume 432 of Lecture Notes in Computer Science, pages 227--239. Springer-Verlag, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Mark P. Jones. Qualified Types: Theory and Practice. Cambridge University Press, Cambridge, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Simon B. Jones and Daniel Le Métayer. Compile-time garbage collection by sharing analysis. In FPCA '89 Conference on Functional Programming and Computer Architecture. Imperial College, London, England, 11--13 September 1989, pages 54--74. ACM Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. John Launchbury. A natural semantics for lazy evaluation. In Conference Record of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Charleston, South Carolina, January 1993, pages 144--154. ACM Press, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. John Launchbury and Simon Peyton Jones. State in Haskell. Lisp and Symbolic Computation, 8(4):293--341, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17(3):348--375, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  18. Simon Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge, 2003.Google ScholarGoogle Scholar
  19. Rinus Plasmeijer and Marco van Eekelen. Concurrent Clean language report--version 1.3. Technical Report CSI--R9816, University of Nijmegen, 1998.Google ScholarGoogle Scholar
  20. Philip Wadler. Monads for functional programming. In Johan Jeuring and Erik Meijer, editors, Advanced Functional Programming, First International Spring School on Advanced Functional Programming Techniques, Baestad, Sweden, May 24--30, 1995, Tutorial Text, volume 925 of Lecture Notes in Computer Science, pages 24--52. Springer-Verlag, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Heap recycling for lazy languages

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PEPM '08: Proceedings of the 2008 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
        January 2008
        214 pages
        ISBN:9781595939777
        DOI:10.1145/1328408

        Copyright © 2008 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 7 January 2008

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate66of120submissions,55%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader