Abstract
Much research in program optimization has focused on formal approaches to correctness: proving that the meaning of programs is preserved by the optimisation. Paradoxically, there has been comparatively little work on formal approaches to efficiency: proving that the performance of optimized programs is actually improved. This paper addresses this problem for a general-purpose optimization technique, the worker/wrapper transformation. In particular, we use the call-by-need variant of improvement theory to establish conditions under which the worker/wrapper transformation is formally guaranteed to preserve or improve the time performance of programs in lazy languages such as Haskell.
- Z. M. Ariola, M. Felleisen, J. Maraist, M. Odersky, and P. Wadler. The Call-by-Need Lambda Calculus. In POPL '95, pages 233--246. ACM, 1995. Google Scholar
Digital Library
- R. M. Burstall and J. Darlington. A Transformation System for Developing Recursive Programs. Journal of the ACM, 24 (1):44--67, 1977. Google Scholar
Digital Library
- K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP. ACM, 2000. Google Scholar
Digital Library
- T. Coquand. Infinite Objects in Type Theory. In TYPES '93, volume 806 of Lecture Notes in Computer Science. Springer, 1993. Google Scholar
Digital Library
- E. Dubuc and R. Street. Dinatural Transformations. In Lecture Notes in Mathematics, volume 137 of Lecture Notes in Mathematics, pages 126--137. Springer Berlin Heidelberg, 1970.Google Scholar
- A. Farmer, A. Gill, E. Komp, and N. Sculthorpe. The HERMIT in the Machine: A Plugin for the Interactive Transformation of GHC Core Language Programs. In Haskell Symposium (Haskell '12), pages 1--12. ACM, 2012. Google Scholar
Digital Library
- A. Gill and G. Hutton. The Worker/Wrapper Transformation. Journal of Functional Programming, 19(2), 2009. Google Scholar
Digital Library
- J. Gustavsson and D. Sands. A Foundation for Space-Safe Transformations of Call-by-Need Programs. Electronic Notes on Theoretical Computer Science, 26:69--86, 1999.Google Scholar
Cross Ref
- J. Gustavsson and D. Sands. Possibilities and Limitations of Call-by-Need Space Improvement. In ICFP, pages 265--276. ACM, 2001. Google Scholar
Digital Library
- J. Hackett, G. Hutton, and M. Jaskelioff. The Under Performing Unfold: A New Approach to Optimising Corecursive Programs. 2013. To appear in the volume of selected papers from the 25th International Symposium on Implementation and Application of Functional Languages, Nijmegen, The Netherlands, August 2013.Google Scholar
- C. Hope. A Functional Semantics for Space and Time. PhD thesis, School of Computer Science, University of Nottingham, 2008.Google Scholar
- J. Hughes. A Novel Representation of Lists and its Application to the Function "reverse". Information Processing Letters, 22(3):141--144, 1986. Google Scholar
Digital Library
- G. Hutton, M. Jaskelioff, and A. Gill. Factorising Folds for Faster Functions. Journal of Functional Programming Special Issue on Generic Programming, 20(3&4), June 2010. Google Scholar
Digital Library
- J. Launchbury. A Natural Semantics for Lazy Evaluation. In POPL '93, pages 144--154. ACM, 1993. Google Scholar
Digital Library
- A. Moran and D. Sands. Improvement in a Lazy Context: An Operational Theory for Call-by-Need. Extended version of {16}, available at http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.37.144&rep=rep1&type=pdf.Google Scholar
- A. Moran and D. Sands. Improvement in a Lazy Context: An Operational Theory for Call-by-Need. In POPL '99, pages 43--56. ACM, 1999. Google Scholar
Digital Library
- C. Okasaki. Purely Functional Data Structures. Cambridge University Press, 1999. Google Scholar
Digital Library
- B. O'Sullivan. Criterion, A New Benchmarking Library for Haskell, 2009. URL http://www.serpentine.com/blog/2009/09/29/criterion-a-new-benchmarking-libraryfor-haskell/.Google Scholar
- W. Partain. The nofib Benchmark Suite of Haskell Programs. In Glasgow Workshop on Functional Programming, pages 195--202. Springer, 1992. Google Scholar
Digital Library
- S. L. Peyton Jones. Compiling Haskell by Program Transformation: A Report from the Trenches. In ESOP, pages 18--44. Springer, 1996. Google Scholar
Digital Library
- D. Sands. Operational Theories of Improvement in Functional Languages (Extended Abstract). In Glasgow Workshop on Functional Programming, 1991. Google Scholar
Digital Library
- D. Sands. From SOS Rules to Proof Principles: An Operational Metatheory for Functional Languages. In POPL '97, pages 428--441. ACM Press, 1997. Google Scholar
Digital Library
- D. Sands. Improvement Theory and its Applications. In Higher Order Operational Techniques in Semantics, Publications of the Newton Institute. Cambridge University Press, 1997. Google Scholar
Digital Library
- P. M. Sansom and S. L. Peyton Jones. Formally Based Profiling for Higher-Order Functional Languages. ACM Transactions on Programming Languages and Systems, 19(2), 1997. Google Scholar
Digital Library
- N. Sculthorpe and G. Hutton. Work It, Wrap It, Fix It, Fold It. Journal of Functional Programming, 2014.Google Scholar
- N. Sculthorpe, A. Farmer, and A. Gill. The HERMIT in the Tree: Mechanizing Program Transformations in the GHC Core Language. In Proceedings of Implementation and Application of Functional Languages (IFL '12), volume 8241 of Lecture Notes in Computer Science, pages 86--103, 2013.Google Scholar
Cross Ref
- P. Sestoft. Deriving a Lazy Abstract Machine. Journal of Functional Programming, 7(3):231--264, 1997. Google Scholar
Digital Library
- D. A. Turner. Elementary Strong Functional Programming. In FPLE '95, volume 1022 of Lecture Notes in Computer Science. Springer, 1995. Google Scholar
Digital Library
- J. Voigtländer and P. Johann. Selective Strictness and Parametricity in Structural Operational Semantics, Inequationally. Theor. Comput. Sci., 388(1-3):290--318, 2007. Google Scholar
Digital Library
- C. P. Wadsworth. Semantics and Pragmatics of the Lambda Calculus. PhD thesis, Computing Laboratory, University of Oxford, 1971.Google Scholar
- O. Wilde. Lady Windermere's Fan, A Play About a Good Woman. First performed in 1892.Google Scholar
Index Terms
Worker/wrapper/makes it/faster
Recommendations
Worker/wrapper/makes it/faster
ICFP '14: Proceedings of the 19th ACM SIGPLAN international conference on Functional programmingMuch research in program optimization has focused on formal approaches to correctness: proving that the meaning of programs is preserved by the optimisation. Paradoxically, there has been comparatively little work on formal approaches to efficiency: ...
Total correctness by local improvement in the transformation of functional programs
The goal of program transformation is to improve efficiency while preserving meaning. One of the best-known transformation techniques is Burstall and Darlington's unfold-fold method. Unfortunately the unfold-fold method itself guarantees neither ...
The worker/wrapper transformation
The worker/wrapper transformation is a technique for changing the type of a computation, usually with the aim of improving its performance. It has been used by compiler writers for many years, but the technique is little known in the wider functional ...







Comments