skip to main content
10.1145/2594291.2594304acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

A theory of changes for higher-order languages: incrementalizing λ-calculi by static differentiation

Published:09 June 2014Publication History

ABSTRACT

If the result of an expensive computation is invalidated by a small change to the input, the old result should be updated incrementally instead of reexecuting the whole computation. We incrementalize programs through their derivative. A derivative maps changes in the program's input directly to changes in the program's output, without reexecuting the original program. We present a program transformation taking programs to their derivatives, which is fully static and automatic, supports first-class functions, and produces derivatives amenable to standard optimization.

We prove the program transformation correct in Agda for a family of simply-typed λ-calculi, parameterized by base types and primitives. A precise interface specifies what is required to incrementalize the chosen primitives.

We investigate performance by a case study: We implement in Scala the program transformation, a plugin and improve performance of a nontrivial program by orders of magnitude.

References

  1. U. A. Acar. Self-Adjusting Computation. PhD thesis, Princeton University, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. U. A. Acar. Self-adjusting computation: (an overview). In PEPM, pages 1--6. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. U. A. Acar, G. E. Blelloch, and R. Harper. Adaptive functional programming. TOPLAS, 28(6):990--1034, Nov. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. U. A. Acar, G. E. Blelloch, M. Blume, R. Harper, and K. Tangwongsan. An experimental analysis of self-adjusting computation. TOPLAS, 32 (1):3:1--3:53, Nov. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. U. A. Acar, G. Blelloch, R. Ley-Wild, K. Tangwongsan, and D. Turkoglu. Traceable data types for self-adjusting computation. In PLDI, pages 483--496. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Agda Development Team. The Agda Wiki. http://wiki.portal.chalmers.se/agda/, 2013. Accessed on 2013-10-30.Google ScholarGoogle Scholar
  7. A. W. Appel and T. Jim. Shrinking lambda expressions in linear time. JFP, 7:515--540, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. A. Blakeley, P.-A. Larson, and F. W. Tompa. Efficiently updating materialized views. In SIGMOD, pages 61--71. ACM, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Y. Chen, J. Dunfield, M. A. Hammer, and U. A. Acar. Implicit self-adjusting computation for purely functional programs. In ICFP, pages 129--141. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Elliott and P. Hudak. Functional reactive animation. In ICFP, pages 263--273. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. G. Giarrusso, K. Ostermann, M. Eichberg, R. Mitschke, T. Rendel, and C. Kästner. Reify your collection queries for modularity and speed! In AOSD, pages 1--12. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Gluche, T. Grust, C. Mainberger, and M. Scholl. Incremental updates for materialized OQL views. In Deductive and Object-Oriented Databases, volume 1341 of LNCS, pages 52--66. Springer, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. Gupta and I. S. Mumick. Maintenance of materialized views: problems, techniques, and applications. In A. Gupta and I. S. Mumick, editors, Materialized views, pages 145--157. MIT Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. A. Hammer, G. Neis, Y. Chen, and U. A. Acar. Self-adjusting stack machines. In OOPSLA, pages 753--772. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Koch. Incremental query evaluation in a ring of databases. In Symp. Principles of Database Systems (PODS), pages 87--98. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. Lämmel. Google's MapReduce programming model --- revisited. Sci. Comput. Program., 68(3):208--237, Oct. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Y. A. Liu. Efficiency by incrementalization: An introduction. HOSC, 13(4):289--313, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. I. Maier and M. Odersky. Higher-order reactive programming with incremental lists. In ECOOP, pages 707--731. Springer-Verlag, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. C. Mitchell. Foundations of programming languages. MIT Press, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. Paige and S. Koenig. Finite differencing of computable expressions. TOPLAS, 4(3):402--454, July 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. G. Ramalingam and T. Reps. A categorized bibliography on incremental computation. In POPL, pages 502--510. ACM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. T. Rompf and M. Odersky. Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs. In GPCE, pages 127--136. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. G. Salvaneschi and M. Mezini. Reactive behavior in object-oriented applications: an analysis and a research roadmap. In AOSD, pages 37--48. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. D. Willis, D. J. Pearce, and J. Noble. Caching and incrementalisation in the Java Query Language. In OOPSLA, pages 1--18. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A theory of changes for higher-order languages: incrementalizing λ-calculi by static differentiation

        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
          PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation
          June 2014
          619 pages
          ISBN:9781450327848
          DOI:10.1145/2594291
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 49, Issue 6
            PLDI '14
            June 2014
            598 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/2666356
            • Editor:
            • Andy Gill
            Issue’s Table of Contents

          Copyright © 2014 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 the author(s) 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: 9 June 2014

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          PLDI '14 Paper Acceptance Rate52of287submissions,18%Overall Acceptance Rate406of2,067submissions,20%

          Upcoming Conference

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader