SPiCE: A System for Translating Smalltalk Programs Into a C Environment

  • Authors:
  • Kazuki Yasumatsu;Norihisa Doi

  • Affiliations:
  • -;-

  • Venue:
  • IEEE Transactions on Software Engineering
  • Year:
  • 1995

Quantified Score

Hi-index 0.00

Visualization

Abstract

Smalltalk-80 (hereafter referred to as Smalltalk), which is one of the most productive programming languages/ environments, is very well suited for prototyping of applications but it is less well suited for delivering applications because applications can neither run in isolation from the Smalltalk environment nor be combined with other programs written in other languages. One way to make Smalltalk suitable for delivering applications is to translate Smalltalk into a compiler language such as C. By translating Smalltalk code into portable and interoperable C code, it is possible to deliver a stand-alone version of Smalltalk applications, and to develop an application partly in Smalltalk and partly in C. However, there are some difficulties in translating Smalltalk code into such a C code. First, the execution model of Smalltalk, which creates activation records as objects, is very different from that of C, and second, Smalltalk and C have very different approaches to storage management. We have implemented SPiCE, a system for translating Smalltalk into C. Our approach to the translation is to create runtime replacement classes implementing the same functionality of Smalltalk classes that are inherently part of the Smalltalk execution model, and to provide semi-conservative real-time compacting garbage collection that works without language support. Our approach fills the gaps of the execution model and storage management in a safe and efficient manner, and enables the generation of portable and interoperable C code while preserving the semantics of Smalltalk. Currently, the performance of the generated C code is roughly the same as the original Smalltalk.