Difference between revisions of "Arjuna"

From Mesham
Jump to navigationJump to search
Line 8: Line 8:
  
 
The third major aspect, although not integrated with the compiler is the runtime support library. This has been written in C, around 3000 lines, and a version exists for each machine architecture to support portability. The runtime library in the next line of compilers, Oubliette, is actually based on the existing RTL, but additional services are required so the Arjuna line is not forward compatible (although the Oubliette RTL should work with Arjuna.)
 
The third major aspect, although not integrated with the compiler is the runtime support library. This has been written in C, around 3000 lines, and a version exists for each machine architecture to support portability. The runtime library in the next line of compilers, Oubliette, is actually based on the existing RTL, but additional services are required so the Arjuna line is not forward compatible (although the Oubliette RTL should work with Arjuna.)
 +
 +
==Advantages==
 +
Arjuna works by the compiler writer hand crafting each aspect, whether it is a core function of library, specifying the resulting compiled code and any optimisation to be applied. Whilst this results in very efficient results, it is time consuming and does not allow the Mesham programmer to specify their own types in thief code. Arjuna is also very flexible, vast changes in the language were quite easy to I
 +
plement, this level of flexability would not be present in other solutions and as such from an iterative language design view it was an essential requirement.
 +
 +
==Disadvantages==
 +
So why rewrite the compiler? Flexability comes at a price, slow compilation. Now the language has reached a level of maturity the core aspects can be written without worry that they will change much. Also it would be good to allow programmers to design and implement types in their own Mesham code, which the architecture of Arjuna would find difficult to support (although not impossible. )
 +
 +
There is the additional fact that Arjuna has been modified and patched so much the initial clean design is starting to blur, with the lessons learned a much cleaner compiler cam be created. Lastly, it is the feeling of myself that we are coming to a limit of FlexibO, the fact that hacks are required to use this language for the compiler is probably a sure indication that it is time to rewrite in a different choice.

Revision as of 15:01, 24 April 2010

Introduction

The Arjuna line of compilers for Mesham are versioned from 0.0 up to 0.99. The latest compiler release based upon the Arjuna core is 0.5. The reason for the distinction is that it was decided to rewrite the compiler and as such a clear distinction between the architectures and technology is useful. Arjuna was the informale name of the language, and specifically compiler before Mesham was decided upon.

Technology

Arjuna is based upon a number of different technologies. The main compiling system is written in FlexibO, an OO experimental language designed to be used for compiler writing (certainly the biggest project in this language. ) The reason for this choice was that using this language the compiler was fast to write, very flexible but quite slow in translation. This code aspect is around 20,000 lines which pushed flexibo to, and in some cases beyond it's limits. FlexibO abstracts the syntactic stage, providing automatic lexing and parsing. The core compiler is based around a reflection system, with the type and function libraries, also written in flexibo, quite seperate and connected in via defined services.

FlexibO does have it's limits and as such a preprocessor is written in Java to convert Mesham into a preprocessed form for use by the core compiler. This preprocessor, around 2000 lines, is used as a band aid to flexibo and for instance adds in scoping information without which the compiler would not operate.

The third major aspect, although not integrated with the compiler is the runtime support library. This has been written in C, around 3000 lines, and a version exists for each machine architecture to support portability. The runtime library in the next line of compilers, Oubliette, is actually based on the existing RTL, but additional services are required so the Arjuna line is not forward compatible (although the Oubliette RTL should work with Arjuna.)

Advantages

Arjuna works by the compiler writer hand crafting each aspect, whether it is a core function of library, specifying the resulting compiled code and any optimisation to be applied. Whilst this results in very efficient results, it is time consuming and does not allow the Mesham programmer to specify their own types in thief code. Arjuna is also very flexible, vast changes in the language were quite easy to I plement, this level of flexability would not be present in other solutions and as such from an iterative language design view it was an essential requirement.

Disadvantages

So why rewrite the compiler? Flexability comes at a price, slow compilation. Now the language has reached a level of maturity the core aspects can be written without worry that they will change much. Also it would be good to allow programmers to design and implement types in their own Mesham code, which the architecture of Arjuna would find difficult to support (although not impossible. )

There is the additional fact that Arjuna has been modified and patched so much the initial clean design is starting to blur, with the lessons learned a much cleaner compiler cam be created. Lastly, it is the feeling of myself that we are coming to a limit of FlexibO, the fact that hacks are required to use this language for the compiler is probably a sure indication that it is time to rewrite in a different choice.