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 inline and cannot be traced. Compiled code also provides better precision for execution profiling and coverage analysis.

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

Compilation produces byte-coded abstract instructions. The default.
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.