Composing data processors or UI elements?
Composing data processors or UI elements?
Posted May 19, 2011 0:09 UTC (Thu) by Pc5Y9sbv (guest, #41328)Parent article: Announcing TermKit
The blog's second diagram of a process having standard in/out/err and separate view in/out looks exactly like a normal X application to me. You can launch it from a script or command line, and have standard I/O for pipeline composition, but also have the side-channel GUI interface if needed. If there is a problem with this approach for non-GUI processes, it is only because stdout is conventionally overloaded for data stream and textual UI based on the detection of a TTY. A mildly post-Unix environment could easily provide additional standard file descriptors for data in/out, data error out, and operator TTY, allowing for example the use of a process in a data-processing pipeline while also allowing the process to use a terminal-based UI via ncurses or such. A batch pipeline would provide no TTY to the pipelined processes, while an interactive shell could provide psuedo-TTYs to each process and compose them into its own TTY, whether by multiplexing one character-cell terminal or providing multiple emulated terminals in a GUI environment. But, once you start wanting to provide non-textual elements, it is probably better to ditch the TTY-based UI model and just go back to a side-channel to a proper graphical environment.
In either case, you need to address the fact that the data-processing pipeline composition and the UI composition are not necessarily the same topology and actually require a more expressive programming language (e.g. a better shell language) to define both aspects of composition in a reasonable manner. And you would definitely want some standard utilities which could remap a UI channel into a data stream or vice versa, i.e. getting user input and sending it into non-interactive processes at the head of a pipeline, while consuming the output from the tail of the pipeline and putting it back into the UI channel for the user. Or, some combination of this with the native UIs of other pipeline elements.
Completely orthogonal to this issue of separated dataflow and UI is the desire by some to replace Unix's unstructured flows with structure. This can be applied separately to both kinds of channel in a post-Unix environment: object streams replacing byte streams in the dataflow pipeline, or semantic markup models (like Javascript, HTML, CSS, etc) replacing the low-level TTY or X drawing primitives in the UI channel.
