[plt-scheme] graphs / shared

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Oct 20 19:02:28 EDT 2005

On Oct 20, 2005, at 5:54 PM, Yoav Goldberg wrote:

> Hi,
> In another thread, graphs were suggested as replacement for streams.
> I tried to play with them (a little) and didn't get very far. They
> seem very nice for the simple things (well, for graphs), but there are
> some things that I can do with streams that I don't see how I can
> achieve with them (or maybe I didn't understand the answers I got
> then, and it is really not possible).
> I would like to learn how graphs can be used to construct a finite but
> long repeated sequence, in a manner which is as efficiant as streams
> in terms of memory usage..

Have you actually measured the memory consumption disadvantaged before
you jump to this conclusion?

Sure, you may up front for the repeated patterns. But if your program
is strict up to this pattern, you will create that many closures. They
consume space.

I recommend in such cases to develop two core programs and to get
a rough idea about memory consumption in standard cases.

-- Matthias

Posted on the users mailing list.