next up previous contents
Next: Other Intermediate Languages Up: Beating the Interpretation Blues Previous: Hardware Solution:

Native Code Compilation:

The reasonable other alternative in order to avoid the overhead of emulating the WAM code is to generate directly machine language code from the compilation of Prolog programs. This is what usually goes under the name of Native Code Compilation, a feature that is quickly becoming part of the most widely used implementations of Prolog (e.g., Quintus and SICStus).

The two more sophisticated compilers performing native code compilation are Aquarius [90] and Parma [107, 106]. Both the compilers translates Prolog to an intermediate code--expressed in a language whose level is considerably lower than WAM. In the case of Parma the intermediate code is expressed in a quite standard 3-address code; in the case of Aquarius the intermediate code (BAM code) is based on a simple language (based on load-store instructions, tagged addressing modes, pragmasgif, and some Prolog-specific instructions to manipulate unification, trail, dereferencing, environments, and choice-points).

In both cases the intermediate code is translated into machine code (MIPS for Parma, SPARC for Aquarius). Native code compilation has been proven to be most effective way to produce efficient executions of Prolog, especially if coupled with the use of sophisticate static analysis techniques.

Web Tour

Tue Mar 19 14:37:09 MST 1996