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
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
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.
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.
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.