[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xdr programming/access from lisp

We are currently implementing a LISP program as a server to external
programs.  We plan to use XDR as the external data representation 
language for portability, standards, uniformity, etc.

Does anyone have any good ideas on how to go about this?

As you know, XDR data structures may be hierarchichally structured.
Similar to lists within lists in LISP.  In fact, I want to convert 
nested lists in LISP to hierarchical XDR data structures.  Well,
it is not simple to pass a lisp list and have C see it as a data structure
(linked list, perhaps).  However, I'm sure I can manage to send 
structures to C from LISP fairly directly.

At the same time I will also need to be able to read XDR nested data structures
from LISP.

I've been thinking about using a large string as a buffer of shared memory
(in effect) between LISP and C, and then have my C routines parse the data
into the appropriate structure (defeating some of the benefit of XDR).
But I do not have constraints on how large this buffer should be which 
means that I will have to have my C routines be smart enough to incrementally
construct the XDR data as it comes.  Similarly on the receiving end.
This starts to get complex very fast.

I could really use some good ideas on how to approach this problem.
It seems that my current soapbox with LISP is the inability to easily
pass data structures around in a heterogenous programming environment.
I certainly don't want to rewrite my LISP application in C (or C++).
Some parts of our overall system can be written directly in C (or C++)
but other parts we want to keep in LISP.


Joel Riedesel