comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Depending on passing mechanism
Date: 1997/10/19
Date: 1997-10-19T00:00:00+00:00	[thread overview]
Message-ID: <dewar.877269740@merv> (raw)
In-Reply-To: Pine.BSF.3.96.971015210344.26249A-100000@shell5.ba.best.com


<<        I have seen this particular claim challenged by several other
compiler writers and no evidence was advanced to support it. Do you have
evidence that leaving order of evaluation arbitrary is a performance
enabler?>>

It is always hard to get specific data across the complete spectrum of
application domains. IBM comes closest to having the necessary trace
data to do this kind of study, but that data is closely held.

Obviously it is easy to construct examples where it can make a big difference.
For example, consider:

   a + f(x)

If you demand strict left to right evaluation in a language with unrestricted
side effects, then the code has to load and save the value of A over the
function call, just in case the function call disturbs the value of A.

Certainly you will see an effect on the Specmarc if you constrain the order
of evaluation.

The real point is the following.

We know that constrainining the order of evaluation will hurt the performance
of some code.

We know that constraining the order of evaluation will only affect code that
uses side effects in a particularly nasty way.

We don't want people writing code of that kind anyway. However, without
banning side effects completely, a bad idea (*), we don't know any easy
way of disallowing the "bad" side effects.

We don't feel like damaging the efficiency of code just for the benefit of
those who want to make nasty use of side effects.

On the contrary, leaving the order of evaluation undefined will actively
discourage the use of such side effects, a good thing!

(*) everynow and then, someone wants to ban side effects completely in
functions (some people even want to ban functions, if I remember right,
one of Per Brinch Hanson's simplified Pascal-like languages went in this
direction).

However, this is a bad idea, which, once the full issues are examined, never
gets more than a splinter of support. The trouble is that there are many
legitimate uses for functions with side effects, an obvious example among
many being the use of memo functions.





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

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-13  0:00 Depending on passing mechanism Andre Spiegel
1997-10-13  0:00 ` Matthew Heaney
1997-10-14  0:00 ` Robert Dewar
1997-10-14  0:00 ` Robert Dewar
1997-10-14  0:00   ` Henry Baker
1997-10-15  0:00     ` JP Thornley
1997-10-15  0:00     ` Geert Bosch
1997-10-15  0:00       ` Robert Dewar
1997-10-15  0:00         ` Brian Rogoff
1997-10-19  0:00           ` Robert Dewar [this message]
1997-10-22  0:00             ` Henry Baker
1997-10-15  0:00         ` Robert Dewar
1997-10-17  0:00           ` Andre Spiegel
1997-10-17  0:00             ` Henry Baker
1997-10-17  0:00               ` Jon S Anthony
1997-10-17  0:00               ` Robert I. Eachus
1997-10-21  0:00               ` Robert A Duff
1997-10-21  0:00                 ` Peter Hermann
1997-10-22  0:00                   ` Robert A Duff
1997-10-22  0:00                     ` Brian Rogoff
1997-10-22  0:00                 ` Henry Baker
1997-10-21  0:00                   ` Robert Dewar
1997-10-22  0:00                   ` Jon S Anthony
1997-10-22  0:00                   ` Brian Rogoff
1997-10-15  0:00       ` Henry Baker
1997-10-15  0:00         ` Robert Dewar
1997-10-15  0:00         ` Jon S Anthony
1997-10-16  0:00         ` Brian Rogoff
1997-10-17  0:00           ` Henry Baker
1997-10-18  0:00             ` Brian Rogoff
1997-10-18  0:00               ` Matthew Heaney
1997-10-19  0:00                 ` Brian Rogoff
1997-10-21  0:00                   ` Robert A Duff
1997-10-22  0:00                     ` Robert Dewar
1997-10-22  0:00                       ` Brian Rogoff
     [not found]                         ` <dewar.877601826@merv>
1997-10-23  0:00                           ` Brian Rogoff
1997-10-23  0:00                       ` Henry Baker
1997-10-23  0:00                     ` Brian Rogoff
1997-10-19  0:00               ` Fergus Henderson
1997-10-19  0:00                 ` Brian Rogoff
1997-10-20  0:00                   ` Fergus Henderson
1997-10-20  0:00                 ` Henry Baker
1997-10-20  0:00                   ` Tucker Taft
1997-10-21  0:00                     ` Geert Bosch
1997-10-18  0:00             ` Fergus Henderson
1997-10-21  0:00     ` Robert A Duff
1997-10-22  0:00       ` Henry Baker
1997-10-21  0:00         ` Matthew Heaney
1997-10-22  0:00           ` Simon Wright
1997-10-23  0:00           ` Henry Baker
1997-10-23  0:00             ` Pat Rogers
1997-10-24  0:00             ` Robert Dewar
1997-10-23  0:00         ` Robert A Duff
1997-10-21  0:00   ` Keith Thompson
replies disabled

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