Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Abadi, M., Cardelli, L., Pierce, B., Plotkin, G.: Dynamic typing in a statically-typed language. ACM Transactions on Programming Languages and Systems (TOPLAS) 13(2) (1991)
Benton, N.: Embedded interpreters. Journal of Functional Programming 15(4) (2005)
Blume, M., McAllester, D.: Sound and complete models of contracts. Journal of Functional Programming 16(4/5) (2006)
Danvy, O.: Type-directed partial evaluation. In: Proceedings of the 23rd ACM Symposium on Principles of Programming Languages (POPL), ACM Press, New York (1996)
Danvy, O.: Functional unparsing. Journal of Functional Programming 8(6) (1998)
Danvy, O.: A Simple Solution to Type Specialization. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998. LNCS, vol. 1443, Springer, Heidelberg (1998)
Findler, R.B., Blume, M.: Contracts as Pairs of Projections. In: Hagiya, M., Wadler, P. (eds.) FLOPS 2006. LNCS, vol. 3945, pp. 226–241. Springer, Heidelberg (2006)
Findler, R., Felleisen, M.: Contracts for higher-order functions. In: Proceedings of the International Conference on Functional Programming (ICFP) (2002)
Haines, N., Kindred, D., Morrisett, J.G., Nettles, S.M., Wing, J.M.: Composing first-class transactions. ACM Transactions on Programming Languages and Systems (TOPLAS) 16(6) (1994)
Henglein, F.: Dynamic typing. In: Krieg-Brückner, B. (ed.) ESOP 1992. LNCS, vol. 582, Springer, Heidelberg (1992)
Jeuring, J., Hinze, R., Löh, A.: Typed Contracts for Functional Programming. In: Hagiya, M., Wadler, P. (eds.) FLOPS 2006. LNCS, vol. 3945, pp. 208–225. Springer, Heidelberg (2006)
Kennedy, A.: Functional pearl: Pickler combinators. Journal of Functional Programming 14(6) (2004)
Matthews, J., Findler, R.B.: Operational semantics for multi-language programs. In: Proceedings of the 34th ACM Symposium on Principles of Programming Languages (POPL) (2007)
Meyer, B.: Eiffel: The Language. Prentice-Hall, Englewood Cliffs (1992)
Ramsey, N.: Embedding an interpreted language using higher-order functions and types. Journal of Functional Programming (to appear, 2008)
Rose, K.: Type-directed partial evaluation in Haskell. In: Preliminary Proceedings of the 1998 APPSEM Workshop on Normalization by Evaluation, number NS-98-1 in BRICS Notes (1998)
Scott, D.: Data types as lattices. SIAM Journal of Computing 4 (1976)
Stoy, J.E.: Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, Cambridge (1977)
Wadler, P., Findler, R.B.: Well-typed programs can’t be blamed. In: ACM Workshop on Scheme and Functional Programming (2007)
Yang, Z.: Encoding types in ML-like languages. In: Proceedings of the 3rd ACM SIGPLAN International Conference on Functional Programming (ICFP) (September 1998)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Benton, N. (2008). Undoing Dynamic Typing (Declarative Pearl). In: Garrigue, J., Hermenegildo, M.V. (eds) Functional and Logic Programming. FLOPS 2008. Lecture Notes in Computer Science, vol 4989. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-78969-7_17
Download citation
DOI: https://doi.org/10.1007/978-3-540-78969-7_17
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-78968-0
Online ISBN: 978-3-540-78969-7
eBook Packages: Computer ScienceComputer Science (R0)