Skip to main content

True Modules for Java-like Languages

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2072))

Abstract

We present JavaMod, a true module system constructed on top of a Java-like language. More in detail, this means that basic modules are collections of Java classes and specify in their interface the imported and exported classes with their types; furthermore, it is possible to write structured module expressions by means of a set of module operators and a type system at the module level ensures type safety. In designing such a type system, one has to face non trivial problems, notably the fact that a module M which extends an imported class C can be correctly combined only with modules exporting a class C which, besides providing the expected services, causes no interferences with its subclasses defined in M. What we obtain is a module language which is extremely flexible and allows to express (without any need of enriching the syntax of the core level, that is, the Java language), for instance, generic types as in Pizza and GJ, mixin classes (that is, subclasses parametric in the direct superclass) and mutually recursive class definitions split in independent modules.

Partially supported by Murst - TOSCA Teoria della Concorrenza, Linguaggi di Ordine Superiore e Strutture di Tipi and APPlied SEMantics - Esprit Working Group 26142.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. D. Ancona, G. Lagorio, and E. Zucca. Jam: A smooth extension of Java with mixins. In E. Bertino, editor, ECOOP’00-European Conference on Object-Oriented Programming, number 1850 in Lecture Notes in Computer Science, pages 154–178, Berlin, 2000. Springer Verlag.

    Google Scholar 

  2. D. Ancona and E. Zucca. A theory of mixin modules: Basic and derived operators. Mathematical Structures in Computer Science, 8(4):401–446, August 1998.

    Article  MATH  MathSciNet  Google Scholar 

  3. D. Ancona and E. Zucca. A calculus of module systems. Technical Report DISITR-99-09, Dipartimento di Informatica e Scienze dell’Informazione, Università di Genova, 1999. Submitted for journal publication. Extended version of [4].

    Google Scholar 

  4. D. Ancona and E. Zucca. A primitive calculus for module systems. In G. Nadathur, editor, PPDP’-Principles and Practice of Declarative Programming, number 1702 in Lecture Notes in Computer Science, pages 62–79, Berlin, 1999. Springer Verlag.

    Chapter  Google Scholar 

  5. D. Ancona and E. Zucca. True modules for Java-like languages: Design and foundations. Technical Report DISI-TR-00-12, Dipartimento di Informatica e Scienze dell’Informazione, Università di Genova, August 2000.

    Google Scholar 

  6. L. Bauer, A.W. Appel, and E.W. Felten. Mechanisms for secure modular programming in Java. Technical Report CS-TR-603-99, Department of Computer Science, Princeton University, July 1999.

    Google Scholar 

  7. V. Bono, A. Patel, and V. Shmatikov. A core calculus of classes and mixins. In R. Guerraoui, editor, ECOOP’00-European Conference on Object-Oriented Programming, number 1628 in Lecture Notes in Computer Science, pages 43–66, Berlin, 1999. Springer Verlag.

    Google Scholar 

  8. G. Bracha and W. Cook. Mixin-based inheritance. In ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1990, pages 303–311. ACM Press, October 1990. SIGPLAN Notices, volume 25, number 10.

    Google Scholar 

  9. G. Bracha and G. Lindstrom. Modularity meets inheritance. In Proc. International Conference on Computer Languages, pages 282–290, San Francisco, April 1992. IEEE Computer Society.

    Google Scholar 

  10. G. Bracha, M. Odersky, D. Stoutmire, and P. Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1998, October 1998. Home page: http://www.cs.bell-labs.com/who/wadler/pizza/gj/.

  11. M. Büchi and W. Weck. Generic wrapping. In E. Bertino, editor, ECOOP’00-European Conference on Object-Oriented Programming, number 1850 in Lecture Notes in Computer Science, pages 201–225. Springer Verlag, 2000.

    Google Scholar 

  12. K. Crary, R. Harper, and S. Puri. What is a recursive module? In PLDI’99-ACM Conf. on Programming Language Design and Implementation, 1999.

    Google Scholar 

  13. S. Drossopoulou and S. Eisenbach. Describing the semantics of Java and proving type soundness. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, number 1523 in Lecture Notes in Computer Science, pages 41–82. Springer Verlag, Berlin, 1999.

    Chapter  Google Scholar 

  14. D. Duggan. A mixin-based, semantics-based approach to reusing domain-specific programming languages. In E. Bertino, editor, ECOOP’00-European Conference on Object-Oriented Programming, number 1850 in Lecture Notes in Computer Science, pages 179–200. Springer Verlag, 2000.

    Google Scholar 

  15. D. Duggan and C. Sourelis. Mixin modules. In Intl. Conf. on Functional Programming, pages 262–273, Philadelphia, June 1996. ACM Press.

    Google Scholar 

  16. R.B. Findler and M. Flatt. Modular object-oriented programming with units and mixins. In Intl. Conf. on Functional Programming 1998, September 1998.

    Google Scholar 

  17. K. Fisher and J. Reppy. The design of a class mechanism for Moby. In PLDI’99-ACM Conf. on Programming Language Design and Implementation, pages 37–49, May 1999.

    Google Scholar 

  18. K. Fisher and J. Reppy. Extending Moby with inheritance-based subtyping. In European Symposium on Programming 2000, Lecture Notes in Computer Science, Berlin, 2000. Springer Verlag. To appear.

    Google Scholar 

  19. 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.

    Google Scholar 

  20. M. Flatt, S. Krishnamurthi, and M. Felleisen. Classes and mixins. In ACM Symp. on Principles of Programming Languages 1998, pages 171–183, January 1998.

    Google Scholar 

  21. J. Gosling, B. Joy, and G. Steele. The Java™ Language Specification. Addison-Wesley, 1996.

    Google Scholar 

  22. R. Harper and M. Lillibridge. A type theoretic approach to higher-order modules with sharing. In ACM Symp. on Principles of Programming Languages 1994, pages 127–137. ACM Press, 1994.

    Google Scholar 

  23. A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. In ACM Symp. on Object-Oriented Programming: Systems, Languages and Applications 1999, pages 132–146, November 1999.

    Google Scholar 

  24. X. Leroy. Manifest types, modules and separate compilation. In ACM Symp. on Principles of Programming Languages 1994, pages 109–122. ACM Press, 1994.

    Google Scholar 

  25. X. Leroy. A modular module system. Journal of Functional Programming, 10(3):269–303, May 2000.

    Article  MATH  Google Scholar 

  26. B. Meyer. Eiffel: The language. Prentice Hall, 1992.

    Google Scholar 

  27. R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. The MIT Press, Cambridge, Massachussetts, 1990.

    Google Scholar 

  28. M. Odersky and P. Wadler. Pizza into Java: Translating theory into practice. In ACM Symp. on Principles of Programming Languages 1997. ACM Press, January 1997.

    Google Scholar 

  29. D. Remy and J. Vouillon. Objective ML: An effective object-oriented extension to ML. Theory and Practice of Object Systems, 4(1): 27–50, 1998.

    Article  Google Scholar 

  30. C. Szyperski. Import is not inheritance. why we need both: Modules and classes. In O. Lehrmann Madsen, editor, ECOOP’92-European Conference on Object-Oriented Programming, number 615 in Lecture Notes in Computer Science, pages 19–32, Berlin, 1992. Springer Verlag.

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ancona, D., Zucca, E. (2001). True Modules for Java-like Languages. In: Knudsen, J.L. (eds) ECOOP 2001 — Object-Oriented Programming. ECOOP 2001. Lecture Notes in Computer Science, vol 2072. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45337-7_19

Download citation

  • DOI: https://doi.org/10.1007/3-540-45337-7_19

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42206-8

  • Online ISBN: 978-3-540-45337-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics