Parametric polymorphism in Java: an approach to translation based on reflective features

The introduction of parametric polymorphism in Java with translation approaches has been shown to be of considerable interest, allowing the definition of extensions of Java on top of the existing Virtual Machines. Homogeneous translations furthermore, seem to be more useful than heterogeneous, avoiding the continuous increase of library code with redundant information. At this time however, homogeneous approaches aren't as flexible as heterogeneous, with extensions failing to integrate well with base language typing. In this paper, using some of the features of the Core Reflection of Java, we introduce a homogeneous translation in which run-time information about instantiation of type-parameters is carried, allowing full integration of parame-terized types with Java typing. Performance overhead is greatly decreased using a brand new translation technique based on the deferring of the management of type information at load-time. The same power and flexibility of previous heterogeneous approaches is obtained while maintaining homogeneous translation advantages.

[1]  Martin Odersky,et al.  Making the future safe for the past: adding genericity to the Java programming language , 1998, OOPSLA '98.

[2]  Andrew C. Myers,et al.  Parameterized types for Java , 1997, POPL '97.

[3]  Bertrand Meyer,et al.  Genericity versus inheritance , 1986, OOPLSA '86.

[4]  Stephen N. Freund,et al.  Adding type parameterization to the Java language , 1997, OOPSLA '97.

[5]  Robert Cartwright,et al.  Compatible genericity with run-time types for the Java programming language , 1998, OOPSLA '98.

[6]  Martin Odersky,et al.  Two Ways to Bake Your Pizza - Translating Parameterised Types into Java , 1998, Generic Programming.

[7]  Kresten Krab Thorup Genericity in Java with Virtual Types , 1997, ECOOP.

[8]  William R. Cook,et al.  A Proposal for Making Eiffel Type-Safe , 1989, Comput. J..

[9]  Martin Odersky,et al.  A Statically Safe Alternative to Virtual Types , 1998, ECOOP.

[10]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 2001, TOPL.

[11]  Monica Pawlan Essentials of the Java Programming Language: A Hands-On Guide , 2000 .

[12]  Suad Alagic,et al.  Parametric polymorphism for Java: a reflective solution , 1998, OOPSLA '98.

[13]  Mads Torgersen Virtual types are statically safe , 1998 .

[14]  Mads Torgersen,et al.  Unifying Genericity - Combining the Benefits of Virtual Types and Parameterized Classes , 1999, ECOOP.

[15]  Parasuram Anantharam Essentials of the Java programming language: a hands-on guide , 2001, SOEN.

[16]  William Cook,et al.  A Proposal for Making Eiel Type-safe , 1989 .

[17]  Martin Odersky,et al.  Pizza into Java: translating theory into practice , 1997, POPL '97.