Implementing Dynamic Language Features in Java Using Dynamic Code Generation

  • Authors:
  • Thomas M. Breuel

  • Affiliations:
  • -

  • Venue:
  • TOOLS '01 Proceedings of the 39th International Conference and Exhibition on Technology of Object-Oriented Languages and Systems (TOOLS39)
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

Abstract: Compared to dynamic object-oriented languages like CommonLisp or Smalltalk, Java has a fairly simple and restrictive object and type system. Some of the key Differences between Java and these other languages is that they offer structural conformance, automatic delegation, and dynamic mixins. When such constructs are needed in a language like Java, they are usually expressed in terms of standard obj ct-oriented design patterns, requiring the manual implementation of "glue" or "helper" classes. This paper describes ways in which such features can be provided efficiently and automatically in terms of Java's platform-independent binary format and dynamic loading mechanisms. The implementation does not require any changes to the Java runtime, bytecodes, or class loader and yields performance comparable to manually implemented design patterns. The approach should prove useful both as a programming tool for Java and as an strategy for building efficient implementations of dynamic languages on top of the Java virtual machine.