From 7320310643043203193
X-Google-Thread: f78e5,52112cea9d2ccd4a
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!netnews.web.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.stueberl.de!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: SeeWebsiteForEmail@moderncppdesign.com ("Andrei Alexandrescu (See Website For Email)")
Newsgroups: comp.std.c++
Subject: Re: =?ISO-8859-1?Q?=A75=2E2=2E2/8_unspecified_evluation_od?=
 =?ISO-8859-1?Q?er=3F?=
Date: Sat,  6 Aug 2005 22:42:38 GMT
Organization: Computer Science & Engineering, U of Washington, Seattle
Lines: 48
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <IKtBL6.1sI2@beaver.cs.washington.edu>
References: <CsidnX1xcd4C73_fRVn-tA@speakeasy.net> <42E4EB01.9020700@alumina.nl> <42E64CCE.7030708@cs.york.ac.uk> <42E68BDD.1050701@alumina.nl> <1122649512.879866.38000@g44g2000cwa.googlegroups.com> <3l12o0F10nuusU1@individual.net> <0RfHe.2500$%a2.1721@trndny03> <3l5u7qFvrvk8U1@individual.net> <200508011747.j71HlbuC069360@horus.isnic.is> <1122936886.396427.298260@g47g2000cwa.googlegroups.com> <zMDHe.2564$%a2.2024@trndny03> <1123012422.458492.183540@z14g2000cwz.googlegroups.com> <20050803191201.15B621140B2@
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1123368163 29119 158.152.254.254 (6 Aug 2005 22:42:43 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 6 Aug 2005 22:42:43 +0000 (UTC)
X-Nntp-Posting-Host: parakeet.ee.washington.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla Thunderbird 1.0.5 (X11/20050711)
X-Accept-Language: en-us, en
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id j76MgcPW010390;
	Sun, 7 Aug 2005 08:42:38 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:1687

P.J. Plauger wrote:
> "Hyman Rosen" <hyrosen@mail.com> wrote in message 
>>This is a user-interface problem. The solution to such problems
>>is not to insult the users but to fix the source of confusion.
>>It would be one thing if the language feature contributed
>>something useful, but it doesn't. Converting underspecified
>>behavior to fully specified behavior is only good.
> 
> 
> I responded to this once, but my response seems to have gotten
> lost somewhere in the moderation process (as sometimes happens
> to me). It is *not* true that fully specifying behavior is
> "only good". The users are happy until they're told that some
> optimization they want is not permissible. The C committee
> very intentionally left wiggle room for implementers in a
> number of places. And architectures invented *since the C
> Standard froze nearly 20 years ago* have benefited from this
> wiggle room.

That is true. I think, however, that the reasons for unspecified 
evaluation order have largely disappeared. The generated code will be as 
good even if left-to-right evaluation is required. Most of the time, the 
order doesn't matter anyway, but 35 years ago, it was deemed 
unproductive to have the compiler prove that, so they put the burden on 
the programmer.

Today's compilers and processors (!) routinely scavenge code for 
reorderings that can increase instruction-level parallelism, and can 
most of the time prove statically (compilers) or dynamically 
(processors, see Tomasulo's seminal algorithm and its many offspring) 
which operations don't depend on the others, and reorder them to best 
exploit hardware resources.

So today's machines already enjoy the freedom of evaluating code 
out-of-order, but in a safe and predictable manner. They do it, and they 
do it with predictable visible semantics. Leaving a dangerous hole in 
the language when the benefit is safely reaped anyway -- that's just no 
longer justified.


Andrei

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



