skip to main content
article

A calculus of module systems

Published: 01 March 2002 Publication History

Abstract

We present CMS, a simple and powerful calculus of modules supporting mutual recursion and higher order features, which can be instantiated over an arbitrary core calculus satisfying standard assumptions. The calculus allows expression of a large variety of existing mechanisms for combining software components, including parameterized modules similar to ML functors, extension with overriding as in object-oriented programming, mixin modules and extra-linguistic mechanisms like those provided by a linker. Hence CMS can be used as a paradigmatic calculus for modular languages, in the same spirit the lambda calculus is used for functional programming. We first present an untyped version of the calculus and then a type system; we prove confluence, progress, and subject reduction properties. Then, we define a derived calculus of mixin modules directly in terms of CMS and show how to encode other primitive calculi into CMS (the lambda calculus and the Abadi-Cardelli object calculus). Finally, we consider the problem of introducing a subtype relation for module types.

References

[1]
Abadi, M. and Cardelli, L. (1996) A Theory of Objects. Monographs in Computer Science. Springer.
[2]
Ancona, D. (1998) Modular formal frameworks for module systems. PhD thesis, Dipartimento di Informatica, Università di Pisa.
[3]
Ancona, D. (1999) An algebraic framework for separate type-checking. In: Fiadeiro, J. (editor), WADT'98 (13th Workshop on Algebraic Development Techniques): Lecture Notes in Computer Science 1589, pp. 1-15. Springer-Verlag.
[4]
Ancona, D. (2000) MIX(FL): a kernel language of mixin modules. In: Rus, T. (editor), AMAST 2000 - International Conference on Algebraic Methodology and Software Technology: Lecture Notes in Computer Science 1816. Springer-Verlag.
[5]
Ancona, D. and Zucca, E. (1997) Overriding operators in a mixin-based framework. In: Glaser, H., Hartel, P. and Kuchen, H. (editors), PLILP '97 - 9th Intl. Symp. on Programming Languages, Implementations, Logics and Programs: Lecture Notes in Computer Science 1292, pp. 47-61. Springer-Verlag.
[6]
Ancona, D. and Zucca, E. (1998a) An algebra of mixin modules. In: Presicce, F. P. (editor), Recent Trends in Algebraic Development Techniques (12th Intl. Workshop, WADT'97 - Selected Papers): Lecture Notes in Computer Science 1376, pp. 92-106. Springer-Verlag.
[7]
Ancona, D. and Zucca, E. (1998b) A theory of mixin modules: Basic and derived operators. Mathematical Structures in Computer Science, 8(4), 401-446.
[8]
Ancona, D. and Zucca, E. (1999) A primitive calculus for module systems. In: Nadathur, G. (editor), PPDP'99 - Principles and Practice of Declarative Programming: Lecture Notes in Computer Science 1702, pp. 62-79. Springer-Verlag.
[9]
Ancona, D. and Zucca, E. (2001) True modules for Java classes. In: Knudsen, J. L. (editor), ECOOP 2001 - Object-Oriented Programming: Lecture Notes in Computer Science 2072, pp. 354-380. Springer-Verlag.
[10]
Ancona, D., Lagorio, G. and Zucca, E. (2000) Jam: A smooth extension of Java with mixins. In: Bertino, E. (editor), ECOOP'00 - Object-Oriented Programming: Lecture Notes in Computer Science 1850, pp. 154-178. Springer-Verlag.
[11]
Ariola, Z. M. and Klop, J. W. (1997) Lambda calculus with explicit recursion. Information & Computation, 139(2), 154-233.
[12]
Banavar, G. (1995) An application framework for compositional modularity. PhD thesis, Department of Computer Science, University of Utah.
[13]
Banavar, G. and Lindstrom, G. (1996) An application framework for module composition tools. ECOOP '96 - Object-Oriented Programming: Lecture Notes in Computer Science 1098, pp. 91-113. Springer-Verlag.
[14]
Bono, V., Patel, A. and Shmatikov, V. (1999) A core calculus of classes and mixins. In: Guerraoui, R. (editor), ECOOP '99 - Object-Oriented Programming: Lecture Notes in Computer Science 1628, pp. 43-66. Springer-Verlag.
[15]
Bracha, G. (1992) The programming language JIGSAW: Mixins, modularity and multiple inheritance . PhD thesis, Department of Computer Science, University of Utah.
[16]
Bracha, G. and Cook, W. (1990) Mixin-based inheritance. ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1990, pp. 303-311. ACM Press. (SIGPLAN Notices, 25(10).).
[17]
Bracha, G. and Griswold, D. (1996) Extending Smalltalk with mixins. OOP- SLA96 Workshop on Extending the Smalltalk Language. (Electronic note available at http://www.javasoft.com/people/gbracha/mwp.html.)
[18]
Bracha, G. and Lindstrom, G. (1992) Modularity meets inheritance. Proc. International Conference on Computer Languages, pp. 282-290. IEEE Computer Society.
[19]
Cardelli, L. (1997) Program fragments, linking, and modularization. ACM Symp. on Principles of Programming Languages 1997, pp. 266-277. ACM Press.
[20]
Cook, W. (1989) A denotational semantics of inheritance. PhD thesis, Department of Computer Science, Brown University.
[21]
Crary, K., Harper, R. and Puri, S. (1999) What is a recursive module? PLDI'99 - ACM Conf. on Programming Language Design and Implementation.
[22]
Curien, P.-L., Hardin, T. and Levy, J.-J. (1996) Weak and strong confluent calculi of explicit substitutions. J. ACM, 43(2).
[23]
Drossopoulou, S. & Eisenbach, S. and Wragg, D. (1999) A fragment calculus - towards a model of separate compilation, linking and binary compatibility. Proc. 14th Ann. IEEE Symp. on Logic in Computer Science.
[24]
Duggan, D. and Sourelis, C. (1996) Mixin modules. Intl. Conf. on Functional Programming, pp. 262-273. ACM Press.
[25]
Duggan, D. and Sourelis, C. (1998) Parameterized modules, recursive modules, and mixin modules. 1998 ACM SIGPLAN Workshop on ML, pp. 87-96. ACM Press.
[26]
Findler, R. B. and Flatt, M. (1998) Modular object-oriented programming with units and mixins. Intl. Conf. on Functional Programming 1998.
[27]
Flatt, M. and Felleisen, M. (1998) Units: Cool modules for HOT languages. PLDI'98 - ACM Conf. on Programming Language Design and Implementation, pp. 236-248.
[28]
Flatt, M., Krishnamurthi, S. and Felleisen, M. (1998) Classes and mixins. ACM Symp. on Principles of Programming Languages 1998, pp. 171-183. ACM Press.
[29]
Glew, N. and Morrisett, J. G. (1999) Type-safe linking and modular assembly language. ACM Symp. on Principles of Programming Languages 1999, pp. 250-261. ACM Press.
[30]
Harper, R. and Lillibridge, M. (1994) A type theoretic approach to higher-order modules with sharing. ACM Symp. on Principles of Programming Languages 1994, pp. 127-137. ACM Press.
[31]
Harper, R., Lillibridge, M. and Moggi, E. (1990) Higher-order modules and the phase distintion. ACM Symp. on Principles of Programming Languages 1990, pp. 341-354. ACM Press.
[32]
Hirschowitz, T. (2000) Modules mixins : typage et compilation. Rapport du DEA Programmation: Sémantique, Preuves et Langages. INRIA Rocquencourt. http:// cristal.inria.fr/hirschow/.
[33]
Klop, J. W. (1987) Term rewriting systems: a tutorial. Bull. EATCS, 32, 143-182.
[34]
Klop, J. W., van Oostrom, V. and van Raamsdonk, F. (1993) Combinatory reduction systems: introduction and survey. Technical report CS-R9362, CWI.
[35]
Leroy, X. (1994) Manifest types, modules and separate compilation. ACM Symp. on Principles of Programming Languages 1994, pp. 109-122. ACM Press.
[36]
Leroy, X. (2000) A modular module system. J. Functional Programming, 10(3), 269-303.
[37]
Limberghen, M. Van and Mens, T. (1996) Encapsulation and composition as orthogonal operators on mixins: A solution to multiple inheritance problems. Object Oriented Systems, 3(1), 1-30.
[38]
Machkasova, E. and Turbak, F. A. (2000) A calculus for link-time compilation. European Symposium on Programming 2000: Lecture Notes in Computer Science 1782, pp. 260-274. Springer-Verlag.
[39]
Milner, R., Tofte, M. and Harper, R. (1990) The Definition of Standard ML. The MIT Press.
[40]
Reddy, U. S. (1988) Objects as closures: Abstract semantics of object-oriented languages. Proc. acm Conf. on Lisp and Functional Programming, pp. 289-297.
[41]
Riecke, J. G. and Stone, C. A. (1999) Privacy via subsumption. Theory and Practice of Object Systems. (To appear.).
[42]
Russo, C. V. (1998) Types for modules. PhD thesis, Department of Computer Science, University of Edinburgh.
[43]
van Oostrom, V. (1994) Confluence for abstract and higher-order rewriting. PhD thesis, VU, Amsterdam.
[44]
Wells, J. B. and Vestergaard, R. (2000) Confluent equational reasoning for linking with first-class primitive modules. European Symposium on Programming 2000: Lecture Notes in Computer Science 1782, pp. 412-428. Springer.

Cited By

View all
  1. A calculus of module systems

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Journal of Functional Programming
    Journal of Functional Programming  Volume 12, Issue 2
    March 2002
    92 pages

    Publisher

    Cambridge University Press

    United States

    Publication History

    Published: 01 March 2002

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)0
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 25 Dec 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)Making a Type Difference: Subtraction on Intersection Types as Generalized Record OperationsProceedings of the ACM on Programming Languages10.1145/35712247:POPL(893-920)Online publication date: 11-Jan-2023
    • (2022)Incremental type-checking for free: using scope graphs to derive incremental type-checkersProceedings of the ACM on Programming Languages10.1145/35633036:OOPSLA2(424-448)Online publication date: 31-Oct-2022
    • (2021)Compositional ProgrammingACM Transactions on Programming Languages and Systems10.1145/346022843:3(1-61)Online publication date: 3-Sep-2021
    • (2016)Classless JavaACM SIGPLAN Notices10.1145/3093335.299323852:3(14-24)Online publication date: 20-Oct-2016
    • (2016)Classless JavaProceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/2993236.2993238(14-24)Online publication date: 20-Oct-2016
    • (2016)Incremental Rebinding with Name PolymorphismElectronic Notes in Theoretical Computer Science (ENTCS)10.1016/j.entcs.2016.03.003322:C(19-34)Online publication date: 18-Apr-2016
    • (2016)Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesundefinedOnline publication date: 20-Oct-2016
    • (2015)IsoLATEProceedings of the 24th European Symposium on Programming on Programming Languages and Systems - Volume 903210.1007/978-3-662-46669-8_11(257-282)Online publication date: 11-Apr-2015
    • (2014)BackpackACM SIGPLAN Notices10.1145/2578855.253588449:1(19-31)Online publication date: 8-Jan-2014
    • (2014)BackpackProceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages10.1145/2535838.2535884(19-31)Online publication date: 11-Jan-2014
    • Show More Cited By

    View Options

    View options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media