I’ve been reading Dreaming in Code and discussing project planning & management with my housemate. These topics have reminded me of the quest for “plugable,” re-usable software components. The quest has been ended for the most part for those who use Perl. The CPAN provides users of this particular language with a repository of code libraries (modules, in Perl parlance) which can be acquired, installed and applied with minimum fuss. The barrier to entry for getting your code into The CPAN is low to permit new ideas proposed by folks who don’t have the know-how to prepare and revise applications. This tends to cause some problems with regard to the signal-to-noise ratio, but I think it’s one of the primary reasons that the system is so successful.
In addition to this repository of code, which contains a great deal of duplicated effort, lots of modules intended only as prototypes, and pipe dreams which were never completed, third parties provide statistics about the robustness, applicability, and overall “kwalitee” of the code archived therein. As famously noted in Zen and the Art of Motorcycle Maintenance, “Quality” is a subjective concept and cannot be measured as such. “Kwalitee,” on the other hand, is “a set of formalities that tend to coincide with quality, according to consensus.”
There exist tools to analyze code for known problems which cause reduction in “kwalitee.” The action performed by such tools is often called “static analysis.” The sets of rules used in such systems to govern which parts of code are marked as somehow problematic are called “policies.” There can be different classes of policies, for example security, complexity, cosmetic. When developers write code keeping such policies in mind, they are said to be “using best practices.” It’s hard to keep every such policy in mind when building software, so static analysis tools were developed to help gently nudge contributors back to the narrow path.
Why am I mentioning all of this? Why should any more effort be put into building a system of re-usable software if The CPAN already exists and provides all of these tools? As much as I love Perl (and I do! :) ), it has a tendency to be used to fix all problems, even when it may not be the best approach. Sometimes you need to get closer to the processor than an interpreted language lets you. Sure, there’s always XS when you need to do that. But the barrier to entry is high. Another reason is that not everybody loves Perl as much as I do. Some folks want to use (for instance) C++. If the library is written in Perl, and your application is written in C++, you either need to embed a perl interpreter in your application or break your application into different processes and communicate between them. This complicates the application and such complications and prone to error.
So I guess what I’m trying to say here is that we need to take the lessons learned from The CPAN and apply them to a framework that all languages can interact with. In my experience, the most accessible language in terms of inter-language co-existence, the language most capable of getting close to the processor is C. All languages have a means by which they can re-use C libraries. The primary difficulty with C, though, is that it’s hard to get object orientation right with. It’s hard to create an object model that is flexible enough and consistent enough that interface bindings which feel “native” can be generated for every language.
Lucky for us, that hard work has already been performed by the folks at Sun, RedHat, Ximian and Novell. I’m referring, of course, to the GObject framework, the cornerstone of The GNOME Desktop and the Mono CLR.
So the next is a question for you, readers: What are your opinions about building a software repository intended to be “The CPAN of GObject modules”? Are there enough modules in existence to warrant the effort? Is the current system of distribution “good enough?” Is there a critical mass of people interested in using such a system?
Most importantly, is there anyone else out there interested in building this infrastructure? I’ve finally come to accept the fact that as much as I’d like to deny it, I just can’t do everything I want to in the time I’ve been allotted. This seems like a project that would do a lot of good for a lot of people, but it’s just too much for me to do by myself.