N9I - 3/16/2010
Written on Sun, 11 Apr 2010 17:39:36 +0000 - Last updated on Sun, 11 Apr 2010 17:47:36 +0000A journal entry in the development of the N9I programming language, dated March 16, 2010
N9I Compiler
Phase I: Intermediate XML format
The first stage of N9I compilation is translation to the N9I Intermediate XML (NIX) format. NIX describes functions, objects, and namespaces in XML language. XML is used because XML parsers are ubiquitious. NIX may be plaintext or gzipped. Using a standard language such as XML also make it easier to target other languages to the N9I meta-platform. The output of phase I is guaranteed to be as cross-platform as the input source code. N9I itself provides various language features, mostly relating to casting and conversion of objects and primitives. NIX also provides these, however, a NIX class must explicitly declare what other kinds of objects it can be casted to and from.
Phase II: Native Language
Instead of being compiled directly to machine code, the NIX is translated yet again, this time to a language "native" to the target environment. For example, when targeting the Java VM, the NIX is translated to Java source. The output from phase III is platform-specific and does not contain code for other platforms. Since all phases of the N9I compiler are modular, new backends can easily be created.
Phase III: Native Language Compiler
In the third compilation stage, the N9I compiler calls on another compiler to generate machine code.
Phase IV: Post-Compilation
This is the final phase of the compilation.