ABSTRACT
Asynchronous exceptions, such as timeouts are important for robust, modular programs, but are extremely difficult to program with — so much so that most programming languages either heavily restrict them or ban them altogether. We extend our earlier work, in which we added synchronous exceptions to Haskell, to support asynchronous exceptions too. Our design introduces scoped combinators for blocking and unblocking asynchronous interrupts, along with a somewhat surprising semantics for operations that can suspend. Uniquely, we also give a formal semantics for our system.
- 1.J. Armstrong, R. Virding, C. Wikstrom, and M. Williams. Concurrent Programming in Erlang. Prentice Hall Europe, second edition, 1996.]] Google ScholarDigital Library
- 2.K. Arnold and J. Gosling. The Java Programming Language. The Java Series. Addison-Wesley, second edition, 1998.]] Google ScholarDigital Library
- 3.P. Barth, R. S. Nikhil, and Arvind. M-Structures: Extending a parallel, non-strict functional language with state. In R. J. M. Hughes, editor, Proc. FPCA'91, volume 523 of LNCS, pages 538-568. Springer-Verlag, 1991.]] Google ScholarDigital Library
- 4.A. D. Birrell, J. V. Guttag, J. J. Horning, and R. Levin. Thread synchronization: A formal specification. In G. Nelson, editor, Systems Programming with Modula- 3, chapter 5, pages 119-129. Prentice Hall, Englewood Cliffs, NJ, 1991.]]Google Scholar
- 5.R. P. Gabriel and J. McCarthy. Queue-based multiprocessing Lisp. In Proc. LFP'84, pages 25-44, Aug. 1984.]] Google ScholarDigital Library
- 6.T. Ito and M. Matsui. A parallel lisp language PaiLisp and its kernel specification. In Parallel Lisp: Languages and Systems, volume 441 of LNCS, pages 58-100, June 1989.]] Google ScholarDigital Library
- 7.X. Leroy, D.Remy, J.Vouillon, and D. Doligez. The Objective Caml system documentation and user's manual (release 2.04). Technical report, INRIA, 1999. At http://caml.inria.fr/ocaml/htmlman/.]]Google Scholar
- 8.S. Marlow. Writing high-performance server applications in Haskell, case study: A Haskell web server. In Haskell Workshop, Montreal, Canada, September 2000.]]Google Scholar
- 9.R. Milner. The polyadic calculus: A tutorial. In F. L. Hamer, W. Brauer, and H. Schwichtenberg, editors, Logic and Algebra of Specification. Springer- Verlag, 1993.]]Google ScholarCross Ref
- 10.R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML(Revised). MIT Press, Cambridge, Massachusetts, 1997.]] Google ScholarDigital Library
- 11.A. K. Moran, S. B. Lassen, and S. L. Peyton Jones. Imprecise exceptions, co-inductively. InProc. HOOTS'99, volume 26 of Electronic Notes in Theoretical Computer Science, Paris, Sept. 1999.]]Google Scholar
- 12.S. Peyton Jones. Tackling the awkward squad: monadic input/output, concurrency, exceptio ns, and foreignlanguage calls in Haskell. In R. Steinbrueggen, editor, Engineering theories of software construction, Marktoberdorf Summer School 2000, NATO ASI Series. IOS Press, 2001.]]Google Scholar
- 13.S. Peyton Jones, R. Hughes, L. Augustsson, D. Barton, B. Boutel, W. Burton, J. Fasel, K. Hammond, R. Hinze, P. Hudak, T. Johnsson, M. Jones, J. Launchbury, E. Meijer, J. Peterson, A. Reid, C. Runciman, and P. Wadler. Report on the programming language Haskell 98. Technical report, Feb. 1998.]]Google Scholar
- 14.S. L. Peyton Jones, A. Gordon, and S. Finne. Concurrent Haskell. In Proc. POPL'96, pages 295-308, St. Petersburg, Florida, Jan. 1996. ACM Press.]] Google ScholarDigital Library
- 15.S. L. Peyton Jones, A. Reid, T. Hoare, S. Marlow, and F. Henderson. A semantics for imprecise exceptions. In Proc. PLDI'99, volume 34(5) of ACM SIGPLAN Notices, pages 25-36. ACM Press, May 1999.]] Google ScholarDigital Library
- 16.A. Reid. Handling exceptions in Haskell. Research Report YALEU/DCS/RR-1175, Yale University, Aug. 1998.]]Google Scholar
- 17.A. Reid. Putting the spine back in the Spineless Tagless G-Machine: An implementation of resumable blackholes. In Proc. IFL'98 (selected papers), volume 1595 of LNCS, pages 186-199. Springer-Verlag, 1999.]] Google ScholarDigital Library
- 18.J. H. Reppy. Asynchronous signals in Standard ML. Technical Report TR90-1144, Cornell University, Computer Science Department, Aug. 1990.]] Google ScholarDigital Library
- 19.J. H. Reppy. Concurrent Programming in ML. Cambridge University Press, Oct. 1999.]] Google ScholarDigital Library
- 20.Why are Thread.stop, Thread.suspend, Thread.resume, and Runtime.runFinalizers On Exit deprecated? In the Java 2 SDK Standard Edition Documentation. At http://java.sun.com/products/jdk/1.3/docs/guide/ misc/threadPrimitiveDeprecation.html.]]Google Scholar
- 21.K. Yi. Compile-time detection of uncaught exceptions in Standard ML programs. In Proc. SAS'94, volume 864 of LNCS, pages 238-254, Sept. 1994.]]Google Scholar
Index Terms
- Asynchronous exceptions in Haskell
Recommendations
Asynchronous exceptions in Haskell
Asynchronous exceptions, such as timeouts are important for robust, modular programs, but are extremely difficult to program with — so much so that most programming languages either heavily restrict them or ban them altogether. We extend our earlier ...
Explicitly typed exceptions for haskell
PADL'10: Proceedings of the 12th international conference on Practical Aspects of Declarative LanguagesWe describe a monad for checked, explicitly typed exceptions, which provides as a simple Haskell library what for other languages is a native feature. Multi parameter type classes and overlapping instances are the only essential extensions to Haskell 98 ...
The Intel labs Haskell research compiler
Haskell '13The Glasgow Haskell Compiler (GHC) is a well supported optimizing compiler for the Haskell programming language, along with its own extensions to the language and libraries. Haskell's lazy semantics imposes a runtime model which is in general difficult ...
Comments