A semantics for imprecise exceptions

Some modern superscalar microprocessors provide only imprecise exceptions. That is, they do not guarantee to report the same exception that would be encountered by a straightforward sequential execution of the program. In exchange, they offer increased performance or decreased chip area (which amount to much the same thing).This performance/precision tradeoff has not so far been much explored at the programming language level. In this paper we propose a design for imprecise exceptions in the lazy functional programming language Haskell. We discuss several designs, and conclude that imprecision is essential if the language is still to enjoy its current rich algebra of transformations. We sketch a precise semantics for the language extended with exceptions.The paper shows how to extend Haskell with exceptions without crippling the language or its compilers. We do not yet have enough experience of using the new mechanism to know whether it strikes an appropriate balance between expressiveness and performance.

[1]  J. Michael Spivey,et al.  A Functional Theory of Exceptions , 1990, Sci. Comput. Program..

[2]  Alan Mycroft,et al.  The Theory and Practice of Transforming Call-by-need into Call-by-value , 1980, Symposium on Programming.

[3]  Simon L. Peyton Jones,et al.  Imperative functional programming , 1993, POPL '93.

[4]  Yu Hu,et al.  Implementing O(N) N-Body Algorithms Efficiently in Data-Parallel Languages , 1996, Sci. Program..

[5]  Alexander Aiken,et al.  Program transformation in the presence of errors , 1989, POPL '90.

[6]  Rice UniversityCORPORATE,et al.  High performance Fortran language specification , 1993 .

[7]  M. S. Warren,et al.  A parallel hashed Oct-Tree N-body algorithm , 1993, Supercomputing '93.

[8]  Collin Brooks McCurdy Efficient techniques for n-body simulation on distributed memory architectures , 1999 .

[9]  Alastair David Reid Putting the Spine Back in the Spineless Tagless G-Machine: An Implementation of Resumable Black-Holes , 1998, IFL.

[10]  François Pessaux,et al.  Type-based analysis of uncaught exceptions , 2000, TOPL.

[11]  Alastair D. Reid Handling Exceptions in Haskell , 1999 .

[12]  Lennart Augustsson,et al.  Functional Pearl: On generating unique names , 1994, Journal of Functional Programming.

[13]  Shang-Hua Teng,et al.  High performance Fortran for highly irregular problems , 1997, PPOPP '97.

[14]  Guy L. Steele,et al.  The High Performance Fortran Handbook , 1993 .

[15]  Anoop Gupta,et al.  The SPLASH-2 programs: characterization and methodological considerations , 1995, ISCA.

[16]  David G. Hough,et al.  A Proposed Radix- and Word-length-independent Standard for Floating-point Arithmetic , 1984, IEEE Micro.

[17]  John Hughes,et al.  Why Functional Programming Matters , 1989, Comput. J..

[18]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[19]  Harry Berryman,et al.  Run-Time Scheduling and Execution of Loops on Message Passing Machines , 1990, J. Parallel Distributed Comput..

[20]  William Kahan,et al.  A Proposed Radix- and Word-length-independent Standard for Floating-point Arithmetic , 1984, IEEE Micro.

[21]  John Hughes,et al.  Expressing and Reasoning About Non-Deterministic Functional Programs , 1989, Functional Programming.

[22]  Piyush Mehrotra,et al.  Compiling High Level Constructs to Distributed Memory Architectures , 1989 .

[23]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

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

[25]  Richard E. Jones,et al.  Tail recursion without space leaks , 1992, Journal of Functional Programming.