From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99ab4bb580fc34cd X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Q: access to subprogram Date: 1996/07/08 Message-ID: #1/1 X-Deja-AN: 167195521 references: <4rb9dp$qe6@news1.delphi.com> <4rqbo9$b02@goanna.cs.rmit.edu.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-08T00:00:00+00:00 List-Id: In article <4rqbo9$b02@goanna.cs.rmit.edu.au>, Richard A. O'Keefe wrote: >bobduff@world.std.com (Robert A Duff) writes: > >>1. Displays are too much trouble, in the presence of downward closures. >>(Or, are they upward closures? You know what I mean -- passing >>procedures as parameters.) > >This puzzles me mightily. Burroughs Algol for the B6700 used a single >global display (actually a dedicated bank of 32 registers; reduced to >16 on later models). In fact, all languages on that machine did, >including Fortran, PL/I, and Pascal. Now Algol, Fortran, PL/I, and >Pascal all allow procedures to be passed as parameters, and in Algol, >PL/I, and Pascal those procedures can be nested. I didn't mean it's impossible. I just meant that if I were implementing a compiler for a language with downward closures on a typical modern machine, I would choose static links, in part because it seems simpler. On the other hand, I know of compilers that have implemented Pascal using displays. Remember that the discussion during the design of Ada 9X was NOT about "we don't know how to implement this in theory" -- it was more like, "we've got a multi-target back end (back ends), and we don't want to mess with it (them)". Also note that I argued strongly IN FAVOR of downward closures, and lost the argument. >Displays are a win if you can afford to dedicate some global registers to >them. This was beaten to death by the late 70's surely? Sure, but inconclusively. Just like LR vs. LL parsing has been beaten to death -- it doesn't mean that everybody agrees which one is the right one to use in all situations. As for displays being a big win, suppose I can afford to dedicate those registers on one of my targets, but not on the other? Do I write a back end (or pair of back ends) that can do it both ways? It's an economic decision, at least in part. Suppose I have a very rich customer who desperately needs efficient code, and loves to write 7-level-deep nested procedures. That might make a difference, no? Also, note that it depends on the language. In my experience, Ada programs are less deeply nested than Pascal programs. If you don't use much nesting, then it's clearly not a "big win" either way. - Bob