Re: Jensen's device

"Uday S. Reddy" <u-reddy@cs.uiuc.edu>
30 Mar 1998 21:47:51 -0500

          From comp.compilers

Related articles
[2 earlier articles]
Re: Jensen's device wclodius@aol.com (1998-03-24)
Re: Jensen's device scott@basis.com (1998-03-24)
Re: Jensen's device jsm@it.dtu.dk (JørgenSteensgaard) (1998-03-24)
Re: Jensen's device wclodius@aol.com (1998-03-30)
Re: Jensen's device genew@vip.net (1998-03-30)
Re: Jensen's device mslamm@olive.mscc.huji.ac.il (1998-03-30)
Re: Jensen's device u-reddy@cs.uiuc.edu (Uday S. Reddy) (1998-03-30)
Re: Jensen's device Andrew.Walker@nottingham.ac.uk (Dr A. N. Walker) (1998-04-03)
Re: Jensen's device jmccarty@sun1307.spd.dsccc.com (1998-04-03)
Re: Jensen's device ok@atlas.otago.ac.nz (Dr Richard A. O'Keefe) (1998-04-03)
Re: Jensen's device rweaver@ix.netcom.com (1998-04-03)
| List of all articles for this month |

From: "Uday S. Reddy" <u-reddy@cs.uiuc.edu>
Newsgroups: comp.compilers
Date: 30 Mar 1998 21:47:51 -0500
Organization: Compilers Central
References: 98-03-193
Keywords: algol60, history

> > [Remember that call by name was a mistake. The Algol60 was trying to write
> > an elegant definition of call by reference and inadvertently created call
> > by name. Nobody realized it until the paper on Jensen's device. -John]
>
> This is very interesting. I didn't know about this before (except of Jensen's
> device, of course). Well, I have a few questions about this stuff. Could
> someone answer them, please?
>
> 1. When they discovered the mistake, why didn't they simply rewrite the
> document containing the definition of Algol-60? I assume, it was not
> so easy because of all that bureaucratic work :-(


I don't think this was a mistake in the sense that the committee
wanted to write one thing and wrote another. Every indication is that
the committee deliberately chose call-by-name. On the other hand,
this might have been a "mistake" in the sense that not all design
implications of call-by-name were understood when the report was
written (especially the implementation hassles, efficiency
considerations etc.)


One of the guiding principles of the Algol committee was to define the
language at a high-level without involving any implementation concepts
such as memory locations, addresses, pointers etc. Giving such a
high-level description of call-by-reference is quite a challenge. In
fact, this challenge has been met only recently when Standard ML was
defined. (Algol 68 tried to do it too, but their descriptions are too
complicated for mere mortals to understand.)


A second issue the committee must have faced is to find a uniform
mechanism for parameter passing that applies to all kinds of
parameters. Call-by-reference is something that applies to variable
parameters. But, what about, say procedure parameters? Is there such
a thing called a "reference" to a procedure?


It must have appeared to the committee that call-by-name was the
*simplest* solution. They probably ensured before writing the report
that call-by-name was implementable. But, they probably didn't have a
very good idea of what it would cost.


The simplicity of call-by-name is still a reality. The theory of
call-by-value (and call-by-reference) lags behind that of call-by-name
by decades and, even when the theories are discovered, we find that
they are a lot more complicated than the corresponding theories for
call-by-name. Thus, call-by-name lives, at least in theory if not in
real languages.


Uday Reddy


P.S. Call by name in functional programming, often called lazy
evaluation, is very much alive in real languages (such as Miranda and
Haskell). However, call by name in imperative programming poses
harder and subtler issues and is generally avoided in real languages.
[I agree, the mistake was that they didn't realize how complex the
implementation would have to be. On the other hand, it's definitely an
improvement over the in-line macros in Algol 58. -John]






--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.