[squeak-dev] Re: squeak XTream

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Dec 2 16:26:53 UTC 2009

2009/12/2 Colin Putney <cputney at wiresong.ca>:
> On 1-Dec-09, at 9:55 PM, Andreas Raab wrote:
>> file := FileHandle open: 'file.txt' mode: 'rb'.
>> stream := UTF8EncodingXTream on: BufferedXtream on: FileXtream on: file.
> For Filesystem, I've been working on something like this:
> stream := aReference writeStream
>        encoding: #utf8;
>        buffer: 1024;
>        yourself
> The stream is responsible for managing the pipeline between its self and the
> handle.
> If Nicolas is writing a separate Xtreams package, though, it's going to
> overlap a lot with Filesystem. Perhaps I should just depend on Xtreams,
> rather than duplicate the functionality.
> Colin

Xtream is not functional yet, it is just a three evenings shot.
Especially pipelines are quite tricky with a forked process... I got
to rest a bit and think.
This kind of implementation natively has good parallelism properties,
unfortunately this won't exploit multi-core/processors any time soon
in Smalltalk...
A few month ago, I implemented a simple Wrapper-like scheme, but was
not satisfied with end of stream handling. Both EndOfStream exception
capture and atEnd tests are expensive when processing elements 1 by 1.
Maybe I'll have to turn to such a more simple scheme though.
Definitely, we should exchange code/ideas.


More information about the Squeak-dev mailing list