Posts in Category "Open Source"

Building a Common Infrustructure

I recently participated in a study on open source software conducted by Oliver Alexy at Technical University of Munich. I just received the final report – not yet public but I’ll post the file or a link if/when I can. It got me thinking about the problems corporations face with open source, the protectionist attitude which is so prevalent in the software industry, and the challenge of building a common infrastructure.

When Alex Stepanov created what is now the “C++ Standard Template Library,”:http://www.sgi.com/tech/stl” his intention was that the library would be an example of how to write such libraries which can be heavily reused and are minimally intrusive. Although STL is a success, and there have been many libraries built using ideas from STL, for the most part Alex’s vision of having a very rich environment of many algorithms just hasn’t happened. If you’ve been following Alex’s “notes on programming”:http://stepanovpapers.com/notes.pdf then you get an idea of how much STL itself could be improved.

What I’d like to create is a environment where computer scientists could collaborate on a library of algorithms, the concepts upon which the algorithms are defined, and data structures to support these concepts. I’d like this to be language neutral, with documentation for various languages describing how ideas such as refinement, models, and type functions are implemented along with quality libraries for many languages. One of the largest hurdles in making such a library a success is getting past the protectionist policies of companies such as Microsoft and Apple so they can use, and contribute to, such an effort. My hope was that releasing ASL under the MIT license would encourage Apple and Microsoft to borrow and contribute to the effort – so far that hasn’t happened.

Just today I was trying to hunt down what Apple recommends as the replacement for the deprecated Carbon API, SetCursor() – after much searching I found “example code”:http://developer.apple.com/samplecode/CarbonCocoa_PictureCursor/index.html of how to use the Cocoa NSCursor to replace it. The sad state of affairs is that all the cursor libraries I’ve ever seen are remarkably similar with only superficial differences – yet to the best of my knowledge no one has tried to get to the minimal requirements for a cursor and write this API for the last time.

With ASL we’re trying hard to define “concepts”:http://opensource.adobe.com/group__asl__concepts.html as we discover them. Currently our notation is C++ centric and as such even our definition of “regular type”:http://www.stepanovpapers.com/DeSt98.pdf is only an approximation. I have some ideas about how to get such a library started and I’m sure I could quickly round up some university involvement – but I’m at a loss as to how to penetrate the protectionist commercial environment and ultimately I believe that will be necessary for success.

The Importance of an Eco System

In my ongoing attempt to buy a decent “iPod alarm clock,”:http://blogs.adobe.com/sean.parent/2006/08/a_crippled_huma.html I discovered the “Big Screen Zip Connect”:http://www.sharperimage.com/us/en/catalog/product/sku__SI324WHT from Sharper Image.

The unit has several nice features I’ll never use like the ability to tune to non-US radio stations and listen to TV (I don’t get any broadcast signals strong enough at my house). The unit is also pricey – $173 w/tax and the iPod Remote Zip Connect. I never thought I’d use the Sound Soother feature but found I like it – as does my wife. The volume for waking to the iPod has three choices, “Soft”, “Loud”, and “Ramp” (from Soft to Loud). “Soft” has a volume level of 5 (on their scale of 0 to 99). Again, on this device I wanted a volume of 2 but gave it a try. Still too loud, not as bad as the other units but bad enough that I’m returning it. Worse, the machine “pops” the speakers when it powers up the alarm, and if you hit the snooze or the alarm off you get a loud “beep” confirming your selection. The result is “pop…hmmm…MUSIC…BEEP!” – all I want is “music…” is that so hard? I tried waking to the soothing sound of the ocean – still loud enough to drown in. There are other UI problems, like you can turn off the iPod with the units power switch, but you can’t turn the iPod on, you have to lift it out of the unit and use the iPod controls. So this unit goes back and I’m looking for another.

What was interesting with this device though is the “Zip Connect.”:http://www.sharperimage.com/us/en/search1/searchresults.jhtml?_DARGS=/us/en/include/standardheader1.jhtml.13 Sharper Image has taken nearly all of their audio gadgets and added a proprietary Zip Connect to it. Each of these devices comes with a module to adapt the connector to a standard stereo mini line-in. You can buy an optional module to connect to your iPod which will play through the unit while charging the iPod, and some unites allow you to control the iPod. None of the units that I saw cradle the iPod as well as most iPod specific accessories but their functional and work with any iPod. The Zip Connect is Sharper Image’s way to protect themselves in case Apple suddenly changes connections or they may support other devices in the future.

Having owned a Palm V, m505, Treo 600, and Treo 650, all of which have different connectors, I can appreciate this. I’ve spent a fair amount on accessories for older units which I couldn’t use with new units. This became a barrier to upgrade and with each upgrade I’ve been hesitant to invest in more accessories to avoid lock-in. I’d still be running the Treo 600 except it failed one month out of warrantee. Had Palm stuck with a single connector – they could have a rich eco system as the iPod does now.

The Sharper Image approach is the hardware equivalent of a private, pure virtual function call – it’s expensive (costs you $10 to subclass + added cost for default line-in module), it can’t do anything without a subclass, but it does provide some flexibility for the future – but only friends of Sharper Image can provide modules.

Ideally, we’d have an open standard for such connectors (maybe call it USB) with standard protocols for controlling audio devices. Carefully thought through, legacy devices would either just work or only require a small adapter – but new devices would plug right in. But for now, Apple, Sharper Image, Palm, and most other manufactures are sticking to the proprietary interfaces. Even if I do settle on the Zip Connect device, I still can’t plug my Treo into it.

The software solution to this problem is standardized Concepts. C++ provides the requirements for items such as iterators but stop short of semantic requirements. Even the most basic requirements of “regularity”:http://www.stepanovpapers.com/DeSt98.pdf are not universally adhered to. A colleague recently sent me a piece of code which contained the following:

//---
Matrix Inverse (const Matrix &M)
{
Matrix S(M), T(M); // temporary matrices of the same size as M

T = M;
//---

Without the comment, I would likely have deleted the assignment – there is something very wrong when a copy constructor doesn’t copy. A Zip Connect won’t help you here.