[squeak-dev] Faster FileStream experiments

Randal L. Schwartz merlyn at stonehenge.com
Fri Nov 27 05:36:51 UTC 2009


>>>>> "Nicolas" == Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> writes:

Nicolas> The path to a cleaner/faster stream library is longer than just this
Nicolas> little step.  Beside testing, we'd have to refactor the hierarchy,
Nicolas> insulate all instance variables, and delegate as much as possible as
Nicolas> Igor suggested.  We'd better continue on the cleaning path and not
Nicolas> just add another FileStream subclass complexifying a bit more an
Nicolas> unecessarily complex library.

Michael Lucas-Smith gave a nice talk on Xtreams at the Portland Linux Users
Group.  The most interesting thing out of this is the notion that #atEnd is
just plain wrong.  For some streams, computing #atEnd is impossible.  For most
streams, it's just expensive.  Instead, Xtreams takes the approach that #do:
suffices for most people, and for those that can't, an exception when you read
past end-of-stream can provide the proper exit from your loop.  Then, your
loop can concentrate on what happens most of the time, instead of what happens
rarely.

Xtreams is under a liberal license, and is currently in the Cincom public
store.

Instead of reinventing yet another stream package, we should be looking at
Xtreams, I think.

(As a side effect, Xtreams has as a test a very nice PEG parsing package... so
we'd get DSLs for relatively free.)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion



More information about the Squeak-dev mailing list