4.3.1 Overview

There are two ways of loading programs into Prolog—loading source files and loading pre-compiled PO files. Source files can be compiled into virtual machine code, as well as consulted for interpretation. Dynamic predicates are always stored in interpreted form, however.

Virtual machine code runs about 8 times faster than interpreted code, and requires less runtime storage. Compiled code is fully debuggable, except certain constructs compile in-line and cannot be traced.

The compiler operates in three different modes, controlled by the compiling Prolog flag. The possible states of the flag are:

compactcode
Compilation produces byte-coded abstract instructions. The default.
profiledcode
Compilation produces byte-coded abstract instructions instrumented to produce execution profiling data. See Execution Profiling. Profiling is not available in runtime systems.
debugcode
Compilation produces interpreted code, i.e. compiling is replaced by consulting.

This section contains references to the use of the module system. These can be ignored if the module system is not being used (see ref-mod for information on the module system).


Send feedback on this subject.