Exception handlers as extensible cases

Uloženo v:
Podrobná bibliografie
Název: Exception handlers as extensible cases
Autoři: Matthias Blume, Umut A. Acar, Wonseok Chae
Přispěvatelé: The Pennsylvania State University CiteSeerX Archives
Zdroj: http://people.cs.uchicago.edu/~blume/papers/aplas08-exceptions-submitted.pdf.
Informace o vydavateli: Springer-Verlag
Rok vydání: 2008
Sbírka: CiteSeerX
Popis: Exceptions are an indispensable part of modern programming languages. They are, however, handled poorly, especially by higherorder languages such as Standard ML and Haskell: in both languages a well-typed program can unexpectedly fail due to an uncaught exception. In this paper, we propose a technique for type-safe exception handling. Our approach relies on representing exceptions as sums and assigning exception handlers polymorphic, extensible row types. Based on this representation, we describe an implicitly typed external language EL where well-typed programs do not raise any unhandled exceptions. EL relies on sums, extensible records, and polymorphism to represent exceptionhandling, and its type system is no more complicated than that for existing languages with polymorphic extensible records. EL is translated into an internal language IL that is a variant of System F extended with extensible records. The translation performs a CPS transformation to represent exception handlers as continuations. It also relies on duality to transform sums into records. (The details for this translation are given in an accompanying technical report.) We describe the implementation of a compiler for a concrete language based on EL. The compiler performs full type inference and translates EL-style source code to machine code. Type inference relieves the programmer from having to provide explicit exception annotations. We believe that this is the first practical proposal for integrating exceptions into the type system of a higher-order language. 1
Druh dokumentu: text
Popis souboru: application/pdf
Jazyk: English
Relation: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.380.4291
Dostupnost: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.380.4291
http://people.cs.uchicago.edu/~blume/papers/aplas08-exceptions-submitted.pdf
Rights: Metadata may be used without restrictions as long as the oai identifier remains attached to it.
Přístupové číslo: edsbas.38076984
Databáze: BASE
Popis
Abstrakt:Exceptions are an indispensable part of modern programming languages. They are, however, handled poorly, especially by higherorder languages such as Standard ML and Haskell: in both languages a well-typed program can unexpectedly fail due to an uncaught exception. In this paper, we propose a technique for type-safe exception handling. Our approach relies on representing exceptions as sums and assigning exception handlers polymorphic, extensible row types. Based on this representation, we describe an implicitly typed external language EL where well-typed programs do not raise any unhandled exceptions. EL relies on sums, extensible records, and polymorphism to represent exceptionhandling, and its type system is no more complicated than that for existing languages with polymorphic extensible records. EL is translated into an internal language IL that is a variant of System F extended with extensible records. The translation performs a CPS transformation to represent exception handlers as continuations. It also relies on duality to transform sums into records. (The details for this translation are given in an accompanying technical report.) We describe the implementation of a compiler for a concrete language based on EL. The compiler performs full type inference and translates EL-style source code to machine code. Type inference relieves the programmer from having to provide explicit exception annotations. We believe that this is the first practical proposal for integrating exceptions into the type system of a higher-order language. 1