Related articles |
---|
Q: Intermediate code for interpreting & compiling? davis@wln.com (1995-02-10) |
Re: Q: Intermediate code for interpreting & compiling? torbenm@diku.dk (1995-02-14) |
Re: Q: Intermediate code for interpreting & compiling? cef@geodesic.com (Charles Fiterman) (1995-02-14) |
Re: Q: Intermediate code for interpreting & compiling? danhicks@aol.com (1995-02-22) |
Re: Q: Intermediate code for interpreting & compiling? Dave@occl-cam.demon.co.uk (Dave Lloyd) (1995-02-24) |
Re: Q: Intermediate code for interpreting & compiling? zmola@cicero.spc.uchicago.edu (1995-02-24) |
Re: Q: Intermediate code for interpreting & compiling? davidm@Rational.COM (1995-02-28) |
Re: Q: Intermediate code for interpreting & compiling? anton@mips.complang.tuwien.ac.at (1995-03-01) |
Re: discussion of thunks chase@centerline.com (1995-03-03) |
Newsgroups: | comp.compilers |
From: | Dave Lloyd <Dave@occl-cam.demon.co.uk> |
Keywords: | code, design, comment |
Organization: | Compilers Central |
Date: | Fri, 24 Feb 1995 13:31:45 GMT |
After an article by Dan Hicks, our moderator wrote...
> [Hey, lots of languages have thunks. But now we call them function pointers.
> -John]
Sorry, but I beg to differ. A function pointer is *not* a thunk. The
term `thunk' dates to an early ALGOL60 compiler (memory fails me, but I
think it was the Whetstone compiler) and refers to a compiler-generated
intermediate routine (Jensen's device used for call-by-name carrying any
necessary OWN context). Other compilers since have used thunks for
partial parameterisation of procedures (like slicing an array), closures
of delivered routines and calls to external routines. OS/2 uses the term
for the wrapping that lets 32-bit code call 16-bit code. On the other
hand a `function pointer' is a bastard of C meaning no more than a
procedure as a data object - the `pointer' is redundant.
Regards,
----------------------------------------------------------------------
Dave Lloyd Email: Dave@occl-cam.demon.co.uk
Oxford and Cambridge Compilers Ltd Phone: (44) 223 572074
55 Brampton Rd, Cambridge CB1 3HJ, UK
[You can certainly implement the effect of thunks using function pointers. By
the way, did you know that the original impetus for thunks, Algol60 call by
name, was a mistake? It was supposed to be call by reference. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.