Compiling code for the Icon programming language presents several challenges, particularly in dealing with types and goal‐directed expression evaluation. In order to produce optimized code, it is necessary for the compiler to know much more about operations than is necessary for the compilation of most programming languages. This paper describes the organization of the Icon compiler and the way it acquires and maintains information about operations. The Icon compiler generates C code, which makes it portable to a wide variety of platforms and also allows the use of existing C compilers for performing routine optimizations on the final code. A specially designed implementation language, which is a superset of C, is used for writing Icon's run‐time system. This language allows the inclusion of information about the abstract semantics of Icon operations and their type‐checking and conversion requirements. A translator converts code written in the run‐time language to C code to provide an object library for linking with the code produced by the Icon compiler. The translation process also automatically produces a database that contains the information the Icon compiler needs to generate and optimize code. This approach allows easy extension of Icon's computational repertoire, alternate computational extensions, and cross compilation.
[1]
Ralph E. Griswold,et al.
The Icon programming language
,
1983
.
[2]
Robert B. K. Dewar,et al.
Macro SPITBOL—a SNOBOL4 compiler
,
1977,
Softw. Pract. Exp..
[3]
Peter Van Roy,et al.
Can Logic Programming Execute as Fast as Imperative Programming?
,
1990
.
[4]
Ralph E. Griswold,et al.
The implementation of generators and goal‐directed evaluation in icon
,
1983,
Softw. Pract. Exp..
[5]
Ralph E. Griswold,et al.
The implementation of the Icon programming language
,
1986
.
[6]
Andrew W. Appel,et al.
Compiling with Continuations
,
1991
.