The Phoenix Compiler Framework
(Page 1 of 4 )
In our hectic world you may write programs in a huge variety of languages: C#, C/C++, F#, Haskell, Visual Basic and the list seems endless. The common factor among them is that every program, regardless of language, will be compiled before it becomes proper working machine code. Exploiting this common trait may revolutionize our way of thinking about programming, and the first technology to try this is here, under the code name of Phoenix.
The Phoenix Compiler Framework
Phoenix is an innovative framework that tries to create a central compiler system that can handle all of the imaginable language compilers, and even offers the option of writing your own compiler for your own language.

The Phoenix Logo - Image Courtesy Of Microsoft
Of course, it also completes a couple of other tasks, like letting you extend the compiler for the languages already existing, and as the upper image states: generate, optimize and analyze your code.
However, before we go any further let me sum up concisely the topic of this article. Just as the title suggests, it is all about presenting the Phoenix Compiler Framework. I will divide the whole process into two articles. During the first one (what you are already reading), I will present the framework's main concept and what you can do with it.
Within an article that will appear later titled "Low Level Code Optimization in Phoenix," I will go into the more complicated details of how Phoenix accomplishes its work. This will let you observe how the compiler performs and to comprehend the difficulties faced by producing machine code from what you type inside the computer.
The development team made a couple of interesting videos related to this that appeared on channel 9, however, for those of you that do not want to watch an hour-long video for a brief overview, let's get moving.
Kang Su Gatlen announced the project back in 2004, declaring that it would be a next generation compiler that will represent the basis of code generation in the future for all of the Microsoft's applications.
The Phoenix is a joint project of the Microsoft Research, Common Language Runtime (CLR) and Visual C++ teams. So the Research segment works with the development team to create a compiler that can be used by university professors to teach compiler principles, and also by developers for their code.

The Phoenix platform overview - Image Courtesy Of Microsoft
This is an Open Framework, so anyone interested in it can use it. Microsoft will certainly use it; in fact, the company intends to compile all of their products (OS, Office, Visual Studio, and so forth) with it.
Nevertheless there are a couple of situations and structures that, while discussed in theory, may come up that are absurd in practice -- when you want, for instance, to compile a million lines of long code. Therefore, to develop something that can handle this, the entire framework is pluggable and modular.
In practice, this means that you can replace every part of the framework with your own specialized code, or you can just extend it where you want to. With time, an SDK (Software Development Kit) emerged, providing program analysis and transformation regardless of the language used.
Next: The Heart of Phoenix >>
More BrainDump Articles
More By Gabor Bernat