J&: Nested Inheritance for Java (original) (raw)
J&: Language-Based Extensibility and Adaptation
The goal of the J& project is a type-safe programming language that makes code reuse easier, safer, and more powerful. In conventional languages, extending a large, complex system requires either duplicating code or writing boilerplate or glue code. Making a large system extensible requires intrusive and tedious design patterns. Writing and maintaining code is difficult and tedious. Our goal is type-safe, modular, scalable extensibility: the work required to modularly add a new feature should be proportional to the size of the feature, and extensions should be unable to cause type errors.
J& (pronounced “jet”) is an extension of Java that increases code extensibility and reuse using nested inheritance. Nested inheritance supports inheritance of packages and classes while allowing classes nested within to be overridden. Nested inheritance is a powerful mechanism for safely and modularly extending code.
J& is an outgrowth of work on the Polyglotextensible compiler framework. Polyglot has been ported to J&. An earlier version of the language was known as Jx.
Downloads
An initial release of the J& compiler is now available, released October 2006. It supports nested inheritance and intersection.
Versions of J& supporting different flavors of family-level sharing have been implemented but have not yet been released publicly.
Papers and reports
- Homogeneous family sharing
Xin Qi and Andrew C. Myers, OOPSLA 2010. October 2010. - Language support for reliable, extensible large-scale software systems.
Xin Qi, Ph.D. thesis, Cornell University Department of Computer Science. January 2010. - Sharing classes between families
Xin Qi and Andrew C. Myers,PLDI 2009. June 2009. - Masked types for sound object initialization
Xin Qi and Andrew C. Myers,POPL 2009. January 2009. - Programming languages for scalable software extension and composition
Nathaniel Nystrom, Ph.D. thesis, Cornell University Department of Computer Science. November 2006. - J&: Software composition with nested intersection
Nathaniel Nystrom, Xin Qi, and Andrew C. Myers, OOPSLA 2006, pp. 21–36. [ Full technical report ] - Scalable extensibility via nested inheritance
Nathaniel Nystrom, Stephen Chong, and Andrew C. Myers, OOPSLA 2004, pp. 99–115
Support
The development of J& has been supported by a number of funding sources, including DARPA Contract F30602-99-1-0533, monitored by USAF Rome Laboratory, ONR Grant N00014-01-1-0968, NSF Grants CNS-0208642, CNS-0430161, and CCF-0133302, an Alfred P. Sloan Research Fellowship, and an Intel Research Ph.D. Fellowship.
Example: Composing compilers with nested intersection.
The base compiler package is extended in two different ways using inheritance, adding new classes and class members (bold) in the subpackagespairand sum, which implement extended compilers. When intersected in the packagepair & sum, the class hierarchies contained in the two packages are composed. The resulting compiler incorporates both language extensions.