Delegation-Based MDSOC Kernel
===========================

Michael Haupt, 2008-08-12


The MDSOC kernel was developed by

     * Hans Schippers (hans.schippers@ua.ac.be),
     * Michael Haupt (michael.haupt@hpi.uni-potsdam.de), and
     * Robert Hirschfeld (hirschfeld@hpi.uni-potsdam.de).

The code constituting the MDSOC kernel is available under the MIT license (see the LICENSE file for details).


Preliminary Notes
-----------------

This documentation is, at this point in time, not intended to be complete. Over time, the MDSOC kernel authors will extend it to better explain the various bits of the implementation. For now, this document serves to aid prospective users in setting up a working environment, running examples, and starting their own experiments.

This software was tested and is known to work under Mac OS X (Leopard) and Linux. In case of trouble, the authors will try to help.

All path names given below are relative to the mdsoc-kernel directory.


Building and Installing
-----------------------

To compile the entire Pepsi/Jolt environment and make it available for experimentation with the MDSOC kernel, issue the following commands in a terminal:

     cd object
     make
     sudo make install
     cd ../function
     make

This will perform the entire bootstrap cycle for Pepsi (i.e., Pepsi will be compiled using itself), and eventually build the Jolt environment using the self-hosting Pepsi compiler.


MDSOC Kernel Implementation
-------------------------

The MDSOC kernel implementation resides in the directory function/mdsoc-kernel and its subdirectories. In particular, the subdirectories have the following contents:

     * delmdsoc: the implementation of the delegation-based MDSOC kernel itself.
     * examples: sample implementations of several languages on top of the
       kernel, and sample programs written in these languages.

Apart from that, the MDSOC kernel required several additions to the id library underlying the entire system. They can be found in object/id/libid.c. Extensions to the Jolt object model implementation were also made; they are located in the files in function/objects-ext.


Experimenting with the MDSOC Kernel
---------------------------------

In the directory function/examples/peg-extra, there are several example applications written in different languages that have been implemented on top of the MDSOC kernel. These languages are

     * j, a Java subset,
     * aj, an AspectJ subset (pointcuts-and-advice) and extension to j,
     * ij, an AspectJ subset (inter-type declarations) and extension to j, and
     * cj, a j extension that supports context-oriented programming.

The j, aj, and ij languages were defined by Mark Skipper in his doctoral dissertation. They were adapted for this work. The cj language was added as a fourth example.

The language implementations can be found in function/mdsoc-kernel/examples, and have the names j.peg, aj.peg, ij.peg, and cj.peg. Each of these files contains a full language definition and implementation of a Jolt-based JIT compiler for that language.

The examples in function/examples/peg-extra (they can be recognised by the file suffixes, which are simply the name of the corresponding j family language) can be run by simply passing their names to the make utility. For instance,

     make observer.cj

will run the subject/observer example implemented in observer.cj. If the cj language implementation has not already been generated from the PEG definition, make will first do that.