Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end 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: Mon, 05 Mar 2018 15:01:33 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 63 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <18-03-018@comp.compilers> References: <18-02-009@comp.compilers> <18-02-012@comp.compilers> <18-02-016@comp.compilers> <18-02-018@comp.compilers> <18-02-023@comp.compilers> <18-02-029@comp.compilers> <18-02-032@comp.compilers> <18-02-034@comp.compilers> <18-03-002@comp.compilers> <18-03-012@comp.compilers> Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="26173"; mail-complaints-to="abuse@iecc.com" Keywords: design, code, Pascal Posted-Date: 05 Mar 2018 11:12:37 EST 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:1975 anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: >George Neuner writes: >>I'd really like to see that paper to find out what they are comparing >>to display [and using what language]. > >The language was probably Algol or one of it's direct offspring. > >Anyway, if I get around to it, I will search for a reference to the >paper in our library, but if someone else can supply the reference, >that would be cool. I looked in some older compiler books, but did not find a reference to such a paper. What I found: * Aho and Ullman (1977) only mention displays as ways to implement static scoping. * Aho, Sethi, Ullman (1986) also mention access links (static links). * Fischer and Leblanc (1988) discuss both, and say the following: |For example, a study of reference patterns in a wide variety of |Simula 67 programs (Magnusson 1982) found that fully 80% if all |references were to variables at the outermost level or to local |variables. Another 17% of the references were to the block |immediately surrounding the local one. [...] Thus few references |will actually require following the static chain, and most of those |will require only one level of such indirection. |Magnussen, K. 1982. "Identifier references in Simula 67 programs." |Simula Newsletter 10(2): They do not write about performance disadvantages of displays, though. I also looked if I could find Wirth's response to Cohen's paper, and I found it: (probably behind a paywall for many). And there he gave the reason for not using a display for accessing non-local variables: |Upon closer analysis, we decided to discard the use of a display |that was already in our first Pascal compiler (1969). The reason |was that (1) the display requires updating for every procedure call |and return (!) that causes a change of context, and (2) variables at |intermediate levels (neither local nor global) are referenced quite |rarely. As a result, the maintenance of a display turned out to be |more costly than the inefficient access of nonlocal variables via a |static link. So apparently there was no influential paper in the 60s or 70s that damned the display. Wirth and his collaborators discovered the performance disadvantages of displays by original research, but apparently did not publish this piece of knowledge before 1991. - anton -- M. Anton Ertl anton@mips.complang.tuwien.ac.at http://www.complang.tuwien.ac.at/anton/