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.
- 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 ScholarDigital Library
- Richard Bird. Introduction to Functional Programming using Haskell. Prentice Hall, London, 2nd edition, 1998. Google ScholarDigital Library
- Urban Boquist. Code Optimization Techniques for Lazy Functional Languages. PhD thesis, Chalmers University of Technology and Goeteborg University, 1999.Google Scholar
- 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 ScholarDigital Library
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Cliff Stein. Introduction to Algorithms. The MIT Press, Cambridge, Massachusetts, 2nd edition, 2001. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Martin Hofmann. A type system for bounded space and functional in-place update. Nordic Journal of Computing, 7(4):258--289, 2000. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Mark P. Jones. Qualified Types: Theory and Practice. Cambridge University Press, Cambridge, 1994. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- John Launchbury and Simon Peyton Jones. State in Haskell. Lisp and Symbolic Computation, 8(4):293--341, 1995. Google ScholarDigital Library
- Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17(3):348--375, 1978.Google ScholarCross Ref
- Simon Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge, 2003.Google Scholar
- Rinus Plasmeijer and Marco van Eekelen. Concurrent Clean language report--version 1.3. Technical Report CSI--R9816, University of Nijmegen, 1998.Google Scholar
- 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 ScholarDigital Library
Index Terms
- Heap recycling for lazy languages
Recommendations
Thunk recycling for lazy functional languages: operational semantics and correctness
SAC '15: Proceedings of the 30th Annual ACM Symposium on Applied ComputingLazy evaluation helps programmers write clear programs. However, it has significant run-time overheads for building many as-yet unevaluated expressions, or thunks. Because thunk allocation is a space-consuming task, it is important to reduce the number ...
Realization of natural language interfaces using lazy functional programming
The construction of natural language interfaces to computers continues to be a major challenge. The need for such interfaces is growing now that speech recognition technology is becoming more readily available, and people cannot speak those computer-...
Pretty printing with lazy dequeues
There are several purely functional libraries for converting tree structured data into indented text, but they all make use of some backtracking. Over twenty years ago, Oppen published a more efficient imperative implementation of a pretty printer. This ...
Comments