comp.lang.ada
 help / color / mirror / Atom feed
From: Andi Kleen <ak-uu@muc.de>
Subject: Re: C like op= proposal
Date: 1999/08/17
Date: 1999-08-17T18:44:53+00:00	[thread overview]
Message-ID: <m3u2pyutzu.fsf@fred.muc.de> (raw)
In-Reply-To: 87emh2l218.fsf@antinea.enst.fr

Samuel Tardieu <sam@ada.eu.org> writes:

> >>>>> "Gautier" == Gautier  <Gautier.deMontmollin@Maths.UniNe.CH> writes:
> 
> Gautier>   a(b(c,d+e(f,g)).h(i,j)) := a(b(c,d+e(f,g)).h(i,j)) + 1;
> 
> Gautier> which can be horribily long and unlikely to be catched by the
> Gautier> optimizer -> 2x too slow (at least: the extra code makes a
> Gautier> penalty for processor cache).
> 
> Where did you get the impression that the optimizer would miss this?

[..] discussion about +=,++ and friends for better code snipped.

I would like to have += in Ada (perhaps not ++,--) simply because it 
is more expressive. My brain wraps easier to "increase X by Y" than
to "set X to the sum of X and Y"[1] Ada is about making it easy for the
reader, isn't it? +=, -= make it clear that there is a side effect
that takes the old value into account, with the spelled out way
"x := x + 1" I have to determine that first. With simple "x" it is easy,
but e.g. with Gautier's example above it requires real mental work that 
distracts me from my primary job.  Not that this is impossible,
it is just that the first way is IMHO better readable because it makes
the intent of the author more clear.


-Andi

[1] To attribute correctly this is an old argument from, I believe
Dennis Ritchie, in a prehistoric article about C. I think he's right.

-- 
This is like TV. I don't like TV.




  reply	other threads:[~1999-08-17  0:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-15  0:00 C like op= proposal Brian Rogoff
1999-08-15  0:00 ` Ray Blaak
1999-08-15  0:00   ` Brian Rogoff
1999-08-16  0:00     ` Gautier
1999-08-17  0:00       ` John Duncan
1999-08-17  0:00         ` Gautier
1999-08-17  0:00       ` Samuel Tardieu
1999-08-17  0:00         ` Andi Kleen [this message]
1999-08-18  0:00           ` Robert Dewar
1999-08-17  0:00             ` Brian Rogoff
1999-08-18  0:00               ` Robert Dewar
1999-08-18  0:00                 ` Brian Rogoff
1999-08-19  0:00                   ` Robert Dewar
1999-08-21  0:00                     ` Brian Rogoff
1999-08-23  0:00                     ` Robert A Duff
1999-08-18  0:00               ` Ted Dennison
1999-08-18  0:00                 ` Jeff Carter
1999-08-18  0:00                   ` Keith Thompson
1999-08-19  0:00                     ` Tarjei T. Jensen
1999-08-19  0:00                       ` Ted Dennison
1999-08-19  0:00                       ` Robert Dewar
1999-08-20  0:00                         ` P.S. Norby
1999-08-21  0:00                           ` Robert Dewar
1999-08-19  0:00                       ` Lance Kibblewhite
1999-08-19  0:00                       ` tmoran
1999-08-19  0:00                     ` Michael F. Yoder
1999-08-21  0:00                       ` Keith Thompson
1999-08-18  0:00                 ` Robert I. Eachus
1999-08-18  0:00               ` Gautier
1999-08-18  0:00             ` Andi Kleen
1999-08-17  0:00         ` Gautier
1999-08-18  0:00         ` Gautier
1999-08-16  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