Re: Add nested-function support in a language the based on a stack-machine

Martin Ward <martin@gkc.org.uk>
Mon, 12 Mar 2018 16:17:18 +0000

          From comp.compilers

Related articles
Re: language design after Algol 60, was Add nested-function support martin@gkc.org.uk (Martin Ward) (2018-03-27)
Re: language design after Algol 60, was Add nested-function support anton@mips.complang.tuwien.ac.at (2018-03-30)
Re: language design after Algol 60, was Add nested-function support martin@gkc.org.uk (Martin Ward) (2018-04-06)
Re: language design after Algol 60, was Add nested-function support derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2018-04-08)
Re: language design after Algol 60, was Add nested-function support gneuner2@comcast.net (George Neuner) (2018-04-09)
Re: language design after Algol 60, was Add nested-function support anton@mips.complang.tuwien.ac.at (2018-04-10)
Re: language design after Algol 60, was Add nested-function support derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2018-04-10)
[19 later articles]
| List of all articles for this month |
From: Martin Ward <martin@gkc.org.uk>
Newsgroups: comp.compilers
Date: Mon, 12 Mar 2018 16:17:18 +0000
Organization: Compilers Central
References: <6effed5e-6c90-f5f4-0c80-a03c61fd2127@gkc.org.uk>
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="31221"; mail-complaints-to="abuse@iecc.com"
Keywords: code, comment
Posted-Date: 12 Mar 2018 21:29:58 EDT

On 06/03/18 19:02, john wrote:
> Hypothetical question: Algol60 call by name was a mistake. They
> intended an elegant definition of call by reference and didn't realize
> until Jensen's device what they'd done. If they'd done what they
> intended and we didn't have to invent thunks, how would programming
> languages be different? -John


Lets go along with the theory that they intended call by reference
and did not realise that what they had was different until
Jenson's device was invented. What happened next (hypothetically!)
was that the language designers realised two things:


(1) Call by name is mathematically, semantically, simpler
than call by reference


(2) Call by reference is much easier to implement than call by name.
Call by name requires significant effort to implement.


The designers decided to go with call by name because it produces
a mathematically simpler language, even at the expense of greater
effort to implement the compiler.


The result was an explosion of productive research and development
in compilers and language implementation.


Since that time, language designers have become very cautious and timid
in specifying powerful new language features and compiler research
has stagnated. An extreme example is the C language reference
which merely codifies the intersection of the behaviour of the major
C compilers, and leaves everything else "undefined".


So to answer your hypothetical question: how would programming language
be different if the designers of Algol 60 had decided to put
implementation convenience above mathematical simplicity
and expressive power in the language? Well, perhaps compiler
research would have stagnated from the beginning and we would not even
have some of the powerful language features we have now:
such as first order functions, closures, abstract data types and so on.


(In case you haven't noticed, I am trying to be provocative,
and hoping to be proved wrong: especially about the stagnation
in language design!)


--
Martin


Dr Martin Ward | Email: martin@gkc.org.uk | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4
[It's not just a theory. Alan Perlis told me so and
he was in a position to know. But provoke away. -John]


Post a followup to this message

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