kend@data.UUCP (Ken Dickey) (03/10/91)
peter@ficc.ferranti.com (Peter da Silva) writes: >In article <MARKF.91Mar6122504@montreux.ai.mit.edu> markf@zurich.ai.mit.edu writes: >> In article <R_V9_AC@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes: >> In fact, I don't see how a language that isn't interpreted nor object >> oriented could be said to have first class functions. >> Although it is true that most LISP (and Scheme) and purely functional >> language implementations have interpretors available, there is no >> dependency relation between that fact and the fact that they have >> first class functions. Nor are most of those languages "object >> oriented". >I suspect that if you remove the explicit interpreter and examined the >remaining language, I will still be able to point to a part of the >language and say "that's the interpreter!". That will be the part that >takes a closure and executes it. In Forth terms, Lisp has an outer and >an inner interpreter. I suspect if you take a C compiler apart, you will look at the stack and runtime services (e.g. malloc) and say: "that's the interpreter!". I suspect, however, that you can get most people to agree that there are compilers for C--and for Scheme. [On the other hand, it has been said that "Objects are a poor man's closures", so perhaps you should be making the argument that Scheme is object based. Closures are, of course, more general.] -Ken Dickey kend@data.uucp
peter@ficc.ferranti.com (Peter da Silva) (03/12/91)
In article <456@data.UUCP> kend@data.UUCP (Ken Dickey) writes: > I suspect if you take a C compiler apart, you will look at the stack > and runtime services (e.g. malloc) and say: "that's the interpreter!". Two problems here: a. That stuff isn't in the language definition (consider a non-hosted implementation). You can have C without malloc. You can't have Scheme without closures. b. Where do you get the jump table/lookup table/etc...? There's an interpreter in printf, and probably elsewhere, but not at the level of things like malloc. -- Peter da Silva. `-_-' peter@ferranti.com +1 713 274 5180. 'U` "Have you hugged your wolf today?"
kend@data.UUCP (Ken Dickey) (03/15/91)
Warning: comment recursion limit reached... markf@zurich.ai.mit.edu (Mark Friedman) writes: >In article <-K.9TE3@xds13.ferranti.com> peter@ficc.ferranti.com (Peter >da Silva) writes: > In article <MARKF.91Mar12151509@montreux.ai.mit.edu> > markf@zurich.ai.mit.edu writes: > > It is not necessary for the running of the procedure. One could > > in principle build a non-gc version of the system which did not > > require that information. > So the procedure is actually built dynamically at runtime? >Yes. But note that the code for the procedure is built once; only the >environment needs to be built at runtime, assuming that any >environment needs to be built at all (the compiler may determine that >some procedures don't need an environment). Note also that in the absence of first-class continuations (i.e. control jumps limited to catch/throw, setjump/longjump), you can always build such environments on the stack. -Ken Dickey kend@data.uucp