Typed Exeptions and Continuations Cannot Macro-Express Each Other

The most powerful control constructs in modern programming languages are continuations and exceptions. Although they can be used interchangeably in some cases, they are fundamentally different semantically. We consider two simply-typed functional languages with exceptions and continuations, respectively. We give two theorems, one that holds in the language with exceptions and one that holds in the language with continuations.A fortiori, these theorems imply that exception constructs cannot be used to macro-express continuation constructs, and that continuation constructs cannot be used to macro-express exception constructs.

[1]  Albert R. Meyer,et al.  Continuation Semantics in Typed Lambda-Calculi (Summary) , 1985, Logic of Programs.

[2]  ThieleckeHayo Using a Continuation Twice and Its Implications for the Expressive Power of call/cc , 1999 .

[3]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[4]  Matthias Felleisen,et al.  On the Expressive Power of Programming Languages , 1990, ESOP.

[5]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[6]  Mark Lillibridge Exceptions Are Strictly More Powerful Than Call/CC. , 1995 .

[7]  Matthias Felleisen,et al.  Reasoning with continuations II: full abstraction for models of control , 1990, LISP and Functional Programming.

[8]  Matthias Felleisen,et al.  The theory and practice of first-class prompts , 1988, POPL '88.

[9]  Matthias Felleisen,et al.  On the Expressive Power of Programming Languages , 1990, European Symposium on Programming.

[10]  Robert Hieb,et al.  Revised 5 Report on the Algorithmic Language , 1999 .

[11]  Olivier Danvy,et al.  Back to direct style II: first-class continuations , 1992, LFP '92.

[12]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[13]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[14]  A. vanWijngaarden Recursive definition of syntax and semantics : (proceedings ifip working conference on formal language description languages, vienna 1966, p 13-24) , 1966 .

[15]  Robin Milner,et al.  Definition of standard ML , 1990 .

[16]  P. J. Landin,et al.  A Generalization of Jumps and Labels , 1998, High. Order Symb. Comput..

[17]  Olivier Danvy,et al.  Back to Direct Style II: First-Class Continuations , 1996 .

[18]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[19]  R. Kent Dybvig,et al.  Revised5 Report on the Algorithmic Language Scheme , 1986, SIGP.

[20]  John C. Reynolds,et al.  The discoveries of continuations , 1993, LISP Symb. Comput..

[21]  Jonathan Rees,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[22]  James H. Morris,et al.  Lambda-calculus models of programming languages. , 1969 .

[23]  G. M. Bierman A Computational Interpretation of the lambda-µ-Calculus , 1998, MFCS.

[24]  Mark Lillibridge,et al.  Unchecked Exceptions Can Be Strictly More Powerful Than Call/CC , 1999, High. Order Symb. Comput..

[25]  C.-H. Luke Ong,et al.  A Curry-Howard foundation for functional computation with control , 1997, POPL '97.

[26]  Hayo Thielecke,et al.  Using a Continuation Twice and Its Implications for the Expressive Power of call/cc , 1999, High. Order Symb. Comput..

[27]  Gilles Kahn,et al.  Natural Semantics , 1987, STACS.