Nicolas,
the design of your version lacks composability.
Also, i seriously think that read and write streams should not be
married under same class.
This could be a paradigm shift for many people, but not for me, since
i dealt with real-time
network communications in the past and can say that network
communication based on bidirectional data flow
really sucks, because it doesn't scale.. and don't works for more than
2 peers :)

By its nature, data flow is unidirectional. Trying to unify things and
present it as a bidirectional
leads to bad code, bad usage patterns (see RemoteString) and
endless discussions around 'do we need a multiple inheritance or not'.

If i want to read from stream, i can do it like following:

file := 'foo.txt' asFile.

reader := file readXStream.
reader next

if i want to write something, i do

writer := file writeXStream.
writer nextPut: $x.

and if i need to read & write both, then i probably should tell writer
and reader
to share same state, like file handle, cache, buffers etc, but not to
be the same object.
so, if i need to write, i should use writer, and if i need to read - i
should use reader..

Concerning composability, this is a cornerstone of VW XTreams implementation.
And after watching their presentation at ESUG, i can say that your
implementation completely miss the point (sorry).
Seeing how simple i can build complex parser(s) by composing multiple
low-level parsers
in PetitParser, nobody can convince me, that its a bad idea for streams.

Why i can't simply do:

reader := 'aaa.txt' asFile readXStream.
utf8Reader := UTF8Reader on: reader.
?


On 8 October 2010 00:51, Nicolas Cellier
<[email protected]> wrote:
> 2010/10/7 Stéphane Ducasse <[email protected]>:
>> pay attention that there are two xtreams package frameworks from what I 
>> understand
>>
>>        one presented at esug and one developed by nicolas
>>
>> Stef
>>
>
> Now, I wonder if I should not rename it SqueaXtream or something -
> apologize for not being Pharo-tically correct ;)
>
> Nicolas
>
>> On Oct 7, 2010, at 4:58 PM, Sven Van Caekenberghe wrote:
>>
>>>
>>> On 06 Oct 2010, at 08:48, Nicolas Cellier wrote:
>>>
>>>> See also hijacked  http://www.squeaksource.com/XTream.html borrowing
>>>> some of the ideas, but somehow less extreme.
>>>> Most packages should now load in Pharo.
>>>
>>> Hi Nicolas,
>>>
>>> I have been looking at the ESUG 2010 slides & google code project pages of 
>>> xstreams and I must say that I like this very much.
>>>
>>> Your code on SS does indeed load in Pharo 1.1. 8 tests fail out of 37 with 
>>> errors that I think are probably fixable. I am browsing it now.
>>>
>>> Now my question is, first, do you have some write up somewhere explaining 
>>> what you did and why, and second, what is the current state of your project 
>>> and what are your future plans/goals ?
>>>
>>> Thx,
>>>
>>> Sven
>>>
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [email protected]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [email protected]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



-- 
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to