MultiJava: design, implementation, and evaluation of a Java-compatible language supporting modular open classes and symmetric multiple dispatch
This paper describes the design, implementation, and evaluation of MultiJava, a backward-compatible extension to The Java Programming Language[Superscript TM] that supports open classes and symmetric multiple dispatch. An open class is one to which new methods can be added without editing the class directly. Multiple dispatch allows the method invoked by a message send to depend on the run-time types of any subset of the argument objects. MultiJava is the first full-scale programming language to support these features while retaining modular static typechecking and compilation. The paper defines the notions of modular editing, typechecking, and compilation, and describes two problems, the augmenting method problem and the binary method problem, that heretofore had not been solved in a modular way. We describe the architecture and key implementation details of our MultiJava compiler, mjc. mjc is open-source and is freely available for downloading. We present an evaluation of MultiJava that demonstrates the ease of extending code written in the language. We also provide empirical results for the performance of MultiJava versus the previous partial solutions to the augmenting method and binary method problems. These results demonstrate that MultiJava's performance is comparable to that of the partial solutions, while the language provides full solutions to the problems.