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.
- 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 ScholarDigital Library
- Eric Allen, Jonathan Bannet, and Robert Cartwright. A first-class approach to genericity. In OOPSLA'03, pages 96--114, 2003. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Kim B. Bruce. Some challenging typing issues in object-oriented languages. Electronic Notes in Theoretical Computer Science, 82(8), 2003.Google Scholar
- 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 Scholar
- Kim B. Bruce and J. Nathan Foster. LOOJ: Weaving LOOM into Java. In ECOOP'04, volume 3086 of LNCS, pages 389--413, 2004.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Torbjorn Ekman and Gorel Hedin. The JastAdd extensible Java compiler. In OOPSLA'07, pages 1--18, 2007. Google ScholarDigital Library
- Eric Ernst. Family polymorphism. In ECOOP'01, volume 2072 of LNCS, pages 303--327, 2001. Google ScholarDigital Library
- Erik Ernst. Propagating class and method combination. In ECOOP'99, volume 1628 of LNCS, pages 67--91. Springer-Verlag, 1999. Google ScholarDigital Library
- Erik Ernst. Higher-order hierarchies. In ECOOP'01, volume 2743 of LNCS, pages 303--326, 2003.Google Scholar
- 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 ScholarDigital Library
- Vaidas Gasiunas, Mira Mezini, and Klaus Ostermann. Dependent classes. In OOPSLA'07, pages 133--151, 2007. Google ScholarDigital Library
- Stephan Hermann. Object Teams - improving modularity for crosscutting collaborations. In Net Object Days 2002, volume 2591 of LNCS, 2002. Google ScholarDigital Library
- 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 ScholarDigital Library
- Atsushi Igarashi and Benjamin C. Pierce. Foundations for virtual types. Information and Computation, 175(1):34--49, 2003.Google ScholarCross Ref
- 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 Scholar
- Tetsuo Kamina and Tetsuo Tamai. Lightweight scalable components. In GPCE'07, pages 145--154, 2007. Google ScholarDigital Library
- Ole Lehrmann Madsen and Birger Moller-Pdersen. Virtual classes: A powerful mechanism in object-oriented programming. In OOPSLA'89, pages 397--406, 1989. Google ScholarDigital Library
- Mira Mezini and Klaus Ostermann. Integrating independent components with on-demand remodularization. In OOPSLA'02, pages 52--67, 2002. Google ScholarDigital Library
- Nathaniel Nystrom, Stephen Chong, and Andrew C. Myers. Scalable extensibility via nested inheritance. In OOPSLA'04, pages 99--115, 2004. Google ScholarDigital Library
- 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 ScholarDigital Library
- Nathaniel Nystrom, Xin Qi, and Andrew C. Myers. J&: Nested intersection for scalable software composition. In OOPSLA'06, pages 21--35, 2006. Google ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- Martin Odersky and Matthias Zenger. Scalable component abstractions. In OOPSLA'05, pages 41--57, 2005. Google ScholarDigital Library
- Klaus Ostermann. Dynamically composable collaborations with delegation layers. In ECOOP'02, volume 2374 of LNCS, pages 89--110, 2002. Google ScholarDigital Library
- Chieri Saito and Atsushi Igarashi. The essence of lightweight family polymorphism. In FTfJP, pages 27--41, 2007. Google ScholarDigital Library
- Chieri Saito, Atsushi Igarashi, and Mirko Viroli. Lightweight family polymorphism. Journal of Functional Programming, 18(3):285--331, 2008. Google ScholarDigital Library
- 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 ScholarDigital Library
- Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994. Google ScholarDigital Library
Index Terms
- Lightweight dependent classes
Recommendations
Dependent classes
Proceedings of the 2007 OOPSLA conferenceVirtual classes allow nested classes to be refined in subclasses. In this way nested classes can be seen as dependent abstractions of the objects of the enclosing classes. Expressing dependency via nesting, however, has two limitations: Abstractions ...
Dependent classes
OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applicationsVirtual classes allow nested classes to be refined in subclasses. In this way nested classes can be seen as dependent abstractions of the objects of the enclosing classes. Expressing dependency via nesting, however, has two limitations: Abstractions ...
Self type constructors
OOPSLA '09Bruce and Foster proposed the language LOOJ, an extension of Java with the notion of MyType, which represents the type of a self reference and changes its meaning along with inheritance. MyType is useful to write extensible yet type-safe classes for ...
Comments