EIO Redesign

From Erights

Revision as of 19:23, 28 January 2011 by Kevin Reid (Talk | contribs)
Jump to: navigation, search

As the only implementor of EIO, Kevin Reid feels that the original EIO design is too heavyweight; it effectively requires input streams to have buffers and an elaborate queueing mechanism, and does not map well to POSIX IO operations, thus creating inefficiency and discouraging compositional programming.

XXX Explain whch API variant the last kEIO implements.

XXX Explain whch API variant current E-on-CL implements.

Redesign goals

  • A stream should be able to wrap a POSIX file descriptor without hiding too much of the functionality. In particular, it should be possible to implement, for example, a console-IO process, which must not read from stdin until it actually wants user input (or be suspended if it is a background process).
  • It should be possible to write interesting and lightweight wrappers around stream objects.
  • It should be possible to interconvert between sequences and streams readily.
    • Furthermore, given that we can convert a sequence to an input stream, streams solve another design issue: parallel iteration. Currently, there is no way to iterate over multiple collections in parallel without explicit indexing (because iterate is internal iteration); whereas a group of stream objects can easily be read in parallel.
      • Doing this introduces another requirement: It should be possible to iterate over a map, and obtain the key-value pairs.

Version 1


Personal tools
more tools