Article View: comp.lang.misc
Article #6991Re: GNU Script isn't fixing something that's broken, so is doomed
From: Mark Friedman
Date: Tue, 15 Nov 1994 19:49
Date: Tue, 15 Nov 1994 19:49
87 lines
4375 bytes
4375 bytes
In article <JANSSEN.94Nov9184617@holmes.PARC.Xerox.Com>
janssen@parc.xerox.com (Bill Janssen) writes:
In article <BOBO.94Nov9112502@avogadro.arc.nasa.gov>
bobo@avogadro.arc.nasa.gov (Mark Friedman) writes:
Essentially, we need a free version of an Open Doc / OLE
/ Corba kind of thing. ILU is one such beast (see
ftp://parcftp.parc.xerox.com/pub/ilu/1.6.4/announce.html). I think it
has some problems (e.g. no support for first class procedures) but it
would be one place to start.
Mark and I have discussed the lack of first class procedures in ILU a
bit. It might be interesting syntactic sugar, but all functionality
it would provide is already provided via the normal ILU object system.
I hate to get into one of these he said / she said discussions, but I
certainly do not agree that ILU supports first class procedures.
I guess it comes down to what one believes "first class procedures"
means. To me it means (in the context of something like ILU) that you
could pass a procedure P-CA (as defined in the calling language CA) to a
procedure P-CE implemented in the callee language CE and have P-CE be
able to call P-CA using the native calling mechanism of CE. For
example I'd like to be able to do something like the following using C
and Lisp as examples of P-CE and P-CA respectively (using a made up
ILU-like language):
foo.c:
TYPE Proc1 = PROC (INT) RETURNS INT;
DECLARE foo (INT, Proc1) RETURNS INT;
int foo (my_int, lisp_proc)
int my_int;
int *lisp_proc();
{
lisp_proc(my_int);
}
bar.lisp
(ilu-declare-type proc1 (int) int)
(ilu-declare foo (int proc1) int)
(defun lisp-proc (my-int)
(whatever my-int))
(foo #'lisp-proc)
I don't believe that ILU can support this kind of use. As Bill
mentioned to me, it can't be done by an portable implementation coded
entirely in C. You need to be able to create the C lisp_proc at
runtime and C has no capability for that. You need a little assembly
language procedure (or call your C compiler at run time and
dynamically load some code) to build it.
The reason that I want this is so that I can pass arbitrary Lisp
callbacks to C functions whose source code I have no access to. The
callback has to just look like a C function.
We are considering describing a possible ILU "cliche", such as
TYPE CallbackProc1 = OBJECT SUPERTYPES ilu.FirstClassProc END
METHODS
Invoke ( (* args here *) )
END;
The problem that I have with this approach is that I have to do my own
bookeeping on the Lisp side. I only have a single function
(i.e. Invoke) which all the C functions use as their callback
function. It's up to Invoke on the Lisp side to figure out which Lisp
procedure I really wanted to call.
This might work if the C function passes enough information to
determine where the callback was called from, but in general it might
not do that.
-Mark
--
Mark Friedman
NASA-Ames Research Center
MS 269-2
Moffett Field, CA 94035-1000
vmail: (415) 604-0573
email: bobo@ptolemy.arc.nasa.gov
Technical Details
Message-ID:
<BOBO.94Nov15114920@avogadro.arc.nasa.gov>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!news.ege.edu.tr!news.metu.edu.tr!mother.usf.edu!darwin.sura.net!news.larc.nasa.gov!ames!kronos.arc.nasa.gov!usenetReferences:
<BOBO.94Nov1113037@avogadro.arc.nasa.gov> <3983d9$5cv@ra.nrl.navy.mil> <398a1a$1qc@csnews.cs.Colorado.EDU> <ABRAHAM.94Nov2214108@micro.iesd.auc.dk> <39ojsl$r8k@csnews.cs.Colorado.EDU> <BOBO.94Nov9112502@avogadro.arc.nasa.gov> <JANSSEN.94Nov9184617@holmes.PARC.Xerox.Com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f891f,9bda08f2f068881f X-Google-Attributes: gidf891f,public X-Google-Thread: 1025b4,9bda08f2f068881f X-Google-Attributes: gid1025b4,public X-Google-ArrivalTime: 1994-11-17 18:06:39 PST Newsgroups: comp.lang.misc,gnu.misc.discuss Path: arc1-ca.pugleaf.net!nntp.gmd.de!news.ege.edu.tr!news.metu.edu.tr!mother.usf.edu!darwin.sura.net!news.larc.nasa.gov!ames!kronos.arc.nasa.gov!usenet From: bobo@avogadro.arc.nasa.gov (Mark Friedman) Subject: Re: GNU Script isn't fixing something that's broken, so is doomed In-Reply-To: janssen@parc.xerox.com's message of 10 Nov 1994 02:46:17 GMT Message-ID: <BOBO.94Nov15114920@avogadro.arc.nasa.gov> Lines: 87 Sender: usenet@ptolemy-ethernet.arc.nasa.gov (usenet@ptolemy.arc.nasa.gov) Nntp-Posting-Host: avogadro.arc.nasa.gov Reply-To: bobo@ptolemy.arc.nasa.gov Organization: NASA/Ames Information Sciences References: <BOBO.94Nov1113037@avogadro.arc.nasa.gov> <3983d9$5cv@ra.nrl.navy.mil> <398a1a$1qc@csnews.cs.Colorado.EDU> <ABRAHAM.94Nov2214108@micro.iesd.auc.dk> <39ojsl$r8k@csnews.cs.Colorado.EDU> <BOBO.94Nov9112502@avogadro.arc.nasa.gov> <JANSSEN.94Nov9184617@holmes.PARC.Xerox.Com> Date: Tue, 15 Nov 1994 19:49:20 GMT