Saturday, November 28, 2009

Exactly Why We Are No Longer UNIX-ish

When we say that Linux is UNIX-like, what are we saying? At my college, we have a course that is named 'an introduction to UNIX using Linux'. All over I hear people use the phrase 'UNIX/Linux' when referring to UNIX-style systems. It is somewhat hilarious to me, as Linux and the surrounding community have, for the most part, left the UNIX philosophy behind. The UNIX philosophy goes as follows:

Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features.

Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input.

Design and build software, even operating systems, to be tried early, ideally within weeks. Don't hesitate to throw away the clumsy parts and rebuild them.

Use tools in preference to unskilled help to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you've finished using them.

The above are all quotes of Doug McIlroy (this is the guy who invented UNIX pipes). He was later known to have said the following in summary: This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.

Another 17 rules for UNIX can be distilled by looking at the design of UNIX.
Rule of Modularity: Write simple parts connected by clean interfaces.
Rule of Clarity: Clarity is better than cleverness.
Rule of Composition: Design programs to be connected to other programs.
Rule of Separation: Separate policy from mechanism; separate interfaces from engines.
Rule of Simplicity: Design for simplicity; add complexity only where you must.
Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.
Rule of Transparency: Design for visibility to make inspection and debugging easier.
Rule of Robustness: Robustness is the child of transparency and simplicity.
Rule of Representation: Fold knowledge into data so program logic can be stupid and robust.
Rule of Least Surprise: In interface design, always do the least surprising thing.
Rule of Silence: When a program has nothing surprising to say, it should say nothing.
Rule of Repair: When you must fail, fail noisily and as soon as possible.
Rule of Economy: Programmer time is expensive; conserve it in preference to machine time.
Rule of Generation: Avoid hand-hacking; write programs to write programs when you can.
Rule of Optimization: Prototype before polishing. Get it working before you optimize it.
Rule of Diversity: Distrust all claims for “one true way”.
Rule of Extensibility: Design for the future, because it will be here sooner than you think.

Linus Torvalds has admitted that the Linux kernel has gotten heavy, calling it 'bloated and huge'. Much of this bloat is due to necessity, but the size is getting to be unwieldy. The size is getting to kill two points in the above. Rule of Extensibility, and the rule of Parsimony. However, we have some other issues besides the kernel. All of the programs that people are so fond of, and willing to defend to their graves have been breakers of most of the above points.

In my last post, I spoke of us getting away from UNIX, and taking a path I dislike. People say that Linux was not a UNIX clone and thus the heritage is pointless. Well, Linux was designed as an open source Minix kernel initially. From there, we can say that Minix was an operating system designed to teach students about UNIX design and operating systems in general. We can also say the GNU was an open source UNIX implementation. If you would like to argue that, why is it that our modern UNIX (Macintosh OSX) uses GNU components?

We didn't have to jump on with X11, where bloat and complexity are present for no apparent reason whatsoever, and where nasty hacks have resulted in even more complexity. We didn't have to jump on with KDE where a lack of extensibility, parsimony, clarity, modularity, simplicity, and repair lead to the need for a rewrite from the ground up, and left many of us hating the new version. We didn't have to jump on with GNOME or XFCE that are facing similar growing pains. We didn't have to sign on with any of this, but we did. We are now paying the price as our systems get heavier and heavier, and like the guys on the other side of the fence (Windows and such), we are going to start upgrading our systems just because our OS demands a better machine.

Sunday, November 22, 2009

The Future of Linux

So here we are. Windows 7 launched and it isn't like the whole world changed. We knew it wouldn't. Snow Leopard launched with much less fan fare, but it brought some changes that someone needed to make. A fully 64bit OS that focuses on multi-core technologies as well the disposal of the Power libraries that permeated the Darwin landscape. Windows and Macintosh will be battling this out for many years to come. What changed with Linux?

With the latest release of Ubuntu we saw some major changes. Things have become more tightly integrated, flashier and heavier. Is this the direction we want? Google Chromium has shown us a Linux system that is only a web browser. The newest Fedora and SuSE systems are very similar to the Ubuntu systems. People are trying to compete with both Macintosh and Windows, and while this is good in gaining market share, many of us are getting frustrated with the increasing lack of customizability.

What was Linux? Just another UNIX clone. What was UNIX? UNIX was an operating system that was built of a kernel and tools. Each tool was a small program that did one thing, only one thing, and did that singular task extremely well. There were then interface programs that would use the plethora of available tools to create complex applications. This idea died. With various groups all trying to create the best UNIX-clone the idea of UNIX fell off the face of the Earth. X11, GNOME, XFCE, KDE, GNU in general (think emacs or GCC), and many other groups got rid of this idea. Whether this was a good move or bad move is mostly a matter of opinion. Clearly, however, we are not going UNIX. We are now headed the same direction Macintosh and Windows are. A single program to rule them all. The extreme of this being Google Chromium OS.