skip to main content
10.1145/174675.176927acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free access

A type-theoretic approach to higher-order modules with sharing

Published: 01 February 1994 Publication History

Abstract

The design of a module system for constructing and maintaining large programs is a difficult task that raises a number of theoretical and practical issues. A fundamental issue is the management of the flow of information between program units at compile time via the notion of an interface. Experience has shown that fully opaque interfaces are awkward to use in practice since too much information is hidden, and that fully transparent interfaces lead to excessive interdependencies, creating problems for maintenance and separate compilation. The “sharing” specifications of Standard ML address this issue by allowing the programmer to specify equational relationships between types in separated modules, but are not expressive enough to allow the programmer complete control over the propagation of type information between modules.
These problems are addressed from a type-theoretic viewpoint by considering a calculus based on Girard's system Fω. The calculus differs form those considered in previous studies by relying exclusively on a new form of weak sum type to propagate information at compile-time, in contrast to approaches based on strong sums which rely on substitution. The new form of sum type allows for the specification of equational, as well as type and kind, information in interfaces. This provides complete control over the propagation of compile-time information between program units and is sufficient to encode in a straightforward way most users of type sharing specifications in Standard ML. Modules are treated as “first-class” citizens, and therefore the system supports higher-order modules and some object-oriented programming idioms; the language may be easily restricted to “second-class” modules found in ML-like languages.

References

[1]
Andrew W. Appet. Compiling with Continuations. Cambridge University Press, 1992.
[2]
Andrew W. Appel and David B. MacQueen. Standard ML of New Jersey. In J. Maluszynski and M. Wirsing, editors, Third lnt'l Syrup. on Prog. Lang. implementation and Logic Programming, pages 1-13, New York, August 1991. Springer-Verlag.
[3]
Edoardo Biagioni, Nicholas Haines, Robert Harper, Peter Lee, Brian G. Milnes, and Ehot B. Moss. ML signatures for a protocol stack. Fox Memorandum CMU-CS- 93-170, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, July 1993.
[4]
Hans-J/irgen B6hm, Alan Demers, and James Donahue. An informal description of Russell. Technical Report 80-430, Computer Science Department, Cornell University, Ithaca, New York, 1980.
[5]
Rod Burstall and Butler Lampson. A kernel language for abstract data types and modules. In Kahn et al. {22}, pages 1-50.
[6]
Luca Cardelli. A semantics of multiple inheritance. In Kahn et al. {22}, pages 51-67.
[7]
Luca Cardelli. Typeful programming. Technical Report 45, DEC SRC, 1989.
[8]
Luca Cardelli, James Donahue, Lucille Glassman, Mick Jordan, Bill Kalsow, and Greg Nelson. Modula-3 report (revised). Technical Report 52, DEC Systems Research Center, Palo Alto, CA, November 1989.
[9]
Luca Cardelli and Peter Wagner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 18(4), December 1986.
[10]
Luca Cardelli and Leroy Xavier. Abstract types and the dot notation. Technical Report 56, DEC SRC, Palo Alto, CA, March 1990.
[11]
Eric Cooper, Robert Harper, and Peter Lee. The Fox project: Advanced development of systems software. Technical Report CMU-CS-91-178, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, August 1991.
[12]
Nicolas G. de Bruijn. A survey of the project AU- TOMATH. In J. P. Seldin and J. R. Hindley, editors, To H. B. Curry: Essays in Combinatory Logic, Lambda Calculus and Formalism, pages 589-606. Academic Press, 1980.
[13]
Emden Gansner and John Reppy. eXene. In Robert Harper, editor, Third international Workshop on Standard ML, Pittsburgh, PA, September 1991. School of Computer Science, Carnegie Mellon University.
[14]
Jean-Yves Girard. interprgtation Fonctionnelle et Elimination des Coupures dans l'Arithmgtique d'Ordre Supdrieure. PhD thesis, Universitfi Paris VII, 1972.
[15]
Robert Harper. Introduction to Standard ML. Technical Report ECS-LFCS-86-14, Laboratory for the Foundations of Computer Science, Edinburgh University, September 1986.
[16]
Robert Harper and Mark Lillibridge. Explicit polymorphism and CPS conversion. In Twentieth ACM Symposium on Principles o} Programming Languages, pages 206-219, Charleston, SC, January 1993. ACM, ACM.
[17]
Robert Harper, David MacQueen, and Robin Milner. Standard ML. Technical Report ECS-LFCS-86-2, Laboratory for the Foundations of Computer Science, Edinburgh University, March 1986.
[18]
Robert Harper, David MacQueen, and Robin Milner. Standard ML. Technical Report ECS-LFCS-86-2, Laboratory for the Foundations of Computer Science, Edinburgh University, March 1986.
[19]
Robert Harper and John C. Mitchell. On the type structure of Standard ML. A CM Transactions on Programming Languages and Systems, 15(2):211-252, April 1993. (See also {331.).
[20]
Robert Harper, John C. Mitchell, and Eugenio Moggi. Higher-order modules and the phase distinction. In Seventeenth A CM Symposium on Principles of Programming Languages, San Francisco, CA, January 1990.
[21]
James G. Hook. Understanding russell: A first attempt. In Kahn et al. {22}, pages 69-85.
[22]
Gilles Kahn, David MacQueen, and Gordon Plotkin, editors. Semantics of Data Types, volume 173 of Lecture Notes in Computer Science. Springer-Verlag, June 1984.
[23]
Xavier Leroy. Manifest types, modules, and separate compilation. In Proceedings of the Twenty-first Annual ACM Symposium on Principles of Programming Languages, Portland. ACM, January 1994.
[24]
Barbara Liskov and John Guttag. Abstraction and Specification in Program Development. MIT Press, 1986.
[25]
Zhaolui Luo, Robert Pollack, and Paul Taylor. How to use Lego: A preliminary user's manual. Technical Report LFCS-TN-27, Laboratory for the Foundations of Computer Science, Edinburgh University, October 1989.
[26]
David MacQueen. Modules for Standard ML. In 1984 A CM Conference on LISP and Functional Programm~ng, pages 198-207, 1984. Revised version appears in {18}.
[27]
David MacQueen. Using dependent types to express modular structure. In Thirteenth A CM Symposium on Principles of Programming Languages, 1986.
[28]
David B. MacQueen. An implementation of Standard ML modules. In Proceedings of the 1988 A CM Conference on LISP and Functional Programming, Snowbird, Utah, pages 212-223. ACM Press, July 1988.
[29]
Per Martin-LSf. Constructive mathematics and computer programming, in Sixth International Congress for Logic, Methodology, and Philosophy of Science, pages 153-175. North-Holland, 1982.
[30]
David C. J. Matthews. POLY report. Technical Report 28, Computer Laboratory, University of Cambridge, 1982.
[31]
Robin Milner and Muds Torte. Commentary on Standard ML. MIT Press, 1991.
[32]
Robin Milner, Mads Torte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990.
[33]
John Mitchell and Robert Harper. The essence of ML. In Fifteenth A CM Symposium on Principles of Programmzng Languages, San Diego, California, January 1988.
[34]
John Mitchell, Sigurd Meldal, and Neel Madhav. An extension of Standard ML modules with subtyping and inheritance. In Eighteenth A CM Symposzum on Principles of Programming Languages, January 1991.
[35]
John C. Mitchell and Gordon Plotkln. Abstract type8 have existential type. A CM Transactions on Programming Languages and Systems, 10(3):470-502, 1988.
[36]
Greg Nelson, editor. Systems Programming with Modula-3. Prentice-Hall, Englewood Cliffs, NJ, 1991.
[37]
Benjamin Pierce. Bounded quantification is undecidable. In Proceedzngs of the Nzneteenth Annual A CM Symposium on Principles of Programming Languages, Albuquerque. ACM, January 1992.
[38]
Benjamin C. Pierce. Programming with Intersection Types and Bounded Polymorphism. PhD thesis, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, December 1991.
[39]
Chris Reade. Elements of Functional Programming. International Computer Science Series. Addison Wesley, 1989.
[40]
Nick Rothwell. Functional compilation from the Standard ML core language to lambda calculus. Technical Report ECS-LFCS-92-235, Laboratory for the Foundations of Computer Science, Edinburgh University, Edinburgh, Scotland, September 1992.
[41]
Nick Rothwell. Miscellaneous design issues in the ML kit. Technical Report ECS-LFCS-92-237, Laborator) for the Foundations of Computer Science, Edinburg~ University, Edinburgh, Scotland, September 1992.
[42]
Zhong Shao and Andrew Appel. Smartest recompilation. In Twentieth A CM Symposium on Principles of Programming Languages, pages 439-450, Charleston, SC, January 1993.
[43]
Mads Torte. Principal signatures for higher-order program modules. In Nineteenth A CM Symposium on Principles of Programming Languages, pages 189-199, January 1992.
[44]
Mads ToRe. Type abbreviations in signatures. Unpublished manuscript, August 1993.
[45]
Diedrik T. van Daalen. The Language Theory of A U- TOMATH. PhD thesis, Technical University of Eindhoven, Eindhoven, Netherlands, 1980.
[46]
Niklaus Wirth. Programming in Modula-2. Texts and Monographs in Computer Science. Springer-Verlag, 1983.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '94: Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
February 1994
492 pages
ISBN:0897916360
DOI:10.1145/174675
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 February 1994

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

POPL94

Acceptance Rates

POPL '94 Paper Acceptance Rate 39 of 173 submissions, 23%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)124
  • Downloads (Last 6 weeks)18
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media