comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: Shared Generic Instance Code
Date: 1997/04/05
Date: 1997-04-05T00:00:00+00:00	[thread overview]
Message-ID: <01bc4216$205fe340$43f882c1@xhv46.dial.pipex.com> (raw)
In-Reply-To: E8585p.AE7@world.std.com




Robert A Duff <bobduff@world.std.com> wrote in article
<E8585p.AE7@world.std.com>...
> In article <01bc4155$221728e0$2dfb82c1@xhv46.dial.pipex.com>,
> Nick Roberts <Nick.Roberts@dial.pipex.com> wrote:
> >Don't get confused between 'thunking' and mere indirect jumping/calling.
A
> >thunk is where a direct jump/call vector is replaced at runtime (and is
> >thus a one-time thing per execution).
> 
> I don't think that's right.  I once spoke with Mike Woodger about this
> (around 1992 or so).  He was involved in the original Algol 60, and I
> think that's where the term "thunk" originated.  
[etc.]


Fascinating, Captain. Here's what I find in Craig Servin's hacker guide
(usually pretty authoritative) ...

<<<

thunk

/thuhnk/ n.



1. "A piece of coding which provides an address", according to P. Z.
Ingerman, who invented thunks in 1961 as a way of binding actual parameters
to their formal definitions in Algol-60 procedure calls. If a procedure is
called with an expression in the place of a formal parameter, the compiler
generates a thunk to compute the expression and leave the address of the
result in some standard location. 

2. Later generalized into: an expression, frozen together with its
environment, for later evaluation if and when needed (similar to what in
techspeak is called a `closure'). The process of unfreezing these thunks is
called `forcing'. 

3. A stubroutine, in an overlay programming environment, that loads and
jumps to the correct overlay. Compare trampoline. 

4. People and activities scheduled in a thunklike manner. "It occurred to
me the other day that I am rather accurately modeled by a thunk --- I
frequently need to be forced to completion." --- paraphrased from a plan
file. Historical note: There are a couple of onomatopoeic myths circulating
about the origin of this term. The most common is that it is the sound made
by data hitting the stack; another holds that the sound is that of the data
hitting an accumulator. Yet another holds that it is the sound of the
expression being unfrozen at argument-evaluation time. In fact, according
to the inventors, it was coined after they realized (in the wee hours after
hours of discussion) that the type of an argument in Algol-60 could be
figured out in advance with a little compile-time thought, simplifying the
evaluation machinery. In other words, it had `already been thought of';
thus it was christened a `thunk', which is "the past tense of `think' at
two in the morning". 


>>>

So, I knew of the latter meaning (no 2), and you of the earlier one (no 1).
We _were_ both right!

And yes, a little bit of history/culture/whatever is interesting, without
taking it _too_ seriously, perhaps!

Nick.





  reply	other threads:[~1997-04-05  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-01  0:00 Shared Generic Instance Code david scott gibson
1997-04-01  0:00 ` Joel VanLaven
1997-04-01  0:00   ` Robert A Duff
1997-04-02  0:00     ` Robert Dewar
1997-04-02  0:00       ` Robert A Duff
1997-04-02  0:00   ` Robert Dewar
1997-04-02  0:00     ` Robert A Duff
1997-04-01  0:00 ` Pat Rogers
1997-04-01  0:00 ` Robert A Duff
1997-04-02  0:00   ` Robert Dewar
1997-04-05  0:00   ` Nick Roberts
1997-04-05  0:00     ` Robert A Duff
1997-04-05  0:00       ` Nick Roberts [this message]
1997-04-06  0:00       ` Robert Dewar
1997-04-02  0:00 ` Jon S Anthony
1997-04-02  0:00   ` Robert A Duff
1997-04-03  0:00   ` Robert Dewar
1997-04-03  0:00 ` Corey Minyard
1997-04-03  0:00 ` Bill Keen
1997-04-03  0:00   ` Robert Dewar
1997-04-04  0:00     ` Fergus Henderson
1997-04-04  0:00       ` Robert Dewar
1997-04-04  0:00   ` Robert A Duff
1997-04-03  0:00 ` Jon S Anthony
1997-04-03  0:00   ` Robert Dewar
1997-04-04  0:00 ` Bill Keen
1997-04-04  0:00   ` Robert Dewar
1997-04-05  0:00     ` Tom Moran
1997-04-06  0:00       ` Nick Roberts
1997-04-07  0:00       ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox