The Chameleon Project


by

Johannes Beyer

Kasper B. Graversen

A programming language serves two related purposes; it provides a vehicle for the programmer to specify actions to be executed, and it provides a set of concepts for the programmer to use when thinking about what can be done. The first aspect ideally requires a language that is 'close to the machine,' so that all important aspects of a machine are handled simply and efficiently in a way that is reasonably obvious to the programmer... The second aspect requires ideally requires a language that is 'close to the problem to be solved' so that the concepts of a solution can be expressed directly and concisely. Bjarne Stroustrup - The C++ Programming Language

1: Introduction

Chameleon is a framework build to be a researh vehicle for exploring the world of conceptual programming. The name, Chameleon, symbolizes the natural changing of behaviour of objects, directly supported in the language. Just like a chameleon in nature is naturally able to adapt to its souroundings.

The chameleon constructed by aid of Openjava made by Michiaki Tatsubori (http://www.csg.is.titech.ac.jp/openjava/) which is as nice framework for making language extensions to the java language in an (somewhat) easy way.

What is Chameleon? Chameleon is a programming language, and a compiller for the language written in Java/Openjava. The compiler produces Java bytecode files which can be executed as any other .class file, and can even be directly integrated in programs written purely in Java or any other language understanding Java byte code files.

The philosophy behind conceptual programming is to bridge the gab between programs and the reality. The world is dynamic and virtually everything takes on a different shape depending on the eye of the beholder. Take the case of an "exam assistant" (greeting goes to Mourice btw.) which helps administrating exams a school. To some parts of the system all exams are alike - they have a title and, if passed, gives the student some points. However, to other parts of the system, each exam has special properties and functionality: an exam could be a traditional paper exam, a multiple choice exam, a web examn and so forth. To the "check detector" subsystem each type of examn has different properties, eg. a multiple choice exam will have a much higher rate of identical answers than other types of examns and so forth. This is all well realizeable in traditional OO programming - one just create a huge hierachy of exam types and takes the implementation from there.

What Chameleon propose is instead to offer dynamic runtime attachable and detachable inheritance on selected objects. That is, one can choose to extend a specific exam object to be a web exam giving it new state and functionality. Further this extension is only realized to those who whishes to see the examn in the extended form. If other parts of the system needs other extensions then these parts can freely extend the object to their needs without this action has fatal consequences for other parts of the system. This runtime extension is named roles and is a fundamental part of how we model the world and implement it in a computer.

As Bjarne Stroustrup once said on a Dr. Dobbs tech talk: "The fundamental idea of all programming languages is to get an elegant and direct representation of ideas. If you have an idea you should be able to put it into code in a way that corresponds to how you talk and think about it" and this is exactly what Chameleon better provides than traditional OO programming languages.

In the domain of AOP we see roles as being superior to the static compile time weaving techniques which currently dominate the scene. We see more and more problems arise which can not be solved by compile time weaving and we feel that roles are the solution to those problems.

if you want to learn more about conceptual programming and why you should start using it, you can download a small 40 page report (Thesis synopsis) which gives a good description of the problems of using only Object Oriented Programming languages. Further, it explains conceptual programming in an easy to understand fashion. Concurrently it explains the features that lies in the Chameleon language on how they are implemented in Java.

4: Chameleon Fun

4:1: Chameleon anatomy basics

Can you guess what the numbers on the picture represents? Here are the answers
  1. Air and Scent Inlets
  2. Brain
  3. Extendable Tongue
  4. Eyes
  5. Flat Video Screens
  6. Nerve Bundle
  7. Protective Spikes
  8. Tail
  9. Toes

4:2: Other stuff