comp.lang.ada
 help / color / mirror / Atom feed
From: wolff@inf.fu-berlin.de (Thomas Wolff)
Subject: Re: Q: access to subprogram
Date: 1996/07/09
Date: 1996-07-09T00:00:00+00:00	[thread overview]
Message-ID: <4rud55$5b0@fu-berlin.de> (raw)
In-Reply-To: DtzAFG.54z@world.std.com


Robert Dewar: >>>Q: access to subprogram
 : Once you introduce unrestricted access to procedures, displays are a bit
 : of a menace, and probably this tips the scales in favor of static links
 : (if you believe like me that displays are more efficient, this can also
 : be read as meaning that the introduction of unrestricted access to procedures
 : would introduce distributed inefficiency -- but that still is NOT the reason
 : this feature was excluded).
Why should displays be a menace where static links are not? Who would 
actually prefer to really follow static links at all, effectively almost 
*searching* for variables at run-time? Until now I thought this would 
only be a theoretical concept and perhaps one of very early compilers.


Robert A Duff: >>>Q: access to subprogram
 : There are two major ways of implementing up-level variable references in
 : a language with nested procedures: Static links, and displays.  With
 : displays, it is somewhat difficult to implement passing nested
 : procedures as parameters, because you have to pass the display, which is
This is not true, see below.
 : not of compile-time-known size.  Passing a static link is easy -- it's
 : just a single address.  Some implementations of Ada 83 used displays.
Why not just push the display on the stack and pass its address??
(If you really wanted to pass the display itself for some reason, you 
could still use the program's maximal display size, wasting a few 
bytes in these occasional cases.)

 : The primary reason for not putting the feature in was to ease the pain
 : for such implementations.  This was done at a time when the general
 : feeling was that Ada 9X had more than enough new features, and we
 : shouldn't be adding things, but removing them.
It is a very unfortunate decision to leave out a nice feature of 
systematic program construction just for leaving out features.


Mark A Biggar: >>>Q: access to subprogram
 : In article <JSA.96Jul2221357@organon.com> jsa@organon.com (Jon S Anthony) wri
tes
 : :
 : >In article <Dtxu2p.97F@world.std.com> bobduff@world.std.com (Robert A Duff) 
wri
 : tes:
 : >> During the design of Ada 9X, we proposed a SAFE way of taking 'Access of
 : >> more-deeply-nesting subprograms.  To this day, I remain astonished and
 : >> sad that this particular feature didn't make it into Ada 95.  After
 : >> all, even Pascal has that feature!  And GNU C, which allows nested
 : >> functions (unlike standard C) allows this feature.
I am sad about this, too. I have also always deplored that this 
feature was removed during Wirth's transition from Pascal to Modula, 
presumably for the same unconvincing reasons as used in this 
discussion.

 : If I remember right, it was felt that implementing "closures" (which is the
 : solution to this problem) placed an unacceptable distributed overhead
 : on programs that didn't use the feature.  Also I think that half the then
 : current Ada implementations were using "static links" and the other half
 : were using "displays" and implementing "clousers" would have been real
 : difficult for one of those groups (the "display" bunch I think).
No, with the solution indicated above there is no overhead (i. e. for 
programs that don't use the feature) and no big inefficiency for programs 
that do use the feature and no difficulty either apart from having to 
understand what should happen in the implementation. When I recently 
gave a talk on a topic related to this, some members of the audience 
also seemed to recall they had the impression this was difficult or 
inefficient... I wonder how this rumor evolved.

Compare my other response in this thread for remarks about the 
desirability of the discussed language feature.

Thomas Wolff





  parent reply	other threads:[~1996-07-09  0:00 UTC|newest]

Thread overview: 133+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-02  0:00 Q: access to subprogram tmoran
1996-07-02  0:00 ` Robert A Duff
1996-07-02  0:00   ` Robert Dewar
1996-07-03  0:00   ` Jon S Anthony
1996-07-03  0:00     ` Robert Dewar
1996-07-03  0:00     ` Mark A Biggar
1996-07-03  0:00       ` Robert Dewar
1996-07-06  0:00         ` Robert A Duff
1996-07-08  0:00           ` Norman H. Cohen
1996-07-08  0:00             ` Robert Dewar
1996-07-11  0:00             ` Robert A Duff
1996-07-12  0:00               ` Robert A Duff
1996-07-14  0:00               ` Norman H. Cohen
1996-07-03  0:00       ` Robert A Duff
1996-07-03  0:00         ` Robert Dewar
1996-07-09  0:00         ` Thomas Wolff [this message]
1996-07-09  0:00           ` Robert Dewar
1996-07-10  0:00           ` Robert A Duff
1996-07-10  0:00             ` Richard A. O'Keefe
1996-07-10  0:00               ` Robert Dewar
1996-07-10  0:00               ` Robert A Duff
1996-07-10  0:00                 ` Thomas Wolff
1996-07-10  0:00                   ` Robert A Duff
1996-07-10  0:00                   ` Robert Dewar
1996-07-03  0:00     ` Robert A Duff
1996-07-08  0:00       ` Norman H. Cohen
1996-07-09  0:00         ` Robert A Duff
1996-07-19  0:00     ` Brian Rogoff
1996-07-22  0:00       ` Richard A. O'Keefe
1996-07-23  0:00       ` Brian Rogoff
1996-07-23  0:00         ` Robert A Duff
1996-07-26  0:00         ` Brian Rogoff
1996-07-28  0:00           ` Robert A Duff
1996-07-22  0:00     ` Brian Rogoff
1996-07-23  0:00       ` Robert A Duff
1996-07-24  0:00       ` Richard A. O'Keefe
1996-07-26  0:00         ` Ken Garlington
1996-07-30  0:00           ` Richard A. O'Keefe
1996-07-24  0:00       ` Brian Rogoff
1996-07-26  0:00         ` Robert A Duff
1996-07-30  0:00         ` Brian Rogoff
1996-07-24  0:00     ` Brian Rogoff
1996-07-26  0:00     ` Richard A. O'Keefe
1996-07-28  0:00       ` Fergus Henderson
1996-07-28  0:00       ` Robert A Duff
1996-07-29  0:00         ` Richard A. O'Keefe
1996-07-29  0:00           ` Robert A Duff
1996-07-29  0:00     ` Richard A. O'Keefe
1996-07-30  0:00     ` Jon S Anthony
1996-07-03  0:00   ` Fergus Henderson
1996-07-03  0:00     ` Robert A Duff
1996-07-03  0:00       ` Robert Dewar
1996-07-03  0:00       ` Adam Beneschan
1996-07-03  0:00         ` Robert A Duff
1996-07-03  0:00         ` Robert Dewar
1996-07-09  0:00         ` Thomas Wolff
1996-07-05  0:00   ` Jon S Anthony
1996-07-06  0:00     ` Robert Dewar
1996-07-06  0:00     ` Robert A Duff
1996-07-06  0:00       ` Robert Dewar
1996-07-08  0:00         ` Robert A Duff
1996-07-08  0:00       ` Richard A. O'Keefe
1996-07-08  0:00         ` Robert Dewar
1996-07-10  0:00           ` Richard A. O'Keefe
1996-07-10  0:00             ` Robert Dewar
1996-07-19  0:00               ` Richard A. O'Keefe
1996-07-08  0:00         ` Robert A Duff
1996-07-08  0:00           ` Robert Dewar
1996-07-07  0:00   ` Ronald Cole
1996-07-07  0:00     ` Robert Dewar
1996-07-07  0:00       ` Richard Kenner
1996-07-07  0:00         ` Robert Dewar
1996-07-14  0:00       ` Ronald Cole
1996-07-14  0:00         ` Richard Kenner
1996-07-15  0:00           ` Fergus Henderson
1996-07-15  0:00             ` Robert Dewar
1996-07-17  0:00               ` Fergus Henderson
1996-07-17  0:00                 ` Richard Kenner
1996-07-17  0:00               ` Adam Beneschan
1996-07-20  0:00               ` Michael Feldman
1996-07-20  0:00                 ` Robert Dewar
1996-07-16  0:00             ` Richard Kenner
1996-07-07  0:00     ` Richard Kenner
1996-07-07  0:00   ` Mark Eichin
1996-07-08  0:00     ` Richard Kenner
1996-07-08  0:00   ` Brian Rogoff
1996-07-11  0:00     ` Norman H. Cohen
1996-07-11  0:00       ` Magnus Kempe
1996-07-11  0:00         ` Robert Dewar
1996-07-09  0:00   ` Jon S Anthony
1996-07-09  0:00     ` Robert Dewar
1996-07-09  0:00     ` Robert Dewar
1996-07-09  0:00   ` Jon S Anthony
1996-07-09  0:00     ` Robert Dewar
1996-07-10  0:00   ` Ronald Cole
1996-07-11  0:00     ` Richard Kenner
1996-07-11  0:00     ` Robert Dewar
1996-07-11  0:00   ` Jon S Anthony
1996-07-11  0:00   ` Jon S Anthony
1996-07-11  0:00     ` Robert Dewar
1996-07-11  0:00   ` Jon S Anthony
1996-07-11  0:00     ` Tucker Taft
1996-07-17  0:00       ` Brian Rogoff
1996-07-11  0:00     ` Robert Dewar
1996-07-15  0:00       ` Mark A Biggar
1996-07-15  0:00         ` Robert Dewar
1996-07-12  0:00     ` Jon S Anthony
1996-07-12  0:00       ` Robert Dewar
1996-07-15  0:00     ` Jon S Anthony
1996-07-15  0:00       ` Robert Dewar
1996-07-12  0:00   ` Brian Rogoff
1996-07-16  0:00     ` Magnus Kempe
1996-07-14  0:00   ` Ronald Cole
1996-07-14  0:00     ` Robert Dewar
1996-07-15  0:00   ` Jon S Anthony
1996-07-15  0:00     ` Robert Dewar
1996-07-16  0:00   ` Brian Rogoff
1996-07-24  0:00 ` Jon S Anthony
1996-07-25  0:00 ` Fergus Henderson
1996-07-25  0:00   ` David Kristola
1996-07-26  0:00     ` Robert A Duff
1996-07-30  0:00       ` Thomas Wolff
1996-07-30  0:00         ` Robert A Duff
1996-07-30  0:00       ` David Kristola
1996-07-26  0:00   ` Robert A Duff
1996-07-26  0:00     ` Fergus Henderson
1996-07-28  0:00       ` Robert A Duff
1996-07-28  0:00         ` Fergus Henderson
1996-07-25  0:00 ` Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1996-07-05  0:00 tmoran
1996-07-06  0:00 ` Robert A Duff
1996-07-15  0:00 tmoran
1996-07-15  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox