Re: normal order vs. applicative order question



H. wrote:
Yes, that makes sense; thanks.


In applicative order, you evaluate operand expression before you apply
the operator; in normal order, you evaluate expressions when you need
their value, right?

So imagine an operand expression whose evaluation takes a long time
but whose value is never needed.

It should be mentioned that applicative order evaluation results in each operand expression only being evaluated once, whereas with unoptimized normal order, the same operand expression may be evaluated any number of times (including zero times, as pointed out above).


This means that in most realistic cases, normal order evaluation cannot be as efficient as applicative order unless the evaluation of operand expressions is optimized so that they're evaluated at most once.

Anton
.



Relevant Pages

  • Re: normal order vs. applicative order question
    ... each operand expression only being evaluated once, whereas with unoptimized normal order, the same operand expression may be evaluated any number of times. ... This means that in most realistic cases, normal order evaluation cannot be as efficient as applicative order unless the evaluation of operand expressions is optimized so that they're evaluated at most once. ... ....is a great intro to the lazy graph reduction technique for implementing lazy functional languages. ...
    (comp.lang.scheme)
  • Re: normal order vs. applicative order question
    ... operand expression only being evaluated once, whereas with unoptimized normal order, the same operand expression may be evaluated any number of times. ... This means that in most realistic cases, normal order evaluation cannot be as efficient as applicative order unless the evaluation of operand expressions is optimized so that they're evaluated at most once. ... Cs, and Ds :-), with first strict language being just after it. ...
    (comp.lang.scheme)
  • Re: normal order vs. applicative order question
    ... the same operand expression may be evaluated ... >>> This means that in most realistic cases, normal order evaluation ... >>> cannot be as efficient as applicative order unless the evaluation of ... they made a concerted effort to show what GHC could do. ...
    (comp.lang.scheme)
  • Re: normal order vs. applicative order question
    ... > In applicative order, you evaluate operand expression before you apply ... in normal order, you evaluate expressions when you need ... Prev by Date: ...
    (comp.lang.scheme)