Re: Side effects and large-scale conversion

Subject: Re: Side effects and large-scale conversion
From: James Clark <jjc@xxxxxxxxxx>
Date: Fri, 26 Sep 1997 14:05:32 +0700
Derek Denny-Brown wrote:

> for static queries which you might use side
> effects to memorize, the impl can use traditional lispish 'memorization'
> (i.e. once the function is called for a given parameter value, the engine
> remembers the return value and just returns that, not bothering to
> re-evalute the query), but all this requires you spend some time/money on
> building a good optimizer for DSSSL.  

Memoization (no 'r') is indeed an extremely useful technique, but hoping
that the implementation will do it automatically is rather optimistic. 
A more practical approach is to provide an external procedure that takes
a procedure F and an integer N and returns a memoizing version of F with
a cache of size N; this is on my list of things I would like to
implement in Jade.

> XSL will solve some of
> that, but it is still _supposed_ to be side effect free. (Note: I expect
> there are going to be problem enforcing that...).

XSL isn't side-effect free. However, only localized side-effects are
allowed, along the same lines as I've proposed on this list for allowing
in the DSSSL expression language. I've implemented this for the DSSSL
expression language including the enforcement of the limitations.

I believe that a combination of:

- a general purpose memoization primitive,

- localized side-effects, and

- first-class modes

will be able to solve many of the problems which are currently hard to
solve with reasonable efficiency because of the absence of side-effects,
without losing the benefits that DSSSL currently obtains from
restricting side-effects.

James



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


Current Thread