On 06/07/11 02:55, Lyle Kopnicky wrote:
That's called common subexpression elimination (CSE) and is a common
feature of compilers. It's a time/space tradeoff - in the general case
it may take a great deal of space to store the intermediate solutions.
So by not making this tradeoff, the compiler leaves it in the
developer's hands. I think most of the time it would be a good
tradeoff to make, but you have to be consistent about it lest you
surprise the developer.
AFAIK, the Mozart compiler does not do CSE. The Oz language makes CSE
more interesting and challenging than in most languages (with all the
programming concepts, the lightweight concurrency, and constraint
operations that can combine in interesting ways!). So the compiler
writers decided to keep it simple.
Peter
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users