47 points · by _acme · 10y ago · 64 comments
Of course, even C is a simple, tiny language compared to C++.
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.
> 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 string2https://github.com/mit-pdos/xv6-public/blob/master/cat.c to http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f...
https://github.com/mit-pdos/xv6-public/blob/master/echo.c to http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f...
Or even something like https://github.com/mit-pdos/xv6-public/blob/master/grep.c
That's not exactly to say these things are _better_, mind you: the tools have grown complexity for a reason. Namely, the simple versions are very much ASCII focused, for example...
But sometimes, I wonder. I barely use any of the more advanced features of most of my tools anyway. Should I be using some distro or OS which mostly keeps it simple?
http://blog.hostilefork.com/where-printf-rubber-meets-road/
Seeing this, one realizes there is something fundamentally wrong with how their language or libraries work. ;) Personally, I think these things are perfect examples of where a language providing macros, DSL's, and/or generic interfaces can be much more readable. You could just describe the grammar or whatever with ties to specific, low-level functions for the results. Compiler does the rest. Racket people do that kind of stuff all the time. So, do tools from sklogic, REBOL, RED, Julia, Nim... Inherent limitations of C and their coding approaches combining to create trouble. Plus legacy effects.
I marvel at and am impressed by the things that clever shell command chains or carefully constructed regexes can do, but the gap between being able to do those things and when you're awkwardly hunting through man pages and 40 year old docs just to do basic things is huge, and I so rarely need to actually do those things that putting that kind of time in is rarely worth it. Is 3 hours to save 5 minutes really worth my time?
99% of my use of grep is just a simple string search. I don't need an entire esoteric programming language to do that.
I wish more programmers thought like McIlroy. Good taste is rare in programming. He has it.
It feels like a sesquipedalian circumlocution by an ebullient iconoclast :P
And it's pretty clear that McIlroy used “efflorescence” as a metaphor for “proliferation (of features)”. This usage of “bloom” and its synonyms isn't uncommon.
I always thought it was quite a neat compromise - you get the best of both.
$ less --help | wc
237 1298 11912 $ man less | wc
1530 10418 77708All-in-all, less does feel big relative to other programs adhering to the unix philosophy. I tried to do a feature-comparison between more and less just now but, unfortunately, on OSX:
~/src/c$ more --version
less 418