Retrofitting New Principles Onto Mature Systems

A large, mature system is retrofitted with a new feature (paradigm or principle) that crosscuts all functionality.

The result? Judge for yourself.

Why do retrofits fail? Because the new principle / paradigm is subordinate to the existing ones, it is strictly second class.

A clean architecture with the new feature is an instance of YouCantGetThereFromHere

What's wrong with Unix GUIs--and how exactly is "everything is a file" (which isn't really true in Unix--lots of kernel objects are not files) affect the GUI? Unix (and Unix-like systems) have had lots of graphical user interfaces (some excellent, some not). Among them:

Unix still seems to have a bad reputation left over from the days when X provided a crude windowing system, and little more--many tasks which should have been handled by the windowing system were left to applications. But the issues plaguing GUIs on Unix systems have everything to do with politics and corporate greed; and little to do with the underlying architecture of Unix. And certainly nothing whatsoever to do with the myth that "EverythingIsa" file in Unixland. Perhaps that's true for PlanNine; but that's not Unix.

-- ScottJohnson

"Myth" is hardly the word. "Everything is a file" is a famous slogan and goal of Unix, but kernel objects have nothing to do with anything. Unix failed at literally making everything a file almost immediately, in the realm of I/O device control, so that the special purpose stty(2) (especially pre-version 7) and ioctl(2) (increasing in use at supersonic speed starting with version 7) and some other such miscellaneous system calls had to be introduced to e.g. change serial line baud rate to modems and terminals.

Unix partially succeeded in that goal otherwise, and especially keeping in mind that it was meant in sharp opposition to other operating systems of the day. For the most part "everything is a file" in particular meant "a sequence of 8 bit bytes with a uniform API", whereas other OSes required entirely different system calls to deal with a record-based file than with a text file. Even directories were originally just files, in this sense; although marked with a "directory" flag bit, they were just sequences of bytes showing the inode and name of each file "in" that directory, and those directory files were read (e.g. by ls) using the same read(2) system call one used to read text files. Conventions like the "." and ".." entries were carefully maintained only by the mkdir and rmdir commands, nothing else, in the name of "everything is a file".

For the purpose of this page, the point is not whether X11 and its window managers and apps provide a sucky user experience, which has already been argued ad nauseum elsewhere, the point is that there is nothing whatsoever about X11 that even remotely pretends to be file-like. There is nothing whatsoever about X11 that fits into the original "everything is a file" approach.

One nitpick is that, with some X11 implementations, communication (events) between X11 client and server take place over a socket which is at least represented by a file descriptor, and therefore is partially file-like, however that is purely implementation specific. There are X11 implementations that use shared memory and no socket.

This means that one cannot wait on X11 events at the same time as file events (including TCP/IP events) using the select(2) system call, which is a truly horrid botch that requires enormous amounts of work to work around.

So it is true, retrofitting X11 onto Unix is indeed an example of nasty problems arising from RetrofittingNewPrinciplesOntoMatureSystems.

An example of the opposite is/was the Amiga, which had a nice clean message passing model at the foundation of its OS, and its GUI used messages just like everything else. (It did have a similar problem, though, in that they ran out of time and had to hurriedly buy a filesystem from the TriPos? OS and graft it onto the side; it was written in BCPL and exposed oddball BCPL and TriPos? notions in the API that were ugly and different than the rest of AmigaOs.)

-- DougMerritt

The original Unix SystemMetaphors were "everything is a file" and "every program is a filter". All Unix GUIs and graphical applications violate these metaphors in a big way. PlanNine has reinstated the "everything is a file" metaphor only by destroying the CDs and starting from scratch.

Related: BurnTheDiskpacks

EditText of this page (last edited October 27, 2009) or FindPage with title or text search