Overview

As outlined in int-hig, a constellation of new features greatly extends the relationship between Quintus Prolog code and foreign language code. It is now possible to embed Prolog code in a program written in another language without restrictions. Clearly, the first requirement for embedding Prolog code freely in foreign code is to be able to call Prolog from foreign code and vice versa. C calling Prolog is a major new feature of release 3 and is discussed in fli-ffp.

A further requirement is that all types of data structures can be passed between Prolog and the foreign code. Previously it was not possible to pass compound Prolog terms between Prolog and foreign code. In addition there were serious limitations on passing mathematical data. release 3 adds

With these new features, Quintus Prolog fulfills the full data passing requirement.

The foreign language interface is now fully bidirectional. This in itself is not sufficient for embeddability in a strong sense. The Prolog portions of the application must in addition be well-behaved. That is, they must not make any assumptions about how the operating system will handle such matters as memory and input/output operations. This is where the embedding layer of Quintus Prolog comes in.