From: Mate Toth
Subject: python <-> lisp process communication
Date: 
Message-ID: <72b5d673-4f2f-4e2c-a1b5-329a86e08c0a@n14g2000pri.googlegroups.com>
Hi!

I would do an application that has a python side and a lisp side and
they should communicate through text-messages(for me to know what it
is :)).

I googled soap and corba. I don't know how to use either but corba
seems too big for me, and if I'm at soap I would use a webserver
without soap(am I right?).

I ask that how would you do this kind of stuff. :)

Mate

From: Jeff
Subject: Re: python <-> lisp process communication
Date: 
Message-ID: <472e7b12-a7de-43a2-ae3d-5a34e8c0becf@m73g2000hsh.googlegroups.com>
ECL lisp, which provides a shared library, and Python ctypes.
From: karsten
Subject: Re: python <-> lisp process communication
Date: 
Message-ID: <43854ad3-8dad-41f9-b4a3-8824ad32189e@p39g2000prm.googlegroups.com>
On Apr 5, 6:00 pm, Mate Toth <·······@gmail.com> wrote:
> Hi!
>
> I would do an application that has a python side and a lisp side and
> they should communicate through text-messages(for me to know what it
> is :)).
>
I'd propose communication via plain sockets. In http://homepage.mac.com/svc/s-sysdeps/
you should find a portable library for the lisp side of this.
You could either invent your own protocol or go talk xml (http://
en.wikipedia.org/wiki/JSON-RPC or xml-rpc) or do full blown
webservices.

salud2

Karsten
From: Vagif Verdi
Subject: Re: python <-> lisp process communication
Date: 
Message-ID: <edbe9d32-c8ef-41ff-9deb-62f5ffd191df@g1g2000pra.googlegroups.com>
For lisp side i suggest to use hunchentoot web server and json library
to exchange information with python.
That's how i do it to exchange information with windows executable,
written in delphi.
From: Mate Toth
Subject: Re: python <-> lisp process communication
Date: 
Message-ID: <56c55554-a5e1-485d-b83d-13dea1cf539a@d2g2000pra.googlegroups.com>
Thanks for the answers!!

JSON seems for me the easiest so I will try it that way. Later maybe a
more sophisticated.

Mate
From: Alex Mizrahi
Subject: Re: python <-> lisp process communication
Date: 
Message-ID: <47f7cfb3$0$90274$14726298@news.sunsite.dk>
 MT> I googled soap and corba. I don't know how to use either but corba
 MT> seems too big for me, and if I'm at soap I would use a webserver
 MT> without soap(am I right?).

SOAP is bloated. XML-RPC is fine.

XML-RPC normally uses HTTP, so it needs sort of webserver on server side --  
but that is actually pretty simple thing,
it just listens on some port and serves requests.
there are libraries that implement this -- you don't need to configures 
stuff.

for Common Lisp, there is s-xml-rpc: 
http://common-lisp.net/project/s-xml-rpc/

on client side, it looks like this:

? (xml-rpc-call (encode-xml-rpc-call "examples.getStateName" 41) :host 
"betty.userland.com")
"South Dakota"

on server side, you define functions in packages XML-RPC-EXPORTS  and then 
start server

? (start-xml-rpc-server :port 8080)

then you can call these functions remotely.
there are other libs too, if this doesn't suit you for some reason..

 MT> I would do an application that has a python side and a lisp side and
 MT> they should communicate through text-messages

this depends on requirements.. XML-RPC provides quite neat interface and is 
widely supported, but it's not top-performance approach.
if you need to exchange lots of text messages, it might be better to 
implement custom communications via sockets, that's not that hard.
e.g. send text line by line and read via read-line -- that's just few lines 
of code. 
From: Jeff
Subject: Re: python <-> lisp process communication
Date: 
Message-ID: <cd919dc9-32e4-41b4-a306-f10476b77e33@c65g2000hsa.googlegroups.com>
With ECL and ctypes you can write a lisp application or library, then
load it and control it through Python, just as you would extend Python
with a C-based module.  In fact, you should also be able to load
Python in ECL as a library as well (as you would embed Python in a C
application).

ECL has extensive type conversion functionality built in.