Arjuna
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 informal name of the language, and specifically compiler before Mesham was decided upon.
Download
The Arjuna line is entirely deprecated now, please use the Oubliette line
It is possible to download the latest Arjuna line version 0.5 here and the compatible runtime can be found here. Whilst the website examples and documentation have moved on, you can view the change lists to understand how to use the Arjuna line.
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 changes and modifications to the language specification mean that the two are not mutually compatible.
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 implement, 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.