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: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: Q: access to subprogram Date: 1996/07/08 Message-ID: <4rqbo9$b02@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 167146701 references: <4rb9dp$qe6@news1.delphi.com> <4re2ng$t7u@wdl1.wdl.loral.com> organization: Comp Sci, RMIT, Melbourne, Australia nntp-posting-user: ok newsgroups: comp.lang.ada Date: 1996-07-08T00:00:00+00:00 List-Id: 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. The B6700 hardware took care of this. Techniques for marrying procedure parameters and displays were readily available in the compiler construction literature by the late '70s. A compiler construction class I was a student in explained how to do it (and we had to; we were writing a Pascal->Algol compiler which used a display). What happened? When did everyone forget? Yes, there is overhead: but the overhead of rewinding the display is incurred only on entry to / exit from a formal procedure; there need be *NO* extra overhead for calling visible procedures. >3. Displays are clearly faster than static links, for normal direct calls. >This argument makes *some* sense, but I dispute point 3. I'm not really >sure, but I think that perhaps static links are faster. 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? -- Fifty years of programming language research, and we end up with C++ ??? Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.