Language-shifting objects from Java to Smalltalk: an exploration using JavaConnect

  • Authors:
  • Johan Brichau;Coen De Roover

  • Affiliations:
  • Université catholique de Louvain;Vrije Universiteit Brussel

  • Venue:
  • IWST '09 Proceedings of the International Workshop on Smalltalk Technologies
  • Year:
  • 2009

Quantified Score

Hi-index 0.01

Visualization

Abstract

Foreign-function interfaces enable programs in a host language to interoperate with programs written in another language and vice-versa. Two languages that feature such an interface to a common language can even interoperate by means of this common intermediate language. Smalltalk and Java, for example, both offer an interface to C and can therefore interoperate through a connection of these interfaces. However, the resulting interactions will need to occur at the level of abstraction offered by the (low-level) C interfaces, although both Java and Smalltalk are object-oriented languages. In this paper, we describe how the dynamic and reflective facilities of the Smalltalk language permits us to raise the level of abstraction of these inter-language interactions to seamless message passing between objects. In addition, we introduce and explore the concept of language shifting objects where Java objects are not only represented in Smalltalk but can partially or completely migrate from Java to Smalltalk. Language-shifting effectively migrates Java methods to Smalltalk methods such that original Java objects can end up "living" in the Smalltalk environment without needing a connection to their originating Java environment.