ACM Home Page
Please provide us with feedback. Feedback
Dynamic typing in a statically typed language
Full text PdfPdf (2.04 MB)
Source ACM Transactions on Programming Languages and Systems (TOPLAS) archive
Volume 13 ,  Issue 2  (April 1991) table of contents
Pages: 237 - 268  
Year of Publication: 1991
ISSN:0164-0925
Authors
Martín Abadi  Digital Equipment Corp.
Luca Cardelli  Digital Equipment Corp.
Benjamin Pierce  Carnegie-Mellon Univ., Pittsburgh, PA
Gordon Plotkin  Univ. of Edinburgh, Edinburgh, Scotland, UK
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 21,   Downloads (12 Months): 104,   Citation Count: 49
Additional Information:

abstract   references   cited by   index terms   review   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/103135.103138
What is a DOI?

ABSTRACT

Statically typed programming languages allow earlier error checking, better enforcement of diciplined programming styles, and the generation of more efficient object code than languages where all type consistency checks are performed at run time. However, even in statically typed languages, there is often the need to deal with data whose type cannot be determined at compile time. To handle such situations safely, we propose to add a type Dynamic whose values are pairs of a value v and a type tag T where v has the type denoted by T. Instances of Dynamic are built with an explicit tagging construct and inspected with a type safe typecase construct. This paper explores the syntax, operational semantics, and denotational semantics of a simple language that includes the type Dynamic. We give examples of how dynamically typed values can be used in programming. Then we discuss an operational semantics for our language and obtain a soundness theorem. We present two formulations of the denotational semantics of this language and relate them to the operational semantics. Finally, we consider the implications of polymorphism and some implementation issues.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
 
2
ATKINSON, M. P., AND MORRISON, R. Polymorphic names and iterations. Draft article, Sept. 1987.
 
3
BARENDREGT, H.P. The Lambda Calculus. Rev. ed. North-Holland, Amsterdam, 1984.
4
 
5
BmTWISTLE, G. M., DAHL, 0. J., MYHRHAUG, B., AND NYGAARD, K. S~mula Begin. Studentlitteratur, Lund, Sweden, 1979.
6
 
7
 
8
CARDELLI, L., AND MACQUEEN, D. Persistence and type abstraction. In Proceedings of the Persistence and Datatypes Workshop (St. Andrews, Scotland, Aug. 1985). Dept. of Computational Science, Univ. of St. Andrews, 1985 (Persistent Program. Res. Rep. 16).
9
10
 
11
CARDELLI, L., DONAHUE, J., GLASSMAN, L., JORDAN, M., KALSOW, B., AND NELSON, G. Modula-3 report (revised). Res. rep. 52, DEC Systems Research Center, Palo Alto, Calif., Nov. 1989.
 
12
CHURCH, A. A formulation ofthe simple theory of types. J Symbohc Logic 5 (1940), 56-68.
 
13
CL~MENT, D., DESPEYROUX, J., DESPEYROUX, T., HASCOET, L., AND KAHN, G. Natural semantics on the computer. Tech. Rep. RR 416, INRIA, Sophia-Antipolis June 1985.
 
14
DESPEYROUX, T. Typoh A formalism to implement natural semanties. Teeh. Rep. 94, INRIA, Mar. 1988.
 
15
HARPER, R. Introduction fo Standard ML. Teeh. Rep. ECS-LFCS-86-14, Lab. for the Foundations of Computer Science, Edinburgh Univ., Edinburgh, Scotland, Sept. 1986.
 
16
 
17
 
18
LAMPSON, B.. A description of the Cedar language. Tech. Rep. CSL-8345, Xerox Pale Alto Research Center, Palo Alto, Calif., 1983.
 
19
 
20
 
21
MARTIN-L"F, P. Intitutionistic Type Theory. Bibliopolis, Naples, 1984.
 
22
McDONALD, D. B., FAHLMAN, S. E., AND WHOLEY, S. Internal design of CMU Common Lisp un the IBM RT PC. Tech. Rep. CMU-CS-87-157, Carnegie-Mellon Univ., School of Computer Science, Pittsburgh, Pa., Apr. 1988.
 
23
MILNER, R. A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17 (Aug. 1978), 348-375.
 
24
25
 
26
MYCROFT, A. Dynamic types in ML. Draft article, 1983.
27
 
28
PLOTKIN, G. Call-by-name, call-by-value, and the X-calculus. Theor. Comput. Sci. I (1975), 125-159.
 
29
PLOTKIN, G.D. A structural approach to operational semantics. Tech. Rep. DAIMI FN-19, Computer Science Dept., Aarhus Univ., Aarhus, Denmark, 1981.
 
30
 
31
ROVNER, P. On extending Modula-2 to build large, integrated systems IEEE Softw. 3, 6 (Nov. 1986), 46-57.
 
32
SCHAFFERT, J. C. A formal definition of CLU. Master's thesls, MIT, Dept. of Computer Science, Cambridge, Mass., Jan. 1978 (Tech. Rep. MIT/LCS/TR-193).
 
33
34
 
35
TOFTE, M. Operational semantics and polymorphic type inference. Ph.D. thesis, Computer Science Dept., Edinburgh Univ., Edinburgh, Scotland, 1988 (Tech. Rep. CST-52-88).
 
36
WEm, P., APO~TE, M.-V., LAWLLE, A., MAUXY, M., A~D SU~REZ, A. The CAML reference manual, Version 2.6. Tech. Rep., Projet Formel, INRIA-ENS, Paris, 1989.

CITED BY  49


REVIEW

"Ramaswamy Ramanujam : Reviewer"

Checking type correctness of operations often becomes necessary at runtime: consider, for example, the read operation. In this paper, the authors propose the use of a data type called Dynamic. Values of this type are pai  more...

Collaborative Colleagues:
Martín Abadi: colleagues
Luca Cardelli: colleagues
Benjamin Pierce: colleagues
Gordon Plotkin: colleagues