Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!usc!cs.utexas.edu!uunet!mcvax!hp4nl!swivax!anjo From: anjo@swivax.UUCP (Anjo Anjewierden) Newsgroups: comp.lang.prolog Subject: Re: A question about Quintus and external lang interfaces Keywords: Quintus, external language interfaces Message-ID: <1443@swisun.swivax.UUCP> Date: 30 Jun 89 09:40:37 GMT References: Reply-To: anjo@swisun10.UUCP (Anjo Anjewierden) Organization: SWI, UvA, Amsterdam Lines: 24 russo@caip.rutgers.edu (Mark F. Russo) writes: > >I have a question about Quintus Prolog and the latest functionality of >the external language interface. I know that you can install a C >function as a predicate call in a Quintus Prolog program. My question >is, can you then make a query back into the prolog database from that >external C function. This is currently possible using BIM_Prolog. Your observations are correct. Not being able to call Prolog goals from an external language (e.g. C) is one of the few things missing in Quintus Prolog. The only solution until Quintus provides this feature is to write a small interpreter that eats Prolog goals in small pieces (atoms, integers and floats) and reconstructs the goal in Prolog itself. We actually use this method, although it remains a kludge. We previously used the IPC method, but performance then becomes unpredictable (on Sun workstations) because of swapping. >Are there any other prologs with which this can be done? BIM_Prolog as you mentioned. SWI-Prolog (contact jan@swivax.uucp) provides a collection of C functions to construct and call goals from C in a fashion similar to BIM_Prolog. -- Anjo.