A calculus of module systems

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.

[1]  Uday S. Reddy,et al.  Objects as closures: abstract semantics of object-oriented languages , 1988, LISP and Functional Programming.

[2]  Sophia Drossopoulou,et al.  A fragment calculus-towards a model of separate compilation, linking and binary compatibility , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[3]  Davide Ancona,et al.  True Modules for Java-like Languages , 2001, ECOOP.

[4]  Claudio V. Russo Types for Modules , 2004, Electronic Notes in Theoretical Computer Science.

[5]  William R. Cook,et al.  Mixin-based inheritance , 1990, OOPSLA/ECOOP '90.

[6]  Tom Mens,et al.  Encapsulation and composition as orthogonal operators on mixins: a solution to multiple inheritance problems , 1996, Object Oriented Syst..

[7]  Matthias Felleisen,et al.  Classes and mixins , 1998, POPL '98.

[8]  Davide Ancona,et al.  Jam - A Smooth Extension of Java with Mixins , 2000, ECOOP.

[9]  Karl Crary,et al.  What is a recursive module? , 1999, PLDI '99.

[10]  Davide Ancona,et al.  A Primitive Calculus for Module Systems , 1999, PPDP.

[11]  Luca Cardelli,et al.  Program fragments, linking, and modularization , 1997, POPL '97.

[12]  Davide Ancona,et al.  Overriding Operators in a Mixin-Based Framework , 1997, PLILP.

[13]  Matthias Felleisen,et al.  Units: cool modules for HOT languages , 1998, PLDI.

[14]  Dominic Duggan,et al.  Mixin modules , 1996, ICFP '96.

[15]  John C. Mitchell,et al.  Higher-order modules and the phase distinction , 1989, POPL '90.

[16]  Gilad Bracha,et al.  The programming language jigsaw: mixins, modularity and multiple inheritance , 1992 .

[17]  Davide Ancona An Algebraic Framework for Separate Type-Checking , 1998, WADT.

[18]  V. van Oostrom,et al.  Confluence for Abstract and Higher-Order Rewriting , 1994 .

[19]  Joe B. Wells,et al.  Equational Reasoning for Linking with First-Class Primitive Modules , 2000, ESOP.

[20]  Robert Bruce Findler,et al.  Modular object-oriented programming with units and mixins , 1998, ICFP '98.

[21]  Davide Ancona,et al.  A theory of mixin modules: basic and derived operators , 1998, Mathematical Structures in Computer Science.

[22]  Gilad Bracha,et al.  Modularity meets inheritance , 1992, Proceedings of the 1992 International Conference on Computer Languages.

[23]  Xavier Leroy,et al.  A modular module system , 2000, J. Funct. Program..

[24]  Mark Lillibridge,et al.  A type-theoretic approach to higher-order modules with sharing , 1994, POPL '94.

[25]  Zena M. Ariola,et al.  Lambda Calculus with Explicit Recursion , 1997, Inf. Comput..

[26]  Robin Milner,et al.  Definition of standard ML , 1990 .

[27]  Gary Lindstrom,et al.  An Application Framework For Module Composition Tools , 1996, ECOOP.

[28]  BrachaGilad,et al.  Mixin-based inheritance , 1990 .

[29]  William R. Cook,et al.  A denotational semantics of inheritance , 1989 .

[30]  Jean-Jacques Lévy,et al.  Confluence properties of weak and strong calculi of explicit substitutions , 1996, JACM.

[31]  Vincent van Oostrom,et al.  Combinatory Reduction Systems: Introduction and Survey , 1993, Theor. Comput. Sci..

[32]  Elena Machkasova,et al.  A Calculus for Link-Time Compilation , 2000, ESOP.

[33]  J. Gregory Morrisett,et al.  Type-safe linking and modular assembly language , 1999, POPL '99.

[34]  Martín Abadi,et al.  A Theory of Objects , 1996, Monographs in Computer Science.

[35]  Xavier Leroy,et al.  Manifest types, modules, and separate compilation , 1994, POPL '94.

[36]  Vitaly Shmatikov,et al.  A Core Calculus of Classes and Mixins , 1999, ECOOP.

[37]  Davide Ancona,et al.  An algebra of mixin modules , 1997, WADT.

[38]  Davide Ancona,et al.  MIX(FL): A Kernel Language of Mixin Modules , 2000, AMAST.