Unicon compiler, rewrite in Unicon
The Unicon compiler is currently implemented in the following fashion. An Icon program reads the Unicon source and produces an equivalent Icon program. This Icon program is then compiled using the Icon compiler to produce i-code. The Icon compiler is implemented using a number of techniques. LEX is used to generate the lexical analyzer for Icon. The parser is written by hand in C. The i-code interpreter is implemented using a language known as RTL which is compiled to produce a C program for the interpreter.
Under the current implementation none of the visibility restrictions in the object model can truly be enforced. Rewriting the Unicon compiler to directly emit i-code would enable us to do this. Also, adding capabilities to the i-code interpreter would be vastly easier if the interpreter were rewritten to be object aware at the i-code instruction level rather than implementing objects through Icon procedures compiled down to the traditional i-code instruction set.
The Unicon and Icon languages were designed so that writing a compiler is one of the things that the languages excel at.
Reference Materials:
A an introduction to writing in the Icon language can be found in the freely downloadable book The Icon Programming Language.
The standard documentation for using the Unicon language can be download from http://unicon.sourceforge.net
A book describing how the Icon language is implemented can be download from http://www.cs.arizona.edu/icon/
The Icon compiler can be downloaded from http://www.cs.arizona.edu/icon/
The Unicon compiler can be downloaded from http://unicon.sourceforge.net