| ![]() |
ptom { A pascal Translator For Mobile Code
Christian F. Tschudin
Technical Report 96.06, July 1996
Computer Science Department, University of Zurich,
Winterthurerstr. 190, CH-8057 Zurich, Switzerland
Email: [email protected]
Abstract
We report on an implementation of a pascal translator that generates code
for mobile software messengers (agents): these agents can roam a network of
interconnected execution platforms on behalf of a user, enabling users to implement
customized network functionality themselves. In this report we focus
on the language extensions (pascal-m) and the implementation aspects of the
translator. The main departure in pascal-m from standard pascal is that the
programmer has access to the generated code in form of string constants. An
interesting aspect of the pascal-to-MO" (ptom) translator is that pascal-m
is translated to the stack-based high-level language MO. MO is similar to postscript
and has no notion of memory addresses although pascal compilers
usually produce code for machines or software interpreters with word addressable
memory: because MO completely hides the exact memory locations of code
as well as data, we have to use other implementation approaches for activation
frames, variable dereferencing and code fixups. Other aspects of the translator
implementation like data mapping and heap management are also described.
Finally, we relate our work to recent developments in the field of intermediate
code and languages.
Keywords: pascal, MO, postscript, communications messengers, mobile
software agents.
1 Introduction
pascal is still one of the most used languages when it comes to explain algorithms in textbooks or scientific journals. In our research project on mobile code we also had the need to document the algorithms we used for programming the network with communications messengers" i.e., small autonomous mobile code pieces that can roam the network. Therefore, we developed a new pascal dialect { pascal-m { and the ptom translator that translates pascal-m to the target language MO. The novel element of pascal-m is that the programmer has direct access to the generated code from within pascal-m. This allows for explicit manipulation of code strings to be shipped to neighboring messenger execution platforms.