Undoing Dynamic Typing (Declarative Pearl)

We propose undoable versions of the projection operations used when programs written in higher-order statically-typed languages interoperate with dynamically typed ones, localizing potential runtime errors to the point at which a dynamic value is projected to a static type. The idea is demonstrated by using control operators to implement backtracking projections from an untyped Scheme-like language to ML.

[1]  Robert Bruce Findler,et al.  Operational semantics for multi-language programs , 2009 .

[2]  Nick Benton,et al.  Under Consideration for Publication in J. Functional Programming Embedded Interpreters , 2022 .

[3]  Robin Milner,et al.  On Observing Nondeterminism and Concurrency , 1980, ICALP.

[4]  Olivier Danvy,et al.  A Simple Solution to Type Specialization , 1998, ICALP.

[5]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[6]  Olivier Danvy Type-Directed Partial Evaluation , 1998, Partial Evaluation.

[7]  Dana S. Scott,et al.  Data Types as Lattices , 1976, SIAM J. Comput..

[8]  Norman Ramsey,et al.  Embedding an interpreted language using higher-order functions and types , 2003, IVME '03.

[9]  Philip Wadler,et al.  Well-Typed Programs Can't Be Blamed , 2009, ESOP.

[10]  Fritz Henglein Dynamic Typing , 1992, ESOP.

[11]  Kristoffer Hogsbro Rose,et al.  Type-Directed Partial Evaluation in Haskell , 1998 .

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

[13]  Matthias Felleisen,et al.  Contracts for higher-order functions , 2002, ICFP '02.

[14]  Ralf Hinze,et al.  Typed Contracts for Functional Programming , 2006, FLOPS.

[15]  Joseph E. Stoy,et al.  Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory , 1981 .

[16]  David A. McAllester,et al.  Sound and complete models of contracts , 2006, Journal of Functional Programming.

[17]  Zhe Yang Encoding types in ML-like languages , 2004, Theor. Comput. Sci..

[18]  Robert Bruce Findler,et al.  Contracts as Pairs of Projections , 2006, FLOPS.

[19]  J KennedyAndrew FUNCTIONAL PEARL Pickler combinators , 2004 .

[20]  Olivier Danvy Functional Unparsing , 1998, J. Funct. Program..