skip to main content
10.1145/1449913.1449932acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

Lightweight dependent classes

Published:19 October 2008Publication History

ABSTRACT

Extensive research efforts have been devoted to implement a group of type-safe mutually recursive classes; recently, proposals for separating each member of the group as a reusable and composable programming unit have also been presented. One problem of these proposals is verbosity of the source programs; we have to declare a recursive type parameter to parameterize each mutually recursive class within each class declaration, and we have to declare a fixed-point class with empty class body for each parameterized class. Therefore, even though the underlying type system is simple, programs written in these languages tend to be rather complex and hard to understand. In this paper, we propose a language with lightweight dependent classes that forms a simple type system built on top of generic Java. In this language, we can implement each member of type-safe mutually recursive classes in a separate source file without writing a lot of complex boilerplate code. To carefully investigate type soundness of our proposal, we develop X.FGJ, a simple extension of FGJ supporting lightweight dependent classes. This type system is proved to be sound.

References

  1. Ole Agesen, Stephen N. Freund, and John C. Mitchell. Adding type parameterization to the Java language. In OOPSLA'97, Atlanta, pages 49--65. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Eric Allen, Jonathan Bannet, and Robert Cartwright. A first-class approach to genericity. In OOPSLA'03, pages 96--114, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In OOPSLA'98, pages 183--200, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Kim Bruce, Angela Schuett, Robert van Gent, and Adrian Fiech. PolyTOIL: A type-safe polymorphic object-oriented language. ACM TOPLAS, 25(2):225--290, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Kim B. Bruce. Some challenging typing issues in object-oriented languages. Electronic Notes in Theoretical Computer Science, 82(8), 2003.Google ScholarGoogle Scholar
  6. Kim B. Bruce, Adrian Fiech, and Leaf Peterson. Subtyping is not a good "match" for object-oriented languages. In ECOOP'97, volume 1241 of LNCS, pages 104--127, 1997.Google ScholarGoogle Scholar
  7. Kim B. Bruce and J. Nathan Foster. LOOJ: Weaving LOOM into Java. In ECOOP'04, volume 3086 of LNCS, pages 389--413, 2004.Google ScholarGoogle Scholar
  8. Kim B. Bruce, Martin Odersky, and Philip Wadler. A statically safe alternative to virtual types. In ECOOP'98, volume 1445 of LNCS, pages 523--549, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Robert Cartwright and Jr. Guy L. Steele. Compatible genericity with run-time types for the Java programming language. In OOPSLA'98, pages 201--215, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Torbjorn Ekman and Gorel Hedin. The JastAdd extensible Java compiler. In OOPSLA'07, pages 1--18, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Eric Ernst. Family polymorphism. In ECOOP'01, volume 2072 of LNCS, pages 303--327, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Erik Ernst. Propagating class and method combination. In ECOOP'99, volume 1628 of LNCS, pages 67--91. Springer-Verlag, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Erik Ernst. Higher-order hierarchies. In ECOOP'01, volume 2743 of LNCS, pages 303--326, 2003.Google ScholarGoogle Scholar
  14. Erik Ernst, Klaus Ostermann, and William R. Cook. A virtual class calculus. In Proceedings of 33th ACM Symposium on Principles of Programming Languages (POPL), pages 270--282, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Vaidas Gasiunas, Mira Mezini, and Klaus Ostermann. Dependent classes. In OOPSLA'07, pages 133--151, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Stephan Hermann. Object Teams - improving modularity for crosscutting collaborations. In Net Object Days 2002, volume 2591 of LNCS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Atsushi Igarashi, Benjamin Pierce, and Philip Wadler. Featherweight Java: A minimal core calculus for Java and GJ. ACM TOPLAS, 23(3):396--450, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Atsushi Igarashi and Benjamin C. Pierce. Foundations for virtual types. Information and Computation, 175(1):34--49, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  19. Paul Jolly, Sophia Drossopoulou, Christopher Anderson, and Klaus Ostermann. Simple dependent types: Concord. In ECOOP Workshop on Formal Techniques for Java-like Programs (FTfJP 2004), 2004.Google ScholarGoogle Scholar
  20. Tetsuo Kamina and Tetsuo Tamai. Lightweight scalable components. In GPCE'07, pages 145--154, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Ole Lehrmann Madsen and Birger Moller-Pdersen. Virtual classes: A powerful mechanism in object-oriented programming. In OOPSLA'89, pages 397--406, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Mira Mezini and Klaus Ostermann. Integrating independent components with on-demand remodularization. In OOPSLA'02, pages 52--67, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Nathaniel Nystrom, Stephen Chong, and Andrew C. Myers. Scalable extensibility via nested inheritance. In OOPSLA'04, pages 99--115, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for Java. In Proceedings of 12th International Conference on Compiler Construction, volume 2622 of LNCS, pages 138--152, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Nathaniel Nystrom, Xin Qi, and Andrew C. Myers. J&: Nested intersection for scalable software composition. In OOPSLA'06, pages 21--35, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Martin Odersky, Vincent Cremet, Christine Rockl, and Matthias Zenger. A nominal theory of objects with dependent types. In ECOOP'03, volume 2743 of LNCS, pages 201--224, 2003.Google ScholarGoogle Scholar
  27. Martin Odersky and Philip Wadler. Pizza into Java: Translation theory into practice. In ACM Symposium on Principles of Programming Languages (POPL), pages 146--159, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Martin Odersky and Matthias Zenger. Scalable component abstractions. In OOPSLA'05, pages 41--57, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Klaus Ostermann. Dynamically composable collaborations with delegation layers. In ECOOP'02, volume 2374 of LNCS, pages 89--110, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Chieri Saito and Atsushi Igarashi. The essence of lightweight family polymorphism. In FTfJP, pages 27--41, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Chieri Saito, Atsushi Igarashi, and Mirko Viroli. Lightweight family polymorphism. Journal of Functional Programming, 18(3):285--331, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Kresten Krab Thorup and Mads Torgersen. Unifying genericity: Combining the benefits of virtual types and parameterized classes. In ECOOP'99, volume 1628 of LNCS, pages 186--204, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Lightweight dependent classes

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            GPCE '08: Proceedings of the 7th international conference on Generative programming and component engineering
            October 2008
            194 pages
            ISBN:9781605582672
            DOI:10.1145/1449913

            Copyright © 2008 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 19 October 2008

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate56of180submissions,31%

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader