This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Process communication with Guile



; The problems I am interested in (solving of partial differential
; equations) usually can be decomposed in such a way that a rather small
; set of basic operations operating on large amounts of data are
; combined to more complicated constructs.  This seems to be a perfect
; place for using Guile as control language.  But since the interpreter
; is quite large I would prefer to do it in such a way, that Guile is
; sort of a client process to a server process written in C or C++ which
; does the hard work.  This construction would also allow to execute the
; client and server on different machines which might be very useful.

You might be just as happy linking the interpreter in to control your
C code.  But anyway, it would make sense to execute them on separate
machines.  (At the risk of being ostracized, I might suggest you look
at yorick, a language designed for preprocessing numerical stuff).

; Therefore, the basic operation I need is communication between two
; processes in one of the following ways:
; 
;   1) A Guile client process connects to an (already running) server
;      process, sends messages and receives answers.
; 
;   2) A Guile process starts the "server" process and communicates
;      with it.
; 
; My problem is that I don't know much about process communication
; (even in C), and I don't know how to do the above task in the easiest
; way.  Should I try sockets (how does one handle that from Guile?) or
; is it better to use pipes (how to do this?)?  I would think that this
; sort of problem is quite basic, and that there are references or even
; sample programs doing this sort of thing.  Can anyone point out a
; reference to me?

Sockets and pipes are going to be a bit clumsy, but maybe the way to
go.  It's worth looking at the package greg (referred to from the
guile site), which has features for doing this sort of thing. It's
designed for regression testing.  Look at
http://www.tiptree.demon.co.uk/gstep/guile/gregdoc-toc.html 

Good luck --- and tell us what you end up doing. 

Andrew