Path: utzoo!attcan!uunet!husc6!think!snorkelwacker!apple!netcom!schang From: schang@netcom.UUCP (Sehyo Chang) Newsgroups: comp.lang.smalltalk Subject: Re: Anyway to run a program directly from smalltalk? Message-ID: <7709@netcom.UUCP> Date: 22 Feb 90 17:01:10 GMT References: <19566@mephisto.UUCP> Distribution: na Organization: NetCom- The Bay Area's Public Access Unix System {408 249-0290 guest} Lines: 37 In article <19566@mephisto.UUCP> hsu@boa.gatech.edu (Yung-Kao Hsu) writes: > >I do not browse thru this group often thus the question I asked >might quite well be discussed before. > >I've been working on implementing an environment which requires >an interaction between smalltalk and prolog (on Sun workstation). >The communication between the two is thru the use of socket which >comes with ParcPlace System with a C program acts as an agent. >However, the establishing of the comunication link between the >process and Socket are extremely slow and very often freezes >the system for about 3 minutes just for it. Furthermore, one have >to always remember to run the agent beforehand. > >The problem could be greatly reduced if somehow I could build >an object that could run a "prolog" or any other process directly >by sending a message to it. Has anyone here known of such thing? > >---- Thre are 3 possible solution to this problem: (1) write class called 'prolog' or something that will manage all i/o interface to the rest of smalltalk. It will use 'execv' call to automatically invoke prolog agent if necessary. (2) write prolog in smalltalk which is not too big of deal unless you intent to large amount of inferencing or need to talk to prolog machine (3) if you have source code prolog(such as C-prolog), you might "embedded" prolog with smalltalk virtual machine(this is only for ParcPlace smalltalk). Also, unix socket mechanism is very efficent and shouldn't take 3 minutes, unless you are doing some kind of synchrous communication. You might want to fork off prolog-communication as lower prority process and try to do asynchrous communication much as possible which might yield better performance -- Sehyo Chang schang@netcom.uucp Ascent Logic Corp. (408)943-0630