next up previous contents
Next: Related Work Up: Introduction Previous: Scheme

Simulation

 

This paper is concerned with simulation of language concepts and mechanisms. I find it interesting to compare simulation with the more traditional language implementation techniques, compilation and interpretation. As a matter of terminology, I talk about a source language and a implementation language (their roles will be described in each of the cases below). I look at the qualities of the three language implementation techniques in the following way:

  1. Compilation.
    A program in a source language is transformed to an equivalent program in the implementation language, which in this case also is known as the target language. It is possible to execute the target language program via interpretation. When making the transformation tool one usually goes for efficiency of the produced target language program. Furthermore, one usually assumes that the source language is stable over a considerable time, mainly because it is a relatively complex affair to modify the transformation tool.

  2. Interpretation.
    On a case by case basis, but following some fixed patterns, the source language constructs of a program are simulated in an implementation language. Flexibility during the program development process rather than efficiency of the end result is emphasized following this scheme. Compared with the compilation approach, it is usually easier to modify the source language via changes in the interpreter. However, the source language is still supposed to be relatively stable.

  3. Simulation.
    On a case by case basis, constructs in the source language are expressed directly by equivalent constructs in the implementation language. This provides for an extreme degree of flexibility, but it also tends to require that the programmer must deal with many details in a disciplined manner. The identity of the source language may be weak; in return the source language is allowed to be non-stable and fluctuating.

Implementation of a language---or some aspects of a language---via simulation is mainly useful in experimental situations. Using simulation, one is not limited within the concepts and mechanisms of a single and already frozen language. Rather it is possible to gain experience by selecting concepts and mechanism from a ``spectrum'' of variations, which the implementation language makes attractive.

The simulation approach is also interesting when one wants to explore ``the inherent power'' of an implementation language. In this context, ``power'' means the ability to express foreign concepts or mechanisms in simple and elegant ways using existing means of the implementation language.

As mentioned above, the identity of the source language tends to be weak when using the simulation approach. It is the disciplined application of certain ``patterns'' that makes it possible at all to talk about a source language. If the identity of the source language patterns becomes too weak, one may decide to amplify the identity via the use of syntactic abstractions over the patterns of the simulation. In the Lisp world, such abstractions can be defined via macros. In this report I do not use syntactic abstraction beyond procedure definitions.



next up previous contents
Next: Related Work Up: Introduction Previous: Scheme



Kurt Noermark
Wed Mar 6 10:30:05 MET 1996