python <-> lisp process communication

lisp

    Next

  • 1. Get Text from current line
    Hi, i would like to write some code in emacs-lisp to format/align the current line in a spec. way each time the editor jumps to the next/other line. i.e. when i type: abc xyz kfx uzr ert : ert : oiu the editor should format it the moment i type enter or nextline (arrow down) this way: abc xyz kfx uzr ert : ert : oiu and so on.... How can i realize this? Pls give me a hint, dont how to start !? Thanks
  • 2. Ahahahahahahahahahahaaaaaaaa
    In SLIME, under help, Emacs Psychiatrist! Ahahahahahahahahahahaaaaaaaa. Talk about "getting help"! Sorry, but as a newbie, it's way too funny!
  • 3. CL Performance/Syntax of IF-THEN-ELSE
    If you need to do more than one thing in the THEN and ELSE portions of the IF-THEN-ELSE (i.e. procedural with side-effects), what are the approaches that can be used in CommonLisp to evaluate multiple statements? For example, using (list ...) works but I'm curious if there is a more conventional/accepted/common or better performance way of doing it? (defun RELEASER () (if (= (length EXT:*ARGS*) 0) (list (format t "~%~A~%" "Nope, No Command Line Args Were Provided") (show-usage) (return-from RELEASER)) (list (format t "~%~A~%" "Yep, We've Got Command Line Args") (format t "~%~A~%" "Processing Args...")) ; more stuff... )) I looked for a treatment of this in "Practical Common Lisp" (Peter Seibel) and "Successful Lisp" (David Lamkins) but found nothing. Thanks, JCR

python <-> lisp process communication

Postby Mate Toth » Mon, 07 Apr 2008 01:00:07 GMT

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

Re: python <-> lisp process communication

Postby Jeff » Mon, 07 Apr 2008 02:14:07 GMT

ECL lisp, which provides a shared library, and Python ctypes.

Re: python <-> lisp process communication

Postby karsten » Mon, 07 Apr 2008 03:24:36 GMT


I'd propose communication via plain sockets. In  http://www.**--****.com/ 
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

Re: python <-> lisp process communication

Postby Alex Mizrahi » Mon, 07 Apr 2008 04:14:57 GMT

 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://www.**--****.com/ 

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. 



Re: python <-> lisp process communication

Postby Jeff » Mon, 07 Apr 2008 06:43:00 GMT

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.

Re: python <-> lisp process communication

Postby Vagif Verdi » Mon, 07 Apr 2008 07:47:55 GMT

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.

Re: python <-> lisp process communication

Postby Mate Toth » Tue, 08 Apr 2008 04:49:34 GMT

Thanks for the answers!!

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

Mate



Return to lisp

 

Who is online

Users browsing this forum: No registered users and 27 guest