skip to main content
research-article

Modular rollback through control logging: a pair of twin functional pearls

Published:19 September 2011Publication History
Skip Abstract Section

Abstract

We present a technique, based on the use of first-class control operators, enabling programs to maintain and invoke rollback logs for sequences of reversible effects. Our technique is modular, in that it provides complete separation between some library of effectful operations, and a client, "driver" program which invokes and rolls back sequences of these operations. In particular, the checkpoint mechanism, which is entirely encapsulated within the effect library, logs not only the library's effects, but also the client's control state. Thus, logging and rollback can be almost completely transparent to the client code.

This separation of concerns manifests itself nicely when we must implement software with sophisticated error handling. We illustrate with two examples that exploit the architecture to disentangle some core parsing task from its error management. The parser code is completely separate from the error-correction code, although the two components are deeply intertwined at run time.

Skip Supplemental Material Section

Supplemental Material

_talk6.mp4

References

  1. E. Biagioni, K. Cline, P. Lee, C. Okasaki, and C. Stone. Safe-for-space threads in Standard ML. Higher Order and Symbolic Computation, 11: 209--225, Sept. 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. G. Burke and G. A. Fisher. A practical method for LR and LL syntactic error diagnosis and recovery. ACM Transactions on Programming Languages and Systems, 9 (2): 164--197, Mar. 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. O. Danvy and A. Filinski. Abstracting control. In Proceedings of the 1990 ACM Conference on LISP and Functional Programming (LFP'90), pages 151--160, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Felleisen. The theory and practice of first-class prompts. In Conference Record of POPL 1988: The Fifteenth ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 180--190, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Herman. Functional pearl: The great escape, or how to jump the border without getting caught. In Proceedings of the Twelfth ACM SIGPLAN International Conference on Functional Programming (ICFP'07), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. Hutton and E. Meijer. Monadic parsing in Haskell. Journal of Functional Programming, 8 (4): 437--444, July 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Kelsey and J. Rees. The Scheme48 system. http://s48.org.Google ScholarGoogle Scholar
  8. G. Kuan. A true higher-order module system. PhD thesis, University of Chicago, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. B. S. Lerner, M. Flower, D. Grossman, and C. Chambers. Searching for type-error messages. In Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'07), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. K. M. Pitman. Ambitious evaluation: a new reading of an old issue. Lisp Pointers, VIII (2), May 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Rossberg, C. Russo, and D. Dreyer. F-ing modules. In Proceedings of the ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI'10), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. O. Shivers, B. Carlstrom, M. Gasbichler, and M. Sperber. The scsh manual, release 0.6.6. http://scsh.net, Mar. 2004.Google ScholarGoogle Scholar
  13. D. Sitaram and M. Felleisen. Control delimiters and their hierarchies. Lisp and Symbolic Computation, 3: 67--99, May 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Modular rollback through control logging: a pair of twin functional pearls

    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

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 46, Issue 9
      ICFP '11
      September 2011
      456 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2034574
      Issue’s Table of Contents
      • cover image ACM Conferences
        ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
        September 2011
        470 pages
        ISBN:9781450308656
        DOI:10.1145/2034773

      Copyright © 2011 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 19 September 2011

      Check for updates

      Qualifiers

      • research-article

    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!