Path: csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Martin Ward Newsgroups: comp.compilers Subject: Re: Add nested-function support in a language the based on a stack-machine Date: Mon, 12 Mar 2018 16:17:18 +0000 Organization: Compilers Central Lines: 50 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <18-03-042@comp.compilers> References: <6effed5e-6c90-f5f4-0c80-a03c61fd2127@gkc.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1991 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]