What is a recursive module?

A hierarchical module system is an effective tool for structuring large programs. Strictly hierarchical module systems impose an acyclic ordering on import dependencies among program units. This can impede modular programming by forcing mutually-dependent components to be consolidated into a single module. Recently there have been several proposals for module systems that admit cyclic dependencies, but it is not clear how these proposals relate to one another, nor how one might integrate them into an expressive module system such as that of ML.To address this question we provide a type-theoretic analysis of the notion of a recursive module in the context of a "phase-distinction" formalism for higher-order module systems. We extend this calculus with a recursive module mechanism and a new form of signature, called a recursively dependent signature, to support the definition of recursive modules. These extensions are justified by an interpretation in terms of more primitive language constructs. This interpretation may also serve as a guide for implementation.

[1]  ScienceYale UniversityNew Haven An Overview of the Flint/ml Compiler , 1997 .

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

[3]  Mads Tofte,et al.  A Type-Theoretic Interpretation of Standard ML , 2000 .

[4]  John C. Mitchell,et al.  On the type structure of standard ML , 1993, TOPL.

[5]  Géraud Sénizergues,et al.  The Equivalence Problem for Deterministic Pushdown Automata is Decidable , 1997, ICALP.

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

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

[8]  Marvin H. Solomon,et al.  Type definitions with parameters , 1978, POPL.

[9]  Luca Cardelli,et al.  Subtyping recursive types , 1993 .

[10]  Brian N. Bershad,et al.  Safe Dynamic Linking in an Extensible Operating System , 1999 .

[11]  Robert Harper,et al.  TIL: a type-directed optimizing compiler for ML , 1996, PLDI '96.

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

[13]  David B. MacQueen Modules for standard ML , 1984, LFP '84.

[14]  Robert Harper,et al.  Transparent and Opaque Interpretations of Datatypes , 1998 .

[15]  Zhong Shao Typed cross-module compilation , 1998, ICFP '98.

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

[17]  Robert Harper,et al.  A type-theoretic interpretation of standard ML , 2000, Proof, Language, and Interaction.

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

[19]  Luca Cardelli,et al.  Subtyping recursive types , 1991, POPL '91.

[20]  Luca Cardelli,et al.  Phase Distinctions in Type Theory , 1988 .

[21]  John C. Mitchell,et al.  The essence of ML , 1988, POPL '88.

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

[23]  Matthias Blume,et al.  Hierarchical modulatory and intermodule optimization , 1998 .