Newsgroups: | comp.compilers |
From: | hbaker@netcom.com (Henry Baker) |
Keywords: | C++, optimize |
Organization: | nil |
References: | 95-07-068 95-07-132 |
Date: | Wed, 26 Jul 1995 02:41:11 GMT |
Stefan Monnier <stefan.monnier@epfl.ch> wrote:
> Henry Baker <hbaker@netcom.com> wrote:
> ] My personal feeling is that I agree (in this instance) with David Chase
> ] 100%, and would go so far as to say that far from allowing _speedups_, the
> ] current ambiguity in the language standards actually _guarantees_
slowdowns in
> ] programs which aspire to any amount of portability. The problem is
that if you
> ] were truly paranoid, you would have to start locking and unlocking serially
> ] accessed data structures on the different arguments to a multi-argument
> ] procedure.
>
> What's wrong with using
> tmp1=argexp1;
> tmp2=argexp2;
> ...
> fun(tmp1, tmp2, ...)
>
> instead of
> fun(argexp1, argexp2, ..)
>
> The code is less readbale, but definitely not slower.
>
> Stefan
> [I thought compilers were supposed to make programming easier, not harder.
> -John]
I think that Stefan forgot his smiley...
I rather like programming in continuation-passing style :-) -- it completely
eliminates all order-of-evaluation problems because there's only one
possible function can that can be done at any given time, so the compiler
can't screw up. You can even do it in C, and it's actually quite efficient--
ftp://ftp.netcom.com/pub/hb/hbaker/CheneyMTA.html (also .ps.Z)
--
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.