[comp.sys.amiga.tech] What should be learned from Unix

doug@xdos.UUCP (Doug Merritt) (08/09/89)

In article <7570@cbmvax.UUCP> jesup@cbmvax.UUCP (Randell Jesup) writes:
>In article <4084@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes:
>>But in UNIX the program doesn't have to *know* what goes on inside the kernel.
>>You have to dig around in internal AmigaDOS data structures to do all sorts of
>>vitally important things... like getting a list of devices, an operation that
>>comes for free with UNIX.
>
>	Hmm, ps seems to know a lot..., and what's the purpose of /dev/kmem,
>eh?  :-)

Yes, ps effectively goes rooting around in the kernel, so in a sense
Unix commits the same sin on that one subject. But aside from it (and
its newer brothers like renice), that's the only exception. In almost
all other ways, Unix very consistently treats everything like a file.

And even with ps, Unix is nominally within the boundaries of that
consistency, for it reads a symbol table from a file (/unix or /vmunix)
to find the offsets in files of what it wants (/dev/mem and /dev/kmem).
There is no poking directly around in memory.  I agree that this is a
grey area and that it is inelegant on an absolute scale, but it is
relatively elegant compared with the AmigaDOS method of directly accessing
device/task data structures in your address space without any benefit
of any consistency metaphor.

Both Unix and AmigaDOS would benefit from extensions that put the
list of tasks (apparently) into a directory where they could be listed
(and perhaps deleted, etc) using standard utilities. Unlike AmigaDOS, this
ability *is* about to appear in a mainstream Unix: V5.4.

Another easy example is kernel patches on disk. With Unix you can patch
a file, /vmunix. Under AmigaDOS there's no supporting metaphor, you have
to patch absolute disk locations. Much as Unix'es metaphor of a file
is derided, it has many advantages over most other operating systems
that do not have *any* consistent metaphor. AmigaDOS's areas of superiority
over Unix would be far more overwhelming if it did have such a *consistent*
metaphor, regardless of what it was.

Everyone always says, well, it *could* be better than Unix in that area
too...such-and-such *could* be accessible from the CLI rather than being
accessible only to programs. But the lesson from history (of Unix) that
is most important, yet most widely disregarded, is that it *is* consistent,
and the user *can* do all that stuff from the command line, and that
all those utilities *do* behave well e.g. with piped input/output.

Unix has, compared with everything but the Smalltalk kernel, the greatest
degree of consistency of application of its underlying metaphor, and that
*inherently* makes it more powerful *overall* than any system with a
lesser consistency. Don't even bother to criticize it until you've got
a system that beats it in this respect. If you can set up message passing
ports between tasks purely via the CLI in AmigaDOS, and if all standard
utilities support this, then you've got something that might start making
Unix look like a toy. But meanwhile, pretending that e.g. AmigaDos is
*already* far better than Unix simply prevents learning from history.

To update Wirth:
(standard data-protocol utilities) + (universal CLI-configurable IPC) > programs

In other words the combination of the first two usually supercedes the
need for writing programs. By now I would hope that everyone has noticed
that this is an emerging metaphor of software design for the 90's.
	Doug
-- 
Doug Merritt		{pyramid,apple}!xdos!doug
Member, Crusaders for a Better Tomorrow		Professional Wildeyed Visionary