Mixin Modules and Computational Effects

We define a calculus for investigating the interactions between mixin modules and computational effects, by combining the purely functional mixin calculus CMS with a monadic metalanguage supporting the two separate notions of simplification (local rewrite rules) and computation (global evaluation able to modify the store). This distinction is important for smoothly integrating the CMS rules (which are all local) with the rules dealing with the imperative features. In our calculus mixins can contain mutually recursive computational components which are explicitly computed by means of a new mixin operator whose semantics is defined in terms of a Haskell-like recursive monadic binding. Since we mainly focus on the operational aspects, we adopt a simple type system like that for Haskell, that does not detect dynamic errors related to bad recursive declarations involving effects. The calculus serves as a formal basis for defining the semantics of imperative programming languages supporting first class mixins while preserving the CMS equational reasoning.

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

[2]  Sonia Fagorzi,et al.  A Monadic Multi-stage Metalanguage , 2003, FoSSaCS.

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

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

[5]  Andreas V. Hense Denotational semantics of an object-oriented programming language with explicit wrappers , 1993, Formal Aspects of Computing.

[6]  Andrew Moran,et al.  Semantics of value recursion for Monadic Input/Output , 2002, RAIRO Theor. Informatics Appl..

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

[8]  Andrew Moran,et al.  Semantics of fixIO , 2001 .

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

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

[11]  Tom Hirschowitz,et al.  Mixin modules in a call-by-value setting , 2002, TOPL.

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

[13]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

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

[15]  Davide Ancona,et al.  A calculus of module systems , 2002, J. Funct. Program..

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

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

[18]  Gérard Boudol The Recursive Record Semantics of Objects Revisited , 2001, ESOP.

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

[20]  John Launchbury,et al.  A recursive do for Haskell , 2002, Haskell '02.

[21]  John Launchbury,et al.  Recursive monadic bindings , 2000, ICFP '00.

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