Language-Shifting Objects in Inter-language Interoperability An exploration using JavaConnect in Smalltalk
暂无分享,去创建一个
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 permit 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.
[1] Ralph Johnson,et al. design patterns elements of reusable object oriented software , 2019 .