skip to main content
10.1145/1159842.1159853acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

User-level transactional programming in Haskell

Published:17 September 2006Publication History

ABSTRACT

Correct handling of concurrently accessed external resources is a demanding problem in programming. The standard approaches rely on database transactions or concurrency mechanisms like locks. The paper considers two such resources, global variables and databases, and defines transactional APIs for them in Haskell. The APIs provide a novel flavor of user-level transactions which are particularly suitable in the context of web-based systems. This suitability is demonstrated by providing a second implementation in the context of WASH, a Haskell-based Web programming system. The underlying implementation framework works for both kinds of resources and can serve as a blueprint for further implementations of user-level transactions. The Haskell type system provides an encapsulation of the transactional scope that avoids unintended breakage of the transactional guarantees.

References

  1. E. F. Codd. Extending the database relational model to capture more meaning. ACM Trans. Database Syst., 4(4):397--434, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. E.W. Dijkstra. Cooperating sequential processes. In F. Genys, editor, Programming Languages, pages 43--112. Academic Press, New York, 1968.Google ScholarGoogle Scholar
  3. N. Haines, D. Kindred, J. G. Morrisett, S. M. Nettles, and J. M. Wing. Composing first-class transactions. ACM Trans. Programming Languages and Systems, 16(6):1719--1736, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. T. Harris and K. Fraser. Language support for lightweight transactions. In OOPSLA '03: Proc. 18th ACM Conf., pages 388--402, Anaheim, CA, USA, 2003. ACM Press, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. T. Harris, S. Marlow, S. Peyton Jones, and M. Herlihy. Composable memory transactions. In Sixteenth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, Chicago, IL, USA, June 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Haskell 98, a non-strict, purely functional language. http://www.haskell.org/definition, Dec. 1998.Google ScholarGoogle Scholar
  7. M. Herlihy. Apologizing versus asking permission: Optimistic concurrency control for abstract data types. ACM Trans. Database Syst., 15(1):96--124, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Herlihy, V. Luchangco, M. Moir, and I. William N. Scherer. Software transactional memory for dynamic-sized data structures. In PODC '03: Proceedings of the Twentysecond Annual Symposium on Principles of Distributed Computing, pages 92--101, Boston, Massachusetts, 2003. ACM Press, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. A. R. Hoare. Monitors: An operating system structuring concept. Communications of the ACM, 17(10):549--557, Oct. 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Launchbury and S. L. Peyton Jones. State in Haskell. Lisp and Symbolic Computation, 8(4):293--341, Dec. 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. Leijen and E. Meijer. Domain-specific embedded compilers. In 2nd Conference on Domain-Specific Languages, Austin, Texas, USA, Oct. 1999. USENIX. http://usenix.org/events/dsl99/index.html. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Microsystems. Enterprise Java Beans Specification 2.1. http://java.sun.com/products/ejb/docs.html, Nov. 2003.Google ScholarGoogle Scholar
  13. E. Moggi and A. Sabry. Monadic encapsulation of effects: a revised approach (extended version). J. Functional Programming, 11(6):591--627, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. E. Peligri-Llopart and L. Cable. Java Server Pages Specification. http://java.sun.com/products/jsp/index.html, 1999.Google ScholarGoogle Scholar
  15. S. Peyton Jones, editor. Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, 2003.Google ScholarGoogle Scholar
  16. S. Peyton Jones, A. Gordon, and S. Finne. Concurrent Haskell. In Proc. 1996 ACM SIGPLAN Symp. on Principles of Programming Languages, pages 295--308, St. Petersburg Beach, Florida, USA, Jan. 1996. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. Ramakrishnan. Database Management Systems. McGraw-Hill, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. F. Ringenburg and D. Grossman. AtomCaml: First-class atomicity via rollback. In B. C. Pierce, editor, Proc. Intl. Conf. Functional Programming 2005, pages 92--104, Tallinn, Estonia, Sept. 2005. ACM Press, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. N. Shavit and D. Touitou. Software transactional memory. In PODC '95: Proceedings of the Fourteenth Annual ACM Symposium on Principles of Distributed Computing, pages 204--213, Ottowa, Ontario, Canada, 1995. ACM Press, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Silberschatz, H. Korth, and S. Sudarshan. Database System Concepts. McGraw-Hill, third edition, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P. Thiemann. An embedded domain-specific language for type-safe server-side Web-scripting. ACM Trans. Internet Technology, 5(1):1--46, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. P. Thiemann. Wash server pages. In Proc. Eighth International Symposium on Functional and Logic Programming FLOPS 2006, Fuji Susono, Japan, Apr. 2006. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. A. Welc, S. Jagannathan, and A. Hosking. Safe futures for Java. In OOPSLA '05: Proceedings of the 20th ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, pages 439--453, San Diego, CA, USA, 2005. ACM Press, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. User-level transactional programming in Haskell

          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
            Haskell '06: Proceedings of the 2006 ACM SIGPLAN workshop on Haskell
            September 2006
            131 pages
            ISBN:1595934898
            DOI:10.1145/1159842

            Copyright © 2006 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 ACM 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: 17 September 2006

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • Article

            Acceptance Rates

            Overall Acceptance Rate57of143submissions,40%

            Upcoming Conference

            ICFP '24
          • Article Metrics

            • Downloads (Last 12 months)3
            • Downloads (Last 6 weeks)1

            Other Metrics

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader