[squeak-dev] Generators vs Pipes (again)

David T. Lewis lewis at mail.msen.com
Sun Feb 14 16:35:38 UTC 2010

On Sat, Feb 13, 2010 at 11:46:23PM -0700, Ralph Boland wrote:
>   4) As pointed out in my original posting,  my idea of pipes is really stolen from the
>       (Bash in my case) Linux shell.  In Linux, pipes are used between processes and
>       thus, since Smalltalk supports multiple processes (threads),  a full implementation of
>       Andreas' generators or my pipes should include their use in communicating between
>       Smalltalk processes (threads).

I don't have anything to say one way or the other about generators,
coroutines, etc. But I do agree with your point that the concept of
pipes is quite useful. As a minor correction, I have to point out
that the concept has nothing to do with Linux, it was one of the
fundamental ideas that Unix got right very early on in more or less
the same time frame that Smalltalk was being invented.

Your original posting put forward quite a few interesting ideas, but
taken down to the basics, it seems to me that if you just implemented
the read and write stream protocols (which IIUC is the fundamental idea)
on top of a SharedQueue, then you have a pipe.  You can imagine all
kinds of variations (e.g.  pipes between images, various performance
optimizations, and so forth), but read and write streams on a SharedQueue
should cover the basics with very little new invention required.

In the CommandShell package (which loosely emulates a unix shell with
a perly mashup of Smalltalky things) I used character-oriented OSPipe
and InternalPipe to implement unix style pipe behavior. I always
thought it would be a good idea to replace this with a generalized
pipe of objects (not just characters), and use SmartRefStream to
convert objects to external form when sending them through an OSPipe.

So FWIW I like your suggestion of adopting the concept of pipes in


More information about the Squeak-dev mailing list