User-level transactional programming in Haskell

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.

[1]  Peter Thiemann WASH Server Pages , 2006, FLOPS.

[2]  Simon L. Peyton Jones,et al.  Composable memory transactions , 2005, CACM.

[3]  Raghu Ramakrishnan,et al.  Database Management Systems , 1976 .

[4]  Ralf Hinze,et al.  Haskell 98 — A Non−strict‚ Purely Functional Language , 1999 .

[5]  J. Gregory Morrisett,et al.  Composing first-class transactions , 1994, TOPL.

[6]  Maurice Herlihy,et al.  Software transactional memory for dynamic-sized data structures , 2003, PODC '03.

[7]  Simon L. Peyton Jones,et al.  Concurrent Haskell , 1996, POPL '96.

[8]  E. F. Codd,et al.  Extending the database relational model to capture more meaning , 1979, ACM Trans. Database Syst..

[9]  Simon L. Peyton Jones,et al.  State in Haskell , 1995, LISP Symb. Comput..

[10]  Peter Thiemann,et al.  An embedded domain-specific language for type-safe server-side web scripting , 2005, TOIT.

[11]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[12]  Abraham Silberschatz,et al.  Database System Concepts , 1980 .

[13]  Edsger W. Dijkstra,et al.  Cooperating sequential processes , 2002 .

[14]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[15]  Keir Fraser,et al.  Language support for lightweight transactions , 2003, SIGP.

[16]  C. A. R. Hoare,et al.  Monitors: an operating system structuring concept , 1974, CACM.

[17]  Daan Leijen,et al.  Domain specific embedded compilers , 1999, DSL '99.

[18]  Abraham Silberschatz,et al.  Database Systems Concepts , 1997 .

[19]  Maurice Herlihy,et al.  Apologizing versus asking permission: optimistic concurrency control for abstract data types , 1990, TODS.

[20]  Dan Grossman,et al.  AtomCaml: first-class atomicity via rollback , 2005, ICFP '05.

[21]  Amr Sabry,et al.  Monadic encapsulation of effects: a revised approach (extended version) , 2001, J. Funct. Program..

[22]  Suresh Jagannathan,et al.  Safe futures for Java , 2005, OOPSLA '05.