Stand-Alone Programs

A stand-alone Prolog program is a single, standard, executable file that can be considered to be an extended version of the Development System, with your Prolog and foreign code being pre-loaded into it. This approach has several advantages as compared with the saved-state approach:

  1. Since a stand-alone program is a standard executable file, you can use standard source-level debugging tools such as gdb(1) to debug your foreign code at the source level.
  2. Standard tools such as make(1) can be easily used to construct your program, ensuring that everything is up-to-date. This is particularly useful if you are using a lot of foreign code.
  3. Startup is faster.
  4. Your code (except for dynamic predicates) will be loaded into the text segment, so that it will be shared if the program is to be run by more than one process at a time on a single machine.
  5. Different application programs can share compiled files. The format of compiled files, "Quintus Object Format" or QOF, is portable across a number of different hardware types and operating systems.

The disadvantage of linking, in comparison with using a saved state, is that the stand-alone program will require more disk space than a saved state, since it contains the Development Kernel and the user's foreign code.