From: (see below) on
On 23/02/2010 17:48, in article
4178548f-5618-49dd-ad72-008bdb53ed3b(a)z25g2000vbb.googlegroups.com, "Eric
Chomko" <pne.chomko(a)comcast.net> wrote:
> The thing about ALGOL parameter passing was that there was four ways
> to do it according to the ALGOL 60 spec.

No. Algol 60 had value parameters and name parameters only.

A name parameter was actually an anonymous function, re-evaluated at every
use within the procedure; or it could be a pair of such functions, one
member of the pair delivering an L value and the other one an R value.
These functions had to be generated by the compiler from the actual
parameter expression expressions.

The above refers to parameters of storable types; of course there were other
kinds of parameter such as switches, strings, procedures and (named)
functions to which the value/name distinction did not apply.

> As I recall from my Comp Sci
> days at U of MD, ALGOL used call by value, call by reference, call by
> value/result, and call by name. I'll tell you I still didn't
> understand why more than call by value and call by reference are
> needed. Anyway...

Algol W had value, result, value-result and name modes; but no reference
parameters; plus procedures and (named) functions.

Algol 68 arguably had only storable value parameters, but the value passed
could be of a reference type (this was quite well handled in Algol 68, but
soon degenerated into C's semantic sludge).

> Speaking of ALGOL parameter passing, what's a "thunk"?

A thunk is the anonymous function (pair) described above.

--
Bill Findlay
<surname><forename> chez blueyonder.co.uk


From: (see below) on
On 23/02/2010 17:52, in article
3ec03225-3a0f-4bcd-9db1-51201d1b3d53(a)w12g2000vbj.googlegroups.com, "Eric
Chomko" <pne.chomko(a)comcast.net> wrote:

> But an ALGOL "activation record" (stack frame) had a lot more than
> that. As I recall, they copied a lot more just pointers and parameter
> values.

Just the usual red tape: return address, frame pointer of caller; and either
a static pointer or some housekeeping for 'display' registers (if used) to
access non-locals. But bear in mind that in decent languages arrays are
storable values, so a value array parameter gets copied in toto, unlike C.

--
Bill Findlay
<surname><forename> chez blueyonder.co.uk


From: (see below) on
On 23/02/2010 17:57, in article
57442c25-2046-4193-879b-3ff71c0f1433(a)z25g2000vbb.googlegroups.com, "Eric
Chomko" <pne.chomko(a)comcast.net> wrote:

> On Feb 23, 7:39�am, "(see below)" <yaldni...(a)blueyonder.co.uk> wrote:
>> On 23/02/2010 09:39, in article
>> e59b10e9-83f7-4fb6-8ecf-a9d8fd13f...(a)v25g2000yqk.googlegroups.com,
>>
>> "Quadibloc" <jsav...(a)ecn.ab.ca> wrote:
>>> On Feb 22, 12:27 pm, rickman <gnu...(a)gmail.com> wrote:
>>
>>>> A hardware stack for C is a bit of a problem. C tends to need a
>>>> rather large stack because of the stack frames used.
>>
>>> What could happen, though, on a computer with a small hardware stack
>>> is that the compiler would use a software stack for things like
>>> subroutine calls (which must always work, no matter how deeply they
>>> are nested) and use the hardware stack for things it can control -
>>> such as the layers of parentheses in assignment statements.
>>
>>> That, for example, is presumably how one would go about writing a C
>>> compiler for a KDF 9.
>>
>> The way the Algol 60 compilers on KDF9 worked is well documented.
>> The Whetstone compiler generated its own Algol-oriented byte code, which is
>> very similar to the slightly later B6500 machine code.
>>
>> The Kidsgrove and EGDON compilers generated KDF9 machine code.
>> Managing the hardware stacks difficult, as it would have needed global data
>> flow and control flow analyses. The Kidsgrove compiler made a basic but not
>> very successful attempt at this.
>>
>> See <http://sw.ccs.bcs.org/KidsgroveAlgol/INDEX.HTM>.
>>
>
> I am more familiar with the Norway University version of ALGOL on a
> UNIVAC 1100 series machine. NU-ALGOL it was called.
>
> I sold a book called "ALGOL Implementation" based upon the Whetsone
> compiler on eBay about a decade ago. Got a pretty good price for it as
> well as I recall.

That was Randell & Russell's classic documentation of KDF9 Whetstone Algol.

It was used as a manual for the implementation of the Whetstone dialect of
Algol 60 on many other architectures, including the EE DEUCE, the Ferranti
Pegasus, the NPL ACE, the EE KDF6, the Soviet Minsk range, the EE System
4/50, the IBM System 360/25, the Phillips PRS8000, and the Indian ECIL
TDC-316.

There is a lot more information about Algol 60 and the KDF9 implementations
at <http://sw.ccs.bcs.org/CCs/KDF9/Wichmann/index.html>.

--
Bill Findlay
<surname><forename> chez blueyonder.co.uk


From: Charles Richmond on
(see below) wrote:
> On 23/02/2010 17:48, in article
> 4178548f-5618-49dd-ad72-008bdb53ed3b(a)z25g2000vbb.googlegroups.com, "Eric
> Chomko" <pne.chomko(a)comcast.net> wrote:
>
> [snip...] [snip...] [snip...]
>
>> Speaking of ALGOL parameter passing, what's a "thunk"?
>
> A thunk is the anonymous function (pair) described above.
>

A "thunk" was a method of implementing "call by name".

--
+----------------------------------------+
| Charles and Francis Richmond |
| |
| plano dot net at aquaporin4 dot com |
+----------------------------------------+
From: Charles Richmond on
Charles Richmond wrote:
> (see below) wrote:
>> On 23/02/2010 17:48, in article
>> 4178548f-5618-49dd-ad72-008bdb53ed3b(a)z25g2000vbb.googlegroups.com, "Eric
>> Chomko" <pne.chomko(a)comcast.net> wrote:
>>
>> [snip...] [snip...] [snip...]
>>
>>> Speaking of ALGOL parameter passing, what's a "thunk"?
>>
>> A thunk is the anonymous function (pair) described above.
>>
>
> A "thunk" was a method of implementing "call by name".
>

http://www.jargon.net/jargonfile/t/thunk.html

--
+----------------------------------------+
| Charles and Francis Richmond |
| |
| plano dot net at aquaporin4 dot com |
+----------------------------------------+