Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!ai-lab!life!cstacy From: cstacy@ai.mit.edu (Christopher C. Stacy) Newsgroups: comp.lang.lisp Subject: Re: call C proceudre from Lisp Message-ID: Date: 26 Apr 91 04:57:09 GMT References: Sender: news@ai.mit.edu Distribution: comp.lang.lisp Organization: random Lines: 41 In-reply-to: pierson@encore.com's message of 25 Apr 91 14:50:32 GMT Under Symbolics Genera you can make transparent function calls to foreign languages such as "C" through the Remote Procedure Call (RPC) facility. The calls are made across a network, but the programmer doesn't need to worry about programming the network. The extensible call description language (a bunch of Lisp macros) takes care of writing the function stubs (eg., in C and/or LISP), and (in conjunction with the underlying RPC/XDR implementations) automatically converting the foreign data types, errors, and so forth. I don't think this is exactly like what you were wondering about: you sounded like you were thinking of simpler, single-process environment where you would link multiple foreign programs together. The Symbolics implementation is oriented more towards multiprocessing, and was developed primarily for embedded co-processor systems. On the Symbolics, the network could just be a shared-memory interface (this is how it's done in MacIvory - our embedded Macintosh system), or it could be a conventional network such as UDP/IP. As I mentioned, the programmer doesn't really worry much about this though. What do people think of the idea of using such high-level description languages to foreign function calls? What do you think of RPC/XDR in this kind of context (especially you C hackers out there)? It seems to me like this kind of transparent interface might be a general solution to the cross-language problem. Clearly some sort of protocol is needed, RPC/XDR being the popular (?) standard with a relatively (!) nice interface. You certainly don't want programmers to have to deal separately with the idiosyncratic storage conventions and related miscellaneous semantics of all the different languages and implementations that they want to talk with. The main issue with RPC/XDR in particular, is efficiency. I guess that (theoretically) it should be possible for such a system to be smarter about the packing and transport implementations - at compile time, maybe at run time, maybe with declarations from the programmer. The calls implementation in a given situation could wind up being more like dynamic linking. A high-level cross-language calling protocol would allow source code portability, and leave system implementors free to make things as efficient as they want and avoids trying to invent agreements about low-level repreesntation conventions on all machines.