Discussion:
multiple Lisp images
Yakov Zaytsev
2011-04-27 14:23:50 UTC
Permalink
Hello, all

I again have a scenario as follows. Say, you have an enterprise-y or
CAD-y application. From one side, you extend it in Lisp. Be it a
plugin (i.e. LISPWORKS:DELIVER with :DLL-EXPORTS) or standalone Lisp
process which communicates with the application via some provided SDK
APIs; these two cases do not actually differ for us.
From the other side, you have your own fat Lisp application which you
want to communicate with the plugin. Example: NPAPI plugin provides
data for later processing by big Lisp.
Here is a problem arises. How to pass sexps as transparently between
the two Lisps as possible? Yeah, I programmed in Erlang for some time.
Basically, I want that kind of "transparency", though I don't thing
that it definitely must be message passing between quasi-processes..
There are might be some variations but I guess you got the idea
Vsevolod Dyomkin
2011-04-27 14:53:17 UTC
Permalink
Hi,

did you consider using swank protocol?

Vsevolod
Post by Yakov Zaytsev
Hello, all
I again have a scenario as follows. Say, you have an enterprise-y or
CAD-y application. From one side, you extend it in Lisp. Be it a
plugin (i.e. LISPWORKS:DELIVER with :DLL-EXPORTS) or standalone Lisp
process which communicates with the application via some provided SDK
APIs; these two cases do not actually differ for us.
From the other side, you have your own fat Lisp application which you
want to communicate with the plugin. Example: NPAPI plugin provides
data for later processing by big Lisp.
Here is a problem arises. How to pass sexps as transparently between
the two Lisps as possible? Yeah, I programmed in Erlang for some time.
Basically, I want that kind of "transparency", though I don't thing
that it definitely must be message passing between quasi-processes..
There are might be some variations but I guess you got the idea
_______________________________________________
pro mailing list
http://common-lisp.net/cgi-bin/mailman/listinfo/pro
William Halliburton
2011-04-27 15:07:43 UTC
Permalink
How to pass sexps as transparently between the two Lisps as possible?
Can you please elaborate on "transparently"?

The first thing out of my toolbox when I need to simply get some data
between lisps is just:

(send
(print1 payload)
other-server)

using whatever mechanism.

and then

(let ((*print-eval* nil)) (read-from-string payload))
Scott L. Burson
2011-04-27 18:35:24 UTC
Permalink
One caveat, if you're going to do this kind of thing: be sure to bind
all the variables that control the printer (on the sending end) and
reader (on the receiving end) -- *package*, *print-base*, *read-base*,
etc.

Years ago I was working on a project on the Lisp Machines that
involved creating a package that did not use the lisp: package
(basically, I was implementing another language that had its own names
for things). I discovered that when I was editing a file in this
package, and tried to access the file server, I would get mysterious
errors deep in the code that implemented the NFILE protocol. As it
turned out, ZMacs was binding *package* to the package of the file I
was editing, and the NFILE client implementation was reading an sexp
sent by the server without binding *package*, so that occurrences of
"NIL" in that sexp were not being read as lisp:nil ("the chosen nil",
as Bernie Greenberg used to call it).

Discovering that bug left me with a permanent dislike and distrust of
special variables. I still use them occasionally, but I try to keep
them to a bare minimum.

-- Scott

On Wed, Apr 27, 2011 at 8:07 AM, William Halliburton
Post by William Halliburton
 How to pass sexps as transparently between the two Lisps as possible?
Can you please elaborate on "transparently"?
The first thing out of my toolbox when I need to simply get some data
  (send
     (print1 payload)
     other-server)
using whatever mechanism.
and then
  (let ((*print-eval* nil)) (read-from-string payload))
_______________________________________________
pro mailing list
http://common-lisp.net/cgi-bin/mailman/listinfo/pro
Nikodemus Siivola
2011-04-27 20:05:39 UTC
Permalink
Post by Scott L. Burson
One caveat, if you're going to do this kind of thing: be sure to bind
all the variables that control the printer (on the sending end) and
reader (on the receiving end) -- *package*, *print-base*, *read-base*,
etc.
WITH-STANDARD-IO-SYNTAX is your friend there.

Cheers,

-- Nikodemus

Loading...