Hostname: page-component-78c5997874-4rdpn Total loading time: 0 Render date: 2024-11-04T18:12:51.076Z Has data issue: false hasContentIssue false

Typing first-class continuations in ML

Published online by Cambridge University Press:  07 November 2008

Robert Harper
Affiliation:
School of Computer Science, Carnegie Mellon University, 5000 Forbes Avenue, Pittsburgh, PA 15213, USA
Bruce F. Duba
Affiliation:
Department of Computer Science, Rice University, Houston, TX 77251, USA
David Macqueen
Affiliation:
AT&T Bell Laboratories, Murray Hill, NJ 07974, USA
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

An extension of ML with continuation primitives similar to those found in Scheme is considered. A number of alternative type systems are discussed, and several programming examples are given. A continuation-based operational semantics is defined for a small, purely functional language, and the soundness of the Damas–Milner polymorphic type assignment system with respect to this semantics is proved. The full Damas–Milner type system is shown to be unsound in the presence of first-class continuations. Restrictions on polymorphism similar to those introduced in connection with reference types are shown to suffice for soundness.

Type
Articles
Copyright
Copyright © Cambridge University Press 1993

References

Appel, A. W. and MacQueen, D. B. (1991) Standard ML of New Jersey. In J., Maluszynski and M., Wirsing, editors, Third International Symposium on Programming Language Implementation and Logic Programming, pp. 113, 08. Springer-Verlag.Google Scholar
Clinger, W., Friedman, D. P. and Wand, M. (1985) A scheme for higher-level semantic algebra. In Nivat, M. and Reynolds, J. C., editors, Algebraic Methods in Semantics, pp. 237250. Cambridge University Press.Google Scholar
Cooper, E. C. and Morrisett, J. G. (1990) Adding threads to Standard ML. Technical Report CMU-CS-90-186, School of Computer Science, Carnegie Mellon University.Google Scholar
Damas, L. and Milner, R. (1982) Principal type schemes for functional programs. In Ninth ACM Symposium on Principles of Programming Languages, pp. 207212.Google Scholar
Duba, B., Harper, R. and MacQueen, D. (1991) Typing first-class continuations in ML. In Eighteenth ACM Symposium on Principles of Programming Languages, January.CrossRefGoogle Scholar
Dybvig, R. K. and Hieb, B. (1989) Engines from continuations. Journal of Computer Languages, 14(2): 109124.CrossRefGoogle Scholar
Evans, A. (1968) PAL – a language designed for teaching programming linguistics. In Proc. ACM 23rd National Conference, pp. 395403, Princeton.ACM, Brandin Systems Press.CrossRefGoogle Scholar
Felleisen, M. (1985) Transliterating Prolog into Scheme. Technical Report 182, Indiana University Computer Science Department.Google Scholar
Felleisen, M. (1988) The theory and practice of first-class prompts. In Fifteenth ACM Symposium on Principles of Programming Languages, pp. 180190, San Diego, CA.ACM.CrossRefGoogle Scholar
Felleisen, M. and Friedman, D. (1986) Control operators, the SECD machine, and the λ-calculus. In Formal Description of Programming Concepts III. North-Holland, Amsterdam.Google Scholar
Felleisen, M., Friedman, D., Kohlbecker, E. and Duba, B. (1986) Reasoning with continuations. In First Symposium on Logic in Computer Science. IEEE, 06.Google Scholar
Felleisen, M., Friedman, D., Kohlbecker, E. and Duba, B. (1987) A syntactic theory of sequential control. Theoretical Computer Science, 52 (3): 205237.CrossRefGoogle Scholar
Filinski, A. (1989) Declarative continuations: An investigation of duality in programming language semantics in Summer Conference on Category Theory and Computer Science,Manchester, UK, volume 389 of Lecture Notes in Computer Science. Springer-Verlag.Google Scholar
Filinski, A. (1989) Declarative continuations and categorical duality. Master's thesis. University of Copenhagen, Denmark, 08. (DIKU Report 89/11.)Google Scholar
Friedman, D. P., Haynes, C. T. and Kohlbecker, E. (1985) Programming with continuations. In Pepper, P., editor, Program Transformations and Programming Environments, pages 263274. Springer-Verlag.Google Scholar
Griffin, T. (1990) A formulae-as-types notion of control. In Seventeenth ACM Symposium on Principles of Programming Languages, San Francisco, CA, 01. ACM.Google Scholar
Griffin, G. T. (1992) Logical interpretations and computational simulations. Technical memoranda, AT&T Bell Laboratories, in preparation.Google Scholar
Harper, R. and Lillibridge, M. (1992) Polymorphic type assignment and CPS conversion. In Danvy, O. and Talcott, C., editors, Proceedings of the ACM SIGPLAN Work-shop on Continuations CW92, pp. 1322, Stanford, CA 94305, 06. Department of Computer Science, Stanford University. Published as technical report STAN-CS-92-1426.Google Scholar
Haynes, C. T. (1987) Logic continuations. Journal of Logic Programming, 4: 157176.CrossRefGoogle Scholar
Haynes, C. T. and Friedman, D. P. (1987) Abstracting timed preemption with engines. Journal of Computer Languages, 12: 109121.CrossRefGoogle Scholar
Haynes, C. T. and Friedman, D. P. (1987) Embedding continuations in procedural objects. ACM Transactions on Programming Languages and Systems, 9: 582598.CrossRefGoogle Scholar
Haynes, C. T., Friedman, D. P. and Wand, M. (1986) Obtaining coroutines from continuations. Journal of Computer Languages, 11: 143153.CrossRefGoogle Scholar
Landin, P. J. (1965) A correspondence between ALGOL-60 and Church's lambda notation. Communications of the ACM, 8: 89101.CrossRefGoogle Scholar
Meyer, A. R. and Wand, M. (1985) Continuation semantics in typed lambda calculi (summary). In Parikh, R., editor, Logics of Programs, volume 224 of Lecture Notes in Computer Science, pp. 219224. Springer-Verlag.Google Scholar
Milner, R., Tofte, M. and Harper, R. (1990) The Definition of Standard ML. MIT Press.Google Scholar
Plotkin, G. (1980) Lambda-definability in the full type hierarchy. In Seldin, J. P. and Hindley, J. R., editors, To H. B. Curry: Essays in Combinatory Logic, Lambda Calculus and Formalism, pp. 363373. Academic Press.Google Scholar
Ramsey, N. (1990) Concurrent programming in ML. Technical Report CS-TR-262-90, Computer Science Department, Princeton University.Google Scholar
Reppy, J. (1989) First-class synchronous operations in standard ML. Technical Report TR 89–1068, Computer Science Department, Cornell University, Ithaca, NY, December.Google Scholar
Reppy, J. (1990) Asynchronous signals in Standard ML (unpublished manuscript), 08.Google Scholar
Reynolds, J. C. (1970) GEDANKEN–a simple typeless language based on the principle of completeness and the reference concept. Communications of the ACM, 13 (5): 308319, 05.CrossRefGoogle Scholar
Reynolds, J. C. (1972) Definitional interpreters for higher-order programming languages. In Conference Record of the 25th National ACM Conference, pp. 717740, Boston, 08. ACM.Google Scholar
Sitaram, D. and Felleisen, M. (1990) Reasoning with continuations. II. Full abstraction for models of control. In Proc. 1990 Conference on LISP and Functional Programming. pp. 161175, 06.Google Scholar
Statman, R. (1985) Logical relations and the typed λ-calculus. Information and Control, 65: 8597.CrossRefGoogle Scholar
Strachey, C. and Wadsworth, C. (1974) A Mathematical Semantics for Handling Full Jumps. Technical Report Technical Monograph PRG-11, Oxford University Computing Laboratory.Google Scholar
Sufrin, B. (1979) CSP-style processes in ML (private communication).Google Scholar
Sussman, G. J. and Steele, G. L. Jr. (1975) Scheme: An Interpreter for Extended Lambda Calculus. Technical Report Memo no. 349, MIT AI Laboratory, 12.Google Scholar
Talcott, C. (1988) Rum: An intensional theory of function and control abstractions. In Proc. 1987 Workshop of Foundations of Logic and Functional Programming, volume 306 of Lecture Notes in Computer Science. Springer-Verlag.Google Scholar
Tofte, M. (1988) Operational Semantics and Polymorphic Type Inference. PhD thesis, Edinburgh University, 1988. Available as Edinburgh University Laboratory for Foundations of Computer Science Technical Report ECS-LFCS-88-54.Google Scholar
Tofte, M. (1990) Type inference for polymorphic references. Information and Computation, 89: 134, 11.CrossRefGoogle Scholar
Wand, M. (1980) Continuation-based multiprocessing. In Conference Record of the 1980 LISP Conference, pp. 1928.CrossRefGoogle Scholar
Wright, A. and Felleisen, M. (1990) The nature of exceptions in polymorphic languages. Unpublished manuscript, Rice University.Google Scholar
Wright, A. K. and Felleisen, M. (1991) A Syntactic Approach to Type Soundness. Technical Report TR91-160, Department of Computer Science, Rice University. To appear in Information and Computation.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.