Skip to content

DelphJ is a Java-based OO language (MorphJ with delegation features) that eschews inheritance completely, in favor of a combination of class morphing and (deep) delegation.

License

plast-lab/DelphJ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DelphJ

DelphJ is a Java-based OO language (MorphJ with delegation features) that eschews inheritance completely, in favor of a combination of class morphing and (deep) delegation. DelphJ runs on top of the JVM and is based on the MorphJ compiler. delphjc is implemented via AST rewriting using JastAddJ. In a nutshell the implementation of the compiler is based on two things:

  1. A runtime system that is implemented in a core class named Reference that implements the dynamic semantics described in the paper.
  2. A rewrite system on-top the MorphJ compiler.

You can see differences between the original MorphJ implementation and DelphJ with the following git command:

git diff -w morphj..master

Rewritings employed

  1. Field declaration.
  2. New instance expression.
  3. Method declaration, adding one parameter with changed reference types.
  4. Dot accesses.
  5. Method invocation to a reflective invocation with self as first parameter.
  6. Exposing subobject field for path merging.
  7. Adding getData() method access when invoking method on subobject fields.
  8. Disambiguate package access to variable access.
  9. Variable declaration.

Building & Running the compiler

To build the compiler run ant with DelphJ's backend build.xml

ant -f ~/DelphJ/MJBackend/src/build.xml

The compiler runs via the delphjc executable script (which must be part of the PATH envirnment variable) and requires one more to be set which points to the DelphJ root directory:

export mj=<path-to>/DelphJ

And one for the java classpath:

export CLASSPATH=$mj/MJBackend/src:$mj/MJBackend/thirdparty/asm-all-3.1.jar:/usr/share/java/junit4.jar

The compiler can be run via command prompt with the delphjc command:

usage: delphjc [[-r | --rewritings ] | [-h] | [--whatif]] files

Documentation

Description, examples and formal discussion of DelphJ:

MorphJ papers:

This project is a work in progress and is based on our OOPSLA'13 paper. It is for demonstration purposes only.

About

DelphJ is a Java-based OO language (MorphJ with delegation features) that eschews inheritance completely, in favor of a combination of class morphing and (deep) delegation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages