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

User-level transactional programming in Haskell

Published: 17 September 2006 Publication 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.
[2]
E.W. Dijkstra. Cooperating sequential processes. In F. Genys, editor, Programming Languages, pages 43--112. Academic Press, New York, 1968.
[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.
[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.
[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.
[6]
Haskell 98, a non-strict, purely functional language. http://www.haskell.org/definition, Dec. 1998.
[7]
M. Herlihy. Apologizing versus asking permission: Optimistic concurrency control for abstract data types. ACM Trans. Database Syst., 15(1):96--124, 1990.
[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.
[9]
C. A. R. Hoare. Monitors: An operating system structuring concept. Communications of the ACM, 17(10):549--557, Oct. 1974.
[10]
J. Launchbury and S. L. Peyton Jones. State in Haskell. Lisp and Symbolic Computation, 8(4):293--341, Dec. 1995.
[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.
[12]
S. Microsystems. Enterprise Java Beans Specification 2.1. http://java.sun.com/products/ejb/docs.html, Nov. 2003.
[13]
E. Moggi and A. Sabry. Monadic encapsulation of effects: a revised approach (extended version). J. Functional Programming, 11(6):591--627, 2001.
[14]
E. Peligri-Llopart and L. Cable. Java Server Pages Specification. http://java.sun.com/products/jsp/index.html, 1999.
[15]
S. Peyton Jones, editor. Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, 2003.
[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.
[17]
R. Ramakrishnan. Database Management Systems. McGraw-Hill, 1997.
[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.
[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.
[20]
A. Silberschatz, H. Korth, and S. Sudarshan. Database System Concepts. McGraw-Hill, third edition, 1997.
[21]
P. Thiemann. An embedded domain-specific language for type-safe server-side Web-scripting. ACM Trans. Internet Technology, 5(1):1--46, 2005.
[22]
P. Thiemann. Wash server pages. In Proc. Eighth International Symposium on Functional and Logic Programming FLOPS 2006, Fuji Susono, Japan, Apr. 2006. Springer.
[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.

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 September 2006

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

ICFP06
Sponsor:

Acceptance Rates

Overall Acceptance Rate 57 of 143 submissions, 40%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 1,659
    Total Downloads
  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)1
Reflects downloads up to 19 Feb 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media