comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: The Red Language
Date: 1997/09/19
Date: 1997-09-19T00:00:00+00:00	[thread overview]
Message-ID: <dewar.874664808@merv> (raw)
In-Reply-To: EGoLLn.ABt@world.std.com



<<Well, I suppose you can always do a two-pass algorithm in one pass, by
having a sufficienty complicated back-patching scheme or some such.  I
read a paper a long time ago about one-pass overload resolution in Ada,
and my impression was that the one-pass algorithm was basically
calculating (during the first pass) all possible results that *might*
occur on the second pass, and then throwing all but one of them away,
thus avoiding the need for the second pass.  This seemed silly at the
time -- it seemed like the so-called one-pass algorithm would be more
complicated to program, and less efficient, than the two-pass algorithm.>>


Whether you call things one pass or two pass is to some extent just an
excercise in semantics. But when I say that two passes is fundamental,
what I mean is that before assigning the proper type to a given node,
it is necessary to visit nodes both above you and below you in the tree.
That means there is no canonical traversal scheme which allows you to
visit nodes just once. 

OK, of course you can visit nodes just once and then build a list of
results which are accessed separately, but by one pass scheme I would
mean a scheme that operates as follows.

There is a canonical traversal of the operator tree which visits nodes
one by one and assigns types to each node at the time they are visited.

Any other definition of one pass is unuseful. For example, the more flexible
definition would lead one to consider all compilers one pass because they
only look at the source once, and from then on they are dealing with
auxiliary data structures -- not a useful definition.

Note that in Algol-68, which uses operand type overloading only, there is
indeed a one pass algorithm in the sense I define it above.





  parent reply	other threads:[~1997-09-19  0:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <340E2DC5.25D7@worldnet.att.net>
     [not found] ` <340ebdaf.230366903@news.mindspring.com>
     [not found]   ` <340ED5D8.2DEF6D3@ux4.sp.cs.cmu.edu>
1997-09-04  0:00     ` The Red Language Robert Munck
1997-09-07  0:00       ` Robert Dewar
1997-09-08  0:00         ` Richard Kenner
1997-09-12  0:00           ` David Wheeler
1997-09-12  0:00             ` Robert A Duff
     [not found]     ` <199709051335.PAA25952@basement.replay.com>
1997-09-05  0:00       ` Dean F. Sutherland
1997-09-08  0:00         ` Robert A Duff
1997-09-09  0:00           ` Arthur Evans Jr
     [not found]             ` <dewar.873953300@merv>
1997-09-11  0:00               ` Robert Dewar
1997-09-11  0:00                 ` Dean F. Sutherland
1997-09-12  0:00                   ` Robert A Duff
1997-09-11  0:00                 ` Arthur Evans Jr
1997-09-12  0:00                   ` Robert Dewar
1997-09-12  0:00                   ` Robert A Duff
1997-09-07  0:00 ` Robert Dewar
1997-09-08  0:00   ` Tucker Taft
1997-09-12  0:00 ` Robert A Duff
1997-09-12  0:00   ` Michael & Amy Hartsough
1997-09-13  0:00   ` Matthew Heaney
1997-09-14  0:00     ` Robert A Duff
1997-09-16  0:00       ` Brian Rogoff
1997-09-18  0:00         ` Robert Dewar
1997-09-18  0:00           ` Robert A Duff
1997-09-20  0:00             ` Robert Dewar
1997-09-22  0:00               ` Robert A Duff
1997-09-18  0:00         ` Robert A Duff
1997-09-18  0:00           ` Overload Resolution in Ada (Re: The Red Language) Brian Rogoff
1997-09-19  0:00             ` Robert Dewar
1997-09-19  0:00             ` Robert A Duff
1997-09-19  0:00               ` Brian Rogoff
1997-09-20  0:00                 ` Robert Dewar
1997-09-19  0:00           ` Robert Dewar [this message]
1997-09-19  0:00             ` The Red Language Robert A Duff
1997-09-21  0:00               ` Robert Dewar
1997-09-21  0:00                 ` Algol 68 references (Was Re: The Red Language) Brian Rogoff
1997-09-22  0:00                   ` Mark L. Fussell
1997-09-22  0:00                 ` The Red Language Richard Kenner
1997-09-22  0:00                 ` Chris Morgan
1997-09-22  0:00                 ` Richard A. O'Keefe
1997-09-25  0:00                   ` Bruce Link
1997-09-30  0:00               ` Charles Lindsey
1997-10-03  0:00                 ` Robert I. Eachus
1997-09-19  0:00             ` Brian Rogoff
1997-09-18  0:00         ` Robert Dewar
1997-09-18  0:00           ` Brian Rogoff
1997-09-16  0:00   ` Brian Rogoff
replies disabled

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