Thursday, July 16, 2009

So what's this Linux thing, anyway?

There's a lot of confusion about what Linux actually is, and what it can do, even among experienced Linux users. Frankly, I think a lot of the confusion stems from the fact that people keep referring to Linux as an operating system. It's not an operating system in the sense that people usually mean; instead, Linux is a kernel, which is the core piece of an operating system. A lot of other pieces of software fall under the umbrella of what people usually call "Linux". Many of them are written by GNU (credit where credit's due), but a lot of software for Linux is written by random people all over the world, just for fun. Linux, as usually used by people, refers not to an operating system, but to a bunch of disparate pieces of an operating system that people combine into workable systems.

Perhaps a food analogy would help!

Have you ever been to a Mongolian barbecue place? If not, you really should; it's definitely a worthwhile experience. They have raw ingredients (mostly stir-fry fare) laid out buffet-style, and you select the ones you want, choose your sauce and seasonings, and then hand it over to the cook, who fries up the whole thing on a huge metal plate. It can be a bit intimidating if it's your first time having it, but once you get used to it it's a really fun way to eat.

Linux works like a Mongolian barbecue place. Instead of selecting a prepared OS off a menu, you can take all the component ingredients and combine them into something that suits your tastes. Linux distributions are kind of like recipes - you get a good starting point, but you usually have a lot of leeway to customize what you start with. Traditional operating systems, in this analogy, are more like dishes that you order off a menu - you get a few choices, and you pick one, and that's that.

There are some really important consequences of this. The first is that the set of libraries and services that you can expect to be installed on any given Linux system is pretty fluid, because of user preferences. This can make it difficult to write software that will run well on all Linux systems, as the Google Chrome developers discovered a few months ago when they were looking for a GUI toolkit to use. (See this widely quoted thread.) Another concrete example is the state of audio APIs on Linux. (Summary: ALSA is horrible but everything uses it because it was the only game in town for a while; PulseAudio is nicely designed, but still buggy, and looks like the current favorite for the future; OSS was dead for a while because of licensing issues, but may be making a comeback, since it seems like a very clean solution technically.)

Because of this, integrated package management is a necessity for Linux systems, not just a convenience. On a normal operating system, you have a set of interfaces that you can basically count on being there when you distribute software. You can download programs from random places on the Internet, or get then on CDs, or whatever, and they basically just work. On Linux, on the other hand, programs need to explicitly state their dependencies somehow, since you can't always count on them being there, and the system needs to be able to go and install those automatically, or the whole thing would be too cumbersome to use. This is a mixed blessing, because while integrated package management has definite advantages in terms of security and ease of use, it makes things more difficult for developers that want their software to run on Linux.

Linux on the Desktop

There's been a developing tension over the past few years between people pushing for easy-to-use Linux on the desktop, and those that want a lean, minimal UNIX-y OS. The former group includes most popular Linux distros, since widely-used distros are usually the ones that aim to be user-friendly. The latter group, on the other hand, includes a lot of experienced Linux users, who've been around since before many of the recent changes to desktop Linux. Part of the push for making Linux more user-friendly and integrated involves adding a whole slew of new components, such as HAL, D-Bus, various packages ending in -Kit, PulseAudio, and others. These work well, and generally do what they were designed to do, but they lack the simplicity and transparency of the UNIX underpinnings of the OS, and a lot of people resent these changes because of that.

There are dozens of Linux distributions catering to either camp, and quite a few that take up various points in between them. This may indicate that Linux is now diverging in two separate directions; I can't really say. I don't believe that this would be a bad thing, though. One of the defining features of Linux is choice, and the ability to choose between different types of operating systems fits naturally into that. Even so, this is tremendous change in the Linux environment that needs to be acknowledged, whether or not people agree with it. We might look back at this as an epochal shift, or we might shy away from it and see it in retrospect as a huge mistake, but either way the consequences will be huge.

So what is this Linux thing, anyway? Linux is the result of a bunch of programmers that, mostly independently, decided that they wanted their operating system to do more, and that did something about it. It's fractured, sure, and it lacks any kind of overall guiding vision. Thousands of people work on it, and yet, somehow, through some kind of miracle of self-organization, the whole thing doesn't fall apart or spontaneously combust. I think that's pretty neat.

No comments: