Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2009

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

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.compilers
Subject Re: Add nested-function support in a language the based on a stack-machine
Date 2018-03-14 15:16 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <18-03-070@comp.compilers> (permalink)
References <6effed5e-6c90-f5f4-0c80-a03c61fd2127@gkc.org.uk> <18-03-042@comp.compilers>

Show all headers | View raw


Martin Ward <martin@gkc.org.uk> writes:
>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.

Looking at the story of recursion in Algol 60
<https://vanemden.wordpress.com/2014/06/18/how-recursion-got-into-programming-a-comedy-of-errors-3/>,
there was a more mathematical camp in the Algol 60 committee, and a
more implementation-oriented camp.  The mathematicians knew how to
specify what they wanted, the implementors know how to implement what
they wanted.  But since the product of the committee was a
specification, they would also have to know how to specify what they
wanted if they wanted to get it into the report.  I guess that they
did not know how to specify call by reference, so the mathematical way
won in this case, as it did for recursion.

History shows that, for recursion, they took the right decision, while
for parameter passing, they didn't.

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

Is it really productive to research and develop a feature that turns
out to be a dead end?  Even the closest thing to call-by-name these
days, call-by-need in lazy functional languages, does not use the
techniques developed by call-by-name.

>Since that time, language designers have become very cautious and timid
>in specifying powerful new language features and compiler research
>has stagnated.

The pace in language design certainly has slowed down a lot since the
early days, but I take this as a sign that the field is maturing: Now
that we have a lot of usable and not-too-horrible programming
languages, it becomes harder to produce something that is better.  And
in particular, it is harder to produce something that is better to a
sufficient degree to overcome the various forces that resist such a
change.

Concerning the stagnation in compiler research, that certainly is not
reflected in the numbers of papers submitted and published at compiler
conferences.

>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".

That is the way to go for a standard that codifies existing practice.
However, it is not ok for compiler maintainers to then take the view
that only programs in that intersection (an almost empty set) need to
be compiled as intended.

>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?

If they had specified call-by-reference and call-by-value, similar to
Pascal?  Programming languages would not be any different.

If they had specified non-recursion?  Recursion may have taken longer
to take hold in mainstream languages.  However, recursion was already
there in Lisp, so it's not as if we needed Algol 60 for that.

In general, while language designers have stood on the shoulders of
their predecessors, I don't have the impression that they let
themselves be limited by limitations of previous languages; such
limitations served more as a motivation for improving things.  Take
Landin's influtential paper "The next 700 programming languages" as an
example.

>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.

Algol 60 did not have first-order functions and closures.  It did have
lexical scoping, though, which the Lisp family only acquired with
Scheme in 1975.

Algol 60 certainly did not have abstract data types.  It did not even
have records.

So these are examples that actually contradict your theory.

- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/

Back to comp.compilers | Previous | NextPrevious in thread | Find similar


Thread

Re: Add nested-function support in a language the based on a stack-machine Martin Ward <martin@gkc.org.uk> - 2018-03-12 16:17 +0000
  Re: Add nested-function support in a language the based on a stack-machine Kaz Kylheku <157-073-9834@kylheku.com> - 2018-03-13 03:02 +0000
    Re: Add nested-function support in a language the based on a stack-machine Martin Ward <martin@gkc.org.uk> - 2018-03-19 11:04 +0000
      Re: Add nested-function support in a language the based on a stack-machine Gene Wirchenko <genew@telus.net> - 2018-03-19 12:50 -0700
        Re: Add nested-function support in a language the based on a stack-machine Kaz Kylheku <157-073-9834@kylheku.com> - 2018-03-20 16:16 +0000
        Re: Add nested-function support in a language the based on a stack-machine Martin Ward <martin@gkc.org.uk> - 2018-03-23 10:44 +0000
          Re: algorithm performance, was Add nested-function support in a language the based on a stack-machine Andy Walker <anw@cuboid.co.uk> - 2018-03-23 18:47 +0000
            Re: algorithm performance, was Add nested-function support in a language the based on a stack-machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2018-03-24 14:06 +0000
              Re: algorithm performance, was Add nested-function support in a language the based on a stack-machine rpw3@rpw3.org (Rob Warnock) - 2018-03-25 07:02 +0000
                Re: algorithm performance "Robin Vowels" <robin51@dodo.com.au> - 2018-03-27 01:22 +1100
          Re: sorting performance, Add nested-function support in a language the based on a stack-machine w.clodius@icloud.com (William Clodius) - 2018-03-24 23:25 -0600
      Re: Add nested-function support in a language the based on a stack-machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2018-03-20 09:06 +0000
        Re: Add nested-function support in a language the based on a stack-machine Bill Findlay <findlaybill@blueyonder.co.uk> - 2018-03-20 12:49 +0000
        Re: language design after Algol 60, was Add nested-function support Martin Ward <martin@gkc.org.uk> - 2018-03-27 14:46 +0100
          Re: language design after Algol 60, was Add nested-function support anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2018-03-30 14:20 +0000
          Re: language design after Algol 60, was Add nested-function support Martin Ward <martin@gkc.org.uk> - 2018-04-06 16:09 +0100
            Re: language design after Algol 60, was Add nested-function support "Derek M. Jones" <derek@_NOSPAM_knosof.co.uk> - 2018-04-08 14:21 +0100
              Re: language design after Algol 60, was Add nested-function support George Neuner <gneuner2@comcast.net> - 2018-04-09 16:51 -0400
                Re: language design after Algol 60, was Add nested-function support anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2018-04-10 05:48 +0000
                Re: language design after Algol 60, was Add nested-function support George Neuner <gneuner2@comcast.net> - 2018-04-10 14:32 -0400
                Re: language design after Algol 60, was Add nested-function support Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2018-04-12 01:09 +0200
                Re: language design after Algol 60, was Add nested-function support bartc <bc@freeuk.com> - 2018-04-12 11:51 +0100
                Re: language design after Algol 60, was Add nested-function support bartc <bc@freeuk.com> - 2018-04-12 19:40 +0100
                Re: language design after Algol 60, was Add nested-function support Martin Ward <martin@gkc.org.uk> - 2018-04-13 14:10 +0100
                Re: language design after Algol 60 "Robin Vowels" <robin51@dodo.com.au> - 2018-04-14 14:11 +1000
                RE: language design after Algol 60 "Costello, Roger L." <costello@mitre.org> - 2018-04-16 12:56 +0000
                Re: language design after Algol 60 "Robin Vowels" <robin51@dodo.com.au> - 2018-04-17 19:08 +1000
                Re: Language design after Algol 60 "Robin Vowels" <robin51@dodo.com.au> - 2018-04-18 14:58 +1000
                Re: language design after Algol 60 Gene Wirchenko <genew@telus.net> - 2018-04-18 16:12 -0700
                Re: language design after Algol 60 Martin Ward <martin@gkc.org.uk> - 2018-05-01 10:42 +0100
                Re: language design after Algol 60 "Robin Vowels" <robin51@dodo.com.au> - 2018-04-14 14:19 +1000
                Re: language design after Algol 60 bartc <bc@freeuk.com> - 2018-04-14 20:43 +0100
                Re: language design after Algol 60 Andy Walker <anw@cuboid.co.uk> - 2018-04-15 00:04 +0100
                Re: language design after Algol 60, was Add nested-function support rpw3@rpw3.org (Rob Warnock) - 2018-04-12 14:05 +0000
                Re: language design after Algol 60, was Add nested-function support George Neuner <gneuner2@comcast.net> - 2018-04-12 20:51 -0400
                Re: OOP language design after Algol 60, was Add nested-function support Kaz Kylheku <157-073-9834@kylheku.com> - 2018-04-13 03:22 +0000
                Re: OOP language design after Algol 60, was Add nested-function support Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2018-04-13 10:22 +0200
                Re: OOP language design after Algol 60, was Add nested-function support George Neuner <gneuner2@comcast.net> - 2018-04-14 13:40 -0400
                Re: OOP language design after Algol 60, was Add nested-function support Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2018-04-15 00:12 +0200
                Re: OOP language design after Algol 60, was Add nested-function support Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2018-04-15 00:23 +0200
                Re: language design after Algol 60, was Add nested-function support "Derek M. Jones" <derek@_NOSPAM_knosof.co.uk> - 2018-04-10 13:15 +0100
                Re: language design after Algol 60, was Add nested-function support Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2018-04-11 13:27 +0200
                Re: language design after Algol 60, was Add nested-function support "Derek M. Jones" <derek@_NOSPAM_knosof.co.uk> - 2018-04-11 20:06 +0100
                Re: language design after Algol 60, was Add nested-function support Kaz Kylheku <157-073-9834@kylheku.com> - 2018-04-10 18:32 +0000
                Re: language design after Algol 60, was Add nested-function support George Neuner <gneuner2@comcast.net> - 2018-04-12 20:57 -0400
                Re: OOP language design after Algol 60, was Add nested-function support Kaz Kylheku <157-073-9834@kylheku.com> - 2018-04-13 03:28 +0000
            Re: language design after Algol 60, was Add nested-function support albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2018-05-05 13:50 +0200
      Re: Add nested-function support in a language the based on a stack-machine mac <acolvin@efunct.com> - 2018-03-20 15:27 +0000
  Re: Add nested-function support in a language the based on a stack-machine w.clodius@icloud.com (William Clodius) - 2018-03-12 21:09 -0600
    Re: Add nested-function support in a language the based on a stack-machine Kartik Agaram <ak@akkartik.com> - 2018-03-13 13:27 -0700
      Re: Add nested-function support in a language the based on a stack-machine Kaz Kylheku <157-073-9834@kylheku.com> - 2018-03-14 00:07 +0000
        Re: Add nested-function support in a language the based on a stack-machine Kartik Agaram <ak@akkartik.com> - 2018-03-13 22:31 -0700
          Re: Add nested-function support in a language the based on a stack-machine Kaz Kylheku <157-073-9834@kylheku.com> - 2018-03-14 14:49 +0000
    Re: Add nested-function support in a language the based on a stack-machine Kaz Kylheku <157-073-9834@kylheku.com> - 2018-03-13 20:51 +0000
    Re: Add nested-function support in a language the based on a stack-machine Andy Walker <anw@cuboid.co.uk> - 2018-03-14 00:27 +0000
      Re: Add nested-function support in a language the based on a stack-machine Andy Walker <anw@cuboid.co.uk> - 2018-03-14 16:37 +0000
  Re: Add nested-function support in a language the based on a stack-machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2018-03-14 15:16 +0000

csiph-web