[plt-scheme] Space/time behaviour of Lazy Scheme

From: John Clements (clements at brinckerhoff.org)
Date: Tue Oct 16 19:43:11 EDT 2007

On Oct 16, 2007, at 3:16 PM, jerzy.karczmarczuk at info.unicaen.fr wrote:

> Eli Barzilay writes /a propos/ the Lazy Scheme bug
>> OK, that's fixed.  If you want to patch it up to use it, look for  
>> this
>> line
>>                 [(promise? p) (loop p)] ; hide sharing in  
>> "collects/lazy/promise.ss", and change it to
>>                 [(promise? p) (loop (p:ref p))] ; hide sharing
> Indeed, it works. At least this endless loop is no more. Thanks.
> A question, just for my general culture...
> Since, by design, there are no global replacements of once-evaluated
> promises by their results, somehow in my head I have - despite what  
> you say
> - that the difference between lazy Scheme and, say, Haskell or  
> Clean is
> still very profound, and an attempt to make a truly lazy Scheme would
> demand changing the compiler. Am I wrong?

I think that you're more-or-less-wrong, in the following sense:  in  
haskell, an unevaluated value is replaced by an evaluated one.  In  
lazy scheme, an unevaluated value (#<promise: *unevaluated*>) is  
replaced by an evaluated one (#<promise : 7>).  Are you concerned  
about the way the value printer works?  Or about the extra memory  
taken by the promise?

Put differently: I think that the kind of difference you're talking  
about is largely equivalent to, say, an unboxing optimization that  
shrinks the representation of certain values in certain programs.  In  
other words, not something that changes the meaning of a language.

All the best,

John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2223 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20071016/59c2541a/attachment.p7s>

Posted on the users mailing list.