Abstract
We define a calculus for investigating the interactions between mixin modules and computational effects, by combining the purely functional mixin calculus CMS witha 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) withth e rules dealing withth e 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.
Supported by MIUR project NAPOLI, EU project DART IST-2001-33477 and thematic network APPSEM II IST-2001-38957
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
D. Ancona and E. Zucca. A primitive calculus for module systems. In G. Nadathur, editor, Principles and Practice of Declarative Programming, 1999, number 1702 in Lecture Notes in Computer Science, pages 62–79. Springer Verlag, 1999.
D. Ancona and E. Zucca. A calculus of module systems. Journal of Functional Programming, 12(2):91–132, March 2002.
G. Bracha and W. Cook. Mixin-based inheritance. In Proc. of the Joint ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications and the European Conference on Object-Oriented Programming, October 1990.
G. Boudol. The recursive record semantics of objects revisited. To appear in Journal of Functional Programming, 2002.
G. Bracha. The Programming Language JIGSAW: Mixins, Modularity and Multiple Inheritance. PhD thesis, Department of Comp. Sci., Univ. of Utah, 1992.
W.R. Cook. ADenotational Semantics of Inheritance. PhD thesis, Dept. of Computer Science, Brown University, 1989.
D. Duggan and C. Sourelis. Mixin modules. In Intl. Conf. on Functional Programming, Philadelphia, May 1996. ACM Press.
L. Erkök and J. Launchbury. Recursive monadic bindings. In Intl. Conf. on Functional Programming 2000, pages 174–185, 2000.
L. Erkök and J. Launchbury. A recursive do for Haskell. In Haskell Workshop’ 02, pages 29–37, 2002.
L. Erkök, J. Launchbury, and A. Moran. Semantics of fixIO. In FICS’01, 2001.
L. Erkök, J. Launchbury, and A. Moran. Semantics of value recursion for monadic input/output. Journal of Theoretical Informatics and Applications, 36(2):155–180, 2002.
R.B. Findler and M. Flatt. Modular object-oriented programming withunits and mixins. In Intl. Conf. on Functional Programming 1998, September 1998.
M. Flatt and M. Felleisen. Units: Cool modules for HOT languages. In PLDI’98-ACM Conf. on Programming Language Design and Implementation, pages 236–248, 1998.
A. V. Hense. Denotational semantics of an object-oriented programming language with explicit wrappers. Formal Aspects of Computing,5(3):181–207, 1993.
R. Harper and M. Lillibridge. A type-theoretic approach to higher-order modules withsh aring. In Conference record of POPL’ 94: 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 123–137, 1994.
T. Hirschowitz and X. Leroy. Mixin modules in a call-by-value setting. In D. Le Métayer, editor, ESOP 2002-Programming Languages and Systems, number 2305 in Lecture Notes in Computer Science, pages 6–20. Springer Verlag, 2002.
X. Leroy. Manifest types, modules and separate compilation. In Proc. 21st ACM Symp. on Principles of Programming Languages, pages 109–122. ACM Press, 1994.
E. Moggi and S. Fagorzi. A Monadic Multi-stage Metalanguage. In A.D. Gordon, editor, Foundations of Software Science and Computational Structures-FOSSACS 2003, volume 2620 of LNCS, pages 358–374. Springer Verlag, 2003.
E. Machkasova and F.A. Turbak. A calculus for link-time compilation. In G. Smolka, editor, ESOP 2000-Programming Languages and Systems, number 1782 in Lecture Notes in Computer Science, pages 260–274, Berlin, 2000. Springer Verlag.
U. S. Reddy. Objects as closures: Abstract semantics of object-oriented languages. In Proc. ACM Conf. on Lisp and Functional Programming, pages 289–297, 1988.
Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, 1994.
J.B. Wells and R. Vestergaard. Equational reasoning for linking with first-class primitive modules. In G. Smolka, editor, ESOP 2000-Programming Languages and Systems, number 1782 in Lecture Notes in Computer Science, pages 412–428, Berlin, 2000. Springer Verlag.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Ancona, D., Fagorzi, S., Moggi, E., Zucca, E. (2003). Mixin Modules and Computational Effects. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds) Automata, Languages and Programming. ICALP 2003. Lecture Notes in Computer Science, vol 2719. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45061-0_20
Download citation
DOI: https://doi.org/10.1007/3-540-45061-0_20
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40493-4
Online ISBN: 978-3-540-45061-0
eBook Packages: Springer Book Archive