Friday, 16 October 2004

      flow is a streaming and device driver framework I wrote for Smalltalk. My motivation (in 1996) was to provide a simple way to write new network clients and servers, allowing the developer to spend most of the time thinking about novel protocol details, instead of common infrastucture. At the time, I was on a team developing a new computing platform, designing the device driver architecture. After I got the sockets stuff working, I realized I had something that would work well for writing device drivers in general.

      The framework handles much of the recurring implementation details in writing new clients and servers, and cleans up several things in the traditional Smalltalk streaming framework. It includes a NetStream hierarchy whose instances can stream over several different external resources, including TCP and UDP sockets, MIDI ports, files, and serial ports. I finished the first implementation in 1998.

      When I made the 3.2-compatible release (in August 2002, when 3.2 was the latest final Squeak release), I decided that making releases of something so low-level like Flow, for a moving target like Squeak, was so painful that it was time to address what I saw as fundamental problems with Squeak's system organization. That's one of the main reasons why I'm working on Spoon.

      So, Spoon has taken Flow's place on the front burner. But I've also extended Flow in the meantime (in particular, to support pleasant streams on MIDI devices, which is *really* useful, and several buffering fixes). I use it every day. There's plenty of great stuff done, waiting for a new Flow release, but I want to make the next release using Spoon.

      The support for sockets is significantly different than that currently in Squeak. The main differences are a Berkeley-style (and non-polling) primitive interface and a simpler and more efficient scheme for synchronizing Smalltalk processes with socket events. For details and a sales pitch, please read this (hopefully) exhaustive comparison of my framework with Squeak's.

      As if that weren't enough... the current implementation of flow also depends on a different implementation of streams than that used in the official Squeak release (I refactored the Stream hierarchy for several reasons). This reimplementation is included in the main flow release (and after installation, the changes are recorded in separate change sets).

      The current release features support for writing socket-based clients and servers, and for using files, speech synthesis and recognition, serial ports, and parallel ports. Other transports (MIDI, digital audio, firewire, and infrared) are coming.

      flow uses its own networking primitives, in plugin format (you don't need to rebuild the virtual machine to use flow).

      You might also be interested in this streaming tutorial I wrote.

      Thanks in advance for any feedback!