Re: Lazy Evaluation

Subject: Re: Lazy Evaluation
From: James Clark <jjc@xxxxxxxxxx>
Date: Tue, 10 Jun 1997 12:27:54 +0700
At 11:59 09/06/97 -0400, Paul Prescod wrote:

>Someone asked me about lazy evaluation. I don't know of a website to point to
>that will describe this without getting into hoary functional programming 
>background, but the concept is quite simple and isn't really related to 
>functional programming at all -- some fp languages just happen to provide 
>built-in support for it.

Lazy evaluation is related to functional programming in the following way:
if you have side-effects, then the order things get evaluated in makes a
difference and evaluating something lazily may change the result of a
computation.  By contrast in a functional language there are no
side-effects, so evaluating something lazily instead of non-lazily won't
change the result you get.  (On the other hand evaluating something eagerly
instead of lazily may cause a computation not to terminate.)

>This brings us back to functional programming languages.  In DSSSL,
>basically only nodelists (and sosofos?) are lazy.

In Jade both node-lists and sosofos are.  It isn't part of their semantics
that they are.  When you are writing a DSSSL spec, you can always think
about them as if they were implemented eagerly. However an implementation
that didn't implement them lazily, probably wouldn't be very useful.  The
main reason for making the DSSSL language side-effect free is to allow
node-lists and sosofos to be implemented lazily.

James


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Lazy Evaluation
    • Paul Prescod - Mon, 9 Jun 1997 11:57:21 -0400 (EDT)
      • <Possible follow-ups>
      • James Clark - Tue, 10 Jun 1997 01:43:13 -0400 (EDT) <=