|Re: Order of argument evaluation in C++, etc. email@example.com (1995-08-07)|
|Re: Re: Order of argument evaluation in C++, etc. firstname.lastname@example.org (William D Clinger) (1995-08-09)|
|From:||William D Clinger <email@example.com>|
|Date:||Wed, 9 Aug 1995 16:35:43 GMT|
firstname.lastname@example.org (David Chase) writes:
>Perhaps I, too, have become a crank on this subject, but I haven't
>seen anyone point out a benefit that any programmer actually derives
>from ambiguous order of (side-effect-containing) expression evalation
>(in practice, not in theory).
IEEE/ANSI Scheme allows the compiler to re-order certain expressions
that may contain side effects. Both Twobit and Chez Scheme do this
as an optimization. As compiled by Twobit for the SPARC, this
optimization reduces the code size for Larceny v0.24 from 489456 to
452872 bytes, a savings of 7.5%.
I happen to agree with Chase that, for a side-effect-happy language
like C or C++, the disadvantages of leaving the order of evaluation
unspecified are so great that they may indeed outweigh the advantages.
I am responding lest someone actually believe his argument that there
are no advantages, that no "real compiler" optimizes the order of
evaluation of expressions that may have side effects, or that his
arguments might apply to languages other than C and C++.
William D Clinger
Return to the
Search the comp.compilers archives again.