by signa11 · 10y ago · 0 comments
can someone please parse this portion of the reply for me ? i think i can get the _glimpse_ of a meaning, but unfortunately don't / cannot grok its complete elegance...
Design implies a coherent intention achieved by a single person or small group of people. Unix was designed by a relatively small group Bell Labs, with a distinct culture.
Linux is probably the best example of evolution, and Linus has explicitly pledged his allegiance to this force. The irony is that Linux would have never succeeded if it were a greenfield project; it needed the "bones" of Unix in order not to collapse on itself. It needed the 20+ years of tribal Unix knowledge spread throughout the world. (See "In the Beginning was the Command Line" by Stephenson)
I do think McIlroy is right. You need taste to "correct" the ugliness of evolution, at least in software. Evolution is important, but so is design. Like all things, neither extreme is right.
Linux exploded on top of the design of Unix. It's time for more design.
Here is a good example of design errors Linux has been making, when it has been trying innovate without the lessons of the Unix model: https://lwn.net/Articles/574317/
"To begin with, he said, much of what is being done with control groups is new; all of it is new to Linux in particular, and some is new in general. So the community did not have any sort of model to follow when designing this new feature."
Just look at all the ad-hoc languages and semi-languages you've got there. Or the source code for the Bourne shell. roff formating. Then add BSD stuff on top of it (e.g. vi, sockets), the X window system, some more outside stuff (emacs, TeX) and you've got a bewildering plethora of icongruent systems way before Linux even splattered onto the scene.
And I would say that McIlroys biggest invention (pipes) is the prime reason why this "mess" actually worked out, by providing a common way to tie these baroque and/or ad-hoc systems together.
Unix never was a bright and shiny diamond of singular design beauty (there we'd have to look at language-based systems, IMHO, like Smalltalk, Lisp Machines, Mesa or Oberon).
As for editors, well, with any application you end up having to trade simplicity for speed or power. For straight-forward text manipulation, "shelling" out is often a good alternative -- those tools might be arcane and baroque too (it's not like regular expressions are particular intuitive), but at least it's something you can use in other contexts, too. But when it comes to speedy and expedient movement through text and files, it's hard to beat a keyboard. And yes, I've used both acme and sam.
Why would a shortcut be the epitome of mystery anyway? Sure, it's not evident on my screen/keyboard etc., but neither is having to use "==" for equality, '.*' for "match some characters" or, heck, these weird English words I'm now typing.
Composition shows up in the following ways:
1) Everything is a file -- open() / close() / read() / write() are polymorphic, with ioctl() and others for the necessary hacks that don't fit the model. Devices are files; sockets are files; pipes are files; /proc is a file system and not a bunch of C APIs. Compare with Windows. This is not to say there's no cost to this uniformity. There is -- serialization and escaping bugs -- but in practice the benefit seems to have outweighed the cost. You can't underestimate composition, because without it your code collapses under its own weight.)
2) In addition to files composing, file systems compose. mount() is a way of composing a uniform namespace from disparate entities. (Not true under Windows)
3) Processes compose. You can do stuff like "sudo chroot ls ...". fork/exec allows one process to set state for another, without code changes to the child. (Also not true under Windows)
4) Language heterogeneity. Via the simple mechanism of the shebang line, shell can invoke awk/sed/Python/Perl/Ruby/JS in the same way. And the shell itself. (You could call this an instance of the Composite Design Pattern).
Unix is certainly messy NOW, but that's because it is so widely used that everyone needed to add their own stuff to it (threads and shared libraries being very popular and arguably anti-Unix). You can try to make something "cleaner", but it will likely collapse under its own weight. There is no uniform model that encompasses all of computing. It's all little truths in specific situations. That's why there are so many little languages.
I've had this argument before on HN: Lisp is not a better Unix. Lisp is solving a simpler problem; decades of experience have shown that. Unix is solving a harder problem, doing it in a somewhat simplistic and strained fashion, but it's the best we know how to do right now. Lisp or Smalltalk don't solve the same problem by any stretch of the imagination.
The design was "strip away as much from Multics to get it running on this crappy computer". That after a few iterations this might generate a philosophy of composition is another matter entirely. And I'm not really arguing against that, at least for a very small subsection of Unix' timeline (around v5-ish?). But the assumption that this was all a masterstroke of, erm, intelligent design seems a bit outlandish.
It seems to have been an element of Plan 9's design, though.
And let's not get into "decades of experience" and "empirically". There's way too few data points and way too much simple economics muddying those waters. By the same argument I could say that Unix really failed, as the biggest applications (nay, the systems themselves) on today's variants are quite monolithic and/or isolated subsystems themselves (browsers, languages, most servers).
The main design idea behind UNIX was trimming MULTICS to fit into a PDP-11 with a new architecture. More effective composition was already demonstrated by Dijkstra's THE, Burroughs B5000, and even MULTICS. Their method, an unsafe language + heavyweight composition, led to a system that was both enabled for composition and quite unreliable/insecure. Later, Wirth pulled on pre-UNIX work to show how much better it could be done with Modula-2 etc. Nastiness of system hid away, type/interface checks, and otherwise just programming modules calling functions in modules. That's composition done right.
It's no surprise that best technologies around improving reliability, maintenance, throughput, etc always involved working around rather than with UNIX model.
" That means it survives, which we have observed empirically."
Empirically, we've observed COBOL on System/360 survived with other mainframe systems. As did Windows monolithic kernels and apps. DOS was all over the place. What survived tells you more about economics and sociology than whether an approach is technically superior.
"Lisp is not a better Unix."
http://www.symbolics-dks.com/Genera-why-1.htm
Yet, UNIX still can't do all of the above despite matching or exceeding many items on list through labor put in. Those rarely crashed, had OS + apps in same language, took you right to OS code with OS-related error, and let you patch live systems to keep them running. On top of LISP advantages like incremental, per-function compilation. I'm a Linux user that doesn't code LISP. Even I still see that UNIX + C architecture can't touch LISP architectures in flexibility and safety combination. And, no, that's not a simpler problem at all given how many PhD's have tried, failed, or only approximated such results in UNIX + C. It's just a simpler, consistent, designed-in approach to solving hard problems instead of scaling up a platform that chopped down ALGOL and MULTICS to fit on a PDP-11 plus some arbitrary changes.
I really don't know where this ideal model of UNIX lives.
All your "not true under Windows" can be extended to all other OSes that aren't UNIX.
Windows isn't the only non UNIX OS, although it appears to be like that to most HN eyes.
I'm not sure how well-supported this is in the historical record.
You give /proc as an example, but it's first appearance was in the 80s, and it took until solaris in the early/mid 90s to really get going. ( https://blogs.oracle.com/eschrock/entry/the_power_of_proc )
Type compatibility enables composition. That is, given functions `foo :: A -> B` and `bar :: B -> C`, you can form the composite `bar . foo :: A -> C`. Unix provides a very simplistic solution that guarantees type compatibility (all I/O is byte stream I/O) at the price of creating other problems (what should be the result of `lseek()`ing a socket?).
> I do think McIlroy is right. You need taste to "correct" the ugliness of evolution, at least in software. Evolution is important, but so is design. Like all things, neither extreme is right.
do you think, 'correction' might actually prune some branches in evolution ? but, honestly, i think that is like predicting the future...
You could be wrong at predicting the future, in which case your system will fail. And that happens all the time. But someone else will succeed (I guess that is another level of evolution, among competing systems rather than evolving features within a system.)
Software, if written and adjusted incrementally, tends to evolve in similar way.
Now, what Mr. McIlroy asks is how can personal taste (i.e. ability of a single person to create small and simple designs) correct that big evolutionary trend.
Open to interpretation but that's my take. You use the word "elegance" and I think that's the idea. Alas, software usually does not "evolve" toward elegance.
tr -h | wc
tr: illegal option -- h
usage: tr [-Ccsu] string1 string2
tr [-Ccu] -d string1
tr [-Ccu] -s string1
tr [-Ccu] -ds string1 string2