Subject: Re: copying a vector? (Stalin 0.9?)
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 6 Jan 2001 10:51:12 GMT
Newsgroups: comp.lang.scheme
Message-ID: <936tb0$m10oq$1@fido.engr.sgi.com>
Hartmann Schaffer <hs@paradise.nirvananet> wrote:
+---------------
| Rob Warnock <rpw3@rigden.engr.sgi.com> wrote:
| >Well, the ALGOL-10 compiler for the DEC PDP-10 (~1970) used thunks
| 
| did they call it algol-10?  from your descrption it sonds like algol60
+---------------

Yes, it was an Algol60. The "-10" suffix stood for "PDP-10",
not the language version: FORTRAN-10, MACRO-10, ALGOL-10, etc.

+---------------
| >may have it slightly wrong), those thunks weren't "on the stack",
| >nor were they "activation records" -- they were fixed code fragments
| >whose addresses were passed as arguments.
| 
| they must have been closure, because they had to be evaluated in the
| environment that passed them to the callee
+---------------

Again, some of this is a bit vague, but if I'm remembering correctly,
in Algol60, procedures weren't first-class values. You could pass one as
an argument but couldn't return one as a value (a closure). So lexical
variables could *always* be allocated on the stack (even if mutated),
and thus argument thunks only had to look one level up in the dynamic
environment (using the frame link) to access lexicals anywhere in the
caller.

Yes, that implies that simply passing an arg through to a sub-subroutine
would have required another pair of "wrapper" thunks to access the
original arg's thunks, but I suspect that's how they did it, since
you need that anyway to pass more general expressions, and it wasn't
a particularly optimizing compiler. (Generated pretty dumb code,
actually, except for stuff like using Iliffe vectors for array
access, which let you do multi-dimensional array subscripting
with a single PDP-10 instruction! But that's another story...)


-Rob

-----
Rob Warnock, 31-2-510		rpw3@sgi.com
SGI Network Engineering		http://reality.sgi.com/rpw3/
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA