[comp.lang.prolog] Suntools and Sicstus/Quintus Prolog

afzal@cui.unige.ch (Afzal Ballim) (08/07/89)

Hi, does anyone have code (or directions) for setting up an interface
between Sicstus/Quintus Prolog and Suntools? 

I want to be able to output and input to a Prolog program via various types of
window. However, due to the nature of Suntools a simple foreign language        interface won't suffice.


I presume that what is required is to set up an interprocess communication     
between Prolog and a C program to perform the actual window handling. However,
I have never tried this, and was wondering if anyone has experience (or even
code) for setting up such an interprocess communication.

Thanks in advance,

Afzal Ballim
University of Geneva
(afzal@divsun.unige.ch)

:

kono@csl.sony.co.jp (Shinji Kono) (08/10/89)

In article <185@cui.unige.ch>  , afzal@cui.unige.ch (Afzal Ballim)writes 
> Hi, does anyone have code (or directions) for setting up an interface
> between Sicstus/Quintus Prolog and Suntools? 

Quintus Prolog has a sample window library for Suntools. It uses
foregin libarary interface for C. It also works on sicstus prolog.

Generally it is not difficult to write simple interface to Window or
Socket in SICStus/Quintus. I wrote one general socket interface and a
window interface for GMW (Tateishi-Omron Japan's window system, nobody
knows :-).  One advantage of using prolog is this: you can use repeat
fail for dragging.
	?- get_newevent(X), drag_something(X), check_event(X).
	drag_something(X) :- write_something(X).
	drag_something(X) :- get_newevent(X1), erase_something(X),
		drag_something(X1).
This is very slow in interpreter, but reasonably fast in compiler. 

But these make Prolog really BIG, and using low window interface is
real pain. Real problem is high level interface design for various
window system.
--------
Shinji Kono 
$@2OLn??<#(J Sony Computer Science Laboratory, Inc.: kono@csl.sony.co.jp