Evaluation Order Semantics

Date: Tue, 24 Sep 2013 12:01:51 +0800 From: ???
Yes, if the spec does not state the evaluation order I can't predict the performance definitely.
Well, depending on how definite you want to be, an inability to predict the performance definitely is inherent in using compiled languages. That the performance can change if you change the compilation options shows that. On the other end of the scale, if you correctly implement an O(n) algorithm, then it's definitely going to take at most O(n) steps to print the results from it whether the language is strict or lazy. Being more definite does get harder in the face of lazy evaluation, but it also gets harder in the face of optimization. A lazy language will not evaluate expressions whose value is never used. So will a good optimizing compiler for a strict language. Can you be a bit more explicit in what about performance you're trying to predict? Note to Keshav - yes, evaluating expressions you don't have to can change the results. But I was talking about the evaluation order for expressions you actually evaluate, though maybe I wasn't clear about it. Thanks for pointing that out, though.
participants (1)
-
Mike Meyer