skip to main content
research-article

CEAL: a C-based language for self-adjusting computation

Authors Info & Claims
Published:15 June 2009Publication History
Skip Abstract Section

Abstract

Self-adjusting computation offers a language-centric approach to writing programs that can automatically respond to modifications to their data (e.g., inputs). Except for several domain-specific implementations, however, all previous implementations of self-adjusting computation assume mostly functional, higher-order languages such as Standard ML. Prior to this work, it was not known if self-adjusting computation can be made to work with low-level, imperative languages such as C without placing undue burden on the programmer.

We describe the design and implementation of CEAL: a C-based language for self-adjusting computation. The language is fully general and extends C with a small number of primitives to enable writing self-adjusting programs in a style similar to conventional C programs. We present efficient compilation techniques for translating CEAL programs into C that can be compiled with existing C compilers using primitives supplied by a run-time library for self-adjusting computation. We implement the proposed compiler and evaluate its effectiveness. Our experiments show that CEAL is effective in practice: compiled self-adjusting programs respond to small modifications to their data by orders of magnitude faster than recomputing from scratch while slowing down a from-scratch run by a moderate constant factor. Compared to previous work, we measure significant space and time improvements.

References

  1. MLton. http://mlton.org/.Google ScholarGoogle Scholar
  2. Martín Abadi, Butler W. Lampson, and Jean-Jacques Lévy. Analysis and Caching of Dependencies. In Proceedings of the International Conference on Functional Programming, pages 83--91, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Umut A. Acar. Self-adjusting computation (an overview). In Proceedings of ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Umut A. Acar, Amal Ahmed, and Matthias Blume. Imperative self-adjusting computation. In Proceedings of the 25th Annual ACM Symposium on Principles of Programming Languages, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Umut A. Acar, Guy E. Blelloch, Kanat Tangwongsan, and Duru Türkoglu. Robust Kinetic Convex Hulls in 3D. In Proceedings of the 16th Annual European Symposium on Algorithms, September 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Umut A. Acar, Guy E. Blelloch, and Jorge L. Vittes. An experimental analysis of change propagation in dynamic trees. In Workshop on Algorithm Engineering and Experimentation, 2005.Google ScholarGoogle Scholar
  7. Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: principles, techniques, and tools. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Andrew W. Appel. SSA is functional programming. SIGPLAN Not., 33(4):17--20, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Henry G. Baker. Cons should not cons its arguments, part II: Cheney on the MTA. SIGPLAN Not., 30(9):17--20, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. A. Bergstra, T. B. Dinesh, and J. Heering. A complete transformational toolkit for compilers. ACM Transactions on Programming Languages and Systems, 19:639--684, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Gerth Stolting Brodal and Riko Jacob. Dynamic planar convex hull. In Proceedings of the 43rd Annual IEEE Symposium on Foundations of Computer Science, pages 617--626, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Magnus Carlsson. Monads for Incremental Computing. In Proceedings of the 7th ACM SIGPLAN International Conference on Functional programming, pages 26--35. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Y.-J. Chiang and R. Tamassia. Dynamic algorithms in computational geometry. Proceedings of the IEEE, 80(9):1412--1434, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  14. Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy. A simple, fast dominance algorithm.Google ScholarGoogle Scholar
  15. Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. Efficiently computing static single assignment form and the control dependence graph ACM Transactions on Programming Languages and Systems, 13(4):451--490, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Alan Demers, Thomas Reps, and Tim Teitelbaum. Incremental Evaluation of Attribute Grammars with Application to Syntax-directed Editors. In Proceedings of the 8th Annual ACM Symposium on Principles of Programming Languages, pages 105--116, 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. David Eppstein, Zvi Galil, and Giuseppe F. Italiano. Dynamic graph algorithms. In Mikhail J. Atallah, editor, Algorithms and Theory of Handbook, chapter 8. CRC Press, 1999.Google ScholarGoogle Scholar
  18. Matthew Fluet and Stephen Weeks. Contification using dominators. In Proceedings of the International Conference on Functional Programming, pages 2--13, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Loukas Georgiadis and Robert E. Tarjan. Finding dominators revisited: extended abstract. In Proceedings of the fifteenth annual ACM-SIAM symposium on Discrete algorithms, pages 869--878, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Jr. Guy L. Steele. Rabbit: A compiler for scheme. Technical report, Cambridge, MA, USA, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Matthew A. Hammer and Umut A. Acar. Memory management for self-adjusting computation. In ISMM '08: Proceedings of the 7th international symposium on Memory management, pages 51--60, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Matthew A. Hammer, Umut A. Acar, and Yan Chen. CEAL: A C-based language for self-adjusting computation. Technical Report TTIC-TR-2009-2, Toyota Technological Institute, 2009.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Simon L Peyton Jones. Implementing lazy functional languages on stock hardware: The spineless tagless g-machine. Journal of Functional Programming, 2:127--202, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  24. Simon Peyton Jones. C--: A portable assembly language. In Proceedings of the 1997 Workshop on Implementing Functional Languages. Springer Verlag, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Richard A. Kelsey. A correspondence between continuation passing style and static single assignment form. In Papers from the 1995 ACM SIGPLAN workshop on Intermediate representations, pages 13--22, New York, NY, USA, 1995. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Thomas Lengauer and Robert Endre Tarjan. A fast algorithm for finding dominators in a flowgraph. ACM Transactions on Programming Languages and Systems, 1(1):121--141, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Ruy Ley-Wild, Matthew Fluet, and Umut A. Acar. Compiling self-adjusting programs with continuations. In Proceedings of the International Conference on Functional Programming, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Gary L. Miller and John H. Reif. Parallel tree contraction, part I: Fundamentals Advances in Computing Research, 5:47--72, 1989.Google ScholarGoogle Scholar
  29. Gary L. Miller and John H. Reif. Parallel tree contraction, part 2: Further applications. SIAM Journal on Computing, 20(6):1128--1147, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Steven S. Muchnick. Advanced compiler design and implementation. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. George C. Necula, Scott Mcpeak, S. P. Rahul, and Westley Weimer. Cil: Intermediate language and tools for analysis and transformation of C programs. In In International Conference on Compiler Construction, pages 213---228, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Mark H. Overmars and Jan van Leeuwen. Maintenance of configurations in the plane. Journal of Computer and System Sciences, 23: 166--204, 1981.Google ScholarGoogle Scholar
  33. William Pugh and Tim Teitelbaum. Incremental computation via function caching. In Proceedings of the 16th Annual ACM Symposium on Principles of Programming Languages, pages 315--328, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. G. Ramalingam and T. Reps. A Categorized Bibliography on Incremental Computation. In Proceedings of the 20th Annual ACM Symposium on Principles of Programming Languages, pages 502--510, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Ajeet Shankar and Rastislav Bodik. DITTO: Automatic Incrementalization of Data Structure Invariant Checks (in Java). In Proceedings of the ACM SIGPLAN 2007 Conference on Programming language Design and Implementation, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. David Tarditi, Peter Lee, and Anurag Acharya. No assembly required: compiling standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Andrew Tolmach and Dino P. Oliva. From ML to Ada: Strongly-typed language interoperability via source translation. Journal of Functional Programming, 8(4):367--412, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. CEAL: a C-based language for self-adjusting computation

    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

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!