174 Programming However, the Unix kernels, shell, and C language taken together address some large-scale issues that are not handled well (or are often not even addressed) in those languages and environments. Examples of such large-scale issues are certain aspects of memory management and locality (through process creation and exit), persis- tency (using files as data structures), parallelism (by means of pipes, processes, and IPC), protection and recovery (through separate address spaces), and human editable data representations (text). From a practical point of view, these are handled quite well in the Unix environment. Thomas Breuel credits Unix with one approach to solving the complicated problems of computer science. Fortunately, this is not the approach that other sciences have used for solving problems posed by the human condi- tion. Date: Tue, 12 Nov 91 11:36:04 -0500 From: markf@altdorf.ai.mit.edu To: UNIX-HATERS Subject: Random Unix similes Treating memory management through process creation and exit is like medicine treating illness through living and dying, i.e., it is ignoring the problem. Having Unix files (i.e., the Bag O’ Bytes) be your sole interface to persistency is like throwing everything you own into your closet and hoping that you can find what you want when you need it (which, unfortunately, is what I do). Parallelism through pipes, processes, and IPC? Unix process over- head is so high that this is not a significant source of parallelism. It is like an employer solving a personnel shortage by asking his employ- ees to have more children. Yep, Unix can sure handle text. It can also handle text. Oh, by the way, did I mention that Unix is good at handling text? —Mark
The Wonderful Unix Programming Environment 175 The Wonderful Unix Programming Environment The Unix zealots make much of the Unix “programming environment.” They claim Unix has a rich set of tools that makes programming easier. Here’s what Kernighan and Mashey have to say about it in their seminal article, “The Unix Programming Environment:” One of the most productive aspects of the Unix environment is its provision of a rich set of small, generally useful programs—tools— for helping with day-to-day programming tasks. The programs shown below are among the more useful. We will use them to illus- trate other points in later sections of the article. Much of any programmer’s work is merely running these and related programs. For example, wc *.c counts a set of C source files grep goto *.c finds all the GOTOs. These are “among the most useful”?!?! Yep. That’s what much of this programmer’s work consists of. In fact, today I spent so much time counting my C files that I didn’t really have time to do anything else. I think I’ll go count them again. Another article in the same issue of IEEE Computer is “The Interlisp Pro- gramming Environment” by Warren Teitelman and Larry Masinter. Inter- lisp is a very sophisticated programming environment. In 1981, Interlisp had tools that in 1994 Unix programmers can only salivate while thinking about. wc files Count lines, words, and characters in files. pr files Print files with headings, multiple columns, etc. lpr files Spool files onto line printer. grep pattern files Print all lines containing pattern.