Object Oriented Programming in C

One of the C projects I’m working on needed some object oriented features of the type one would normally use C++ for. I thought it shouldn’t be too hard to do some minimal OO stuff in C and it turns out there are plenty of examples and complete frameworks out there to help. If you’d like a complete OO framework for C, Laurent Deniau’s webpage, Object Oriented Programming in C, is a good place to start. The most interesting system described is the C Object System (COS) which is described as “strongly inspired from CLOS and Objective-C and to a lesser extend by Cecil, Dylan, Haskell, Python, Slate and SmallTalk”. The description also notes that COS provides dynamic message dispatching that’s up to 1.5 times faster than Objective-C and generic message forwarding that’s up to 80 times faster than Objective-C. COS is designed to match the simplicity, flexibility, and extensibility of Python, Ruby, or Smalltalk while retaining the efficiency and portability of C. The COS framework is licensed under the LGPL. Pretty cool.

Laurent also describes the Object Oriented C (simplified) framework, which is a small (300 sloc) pile of code derived from OOC-2.0 that provides C programmers with a feature set similar to Java. There’s also “Exception in C”, which provides a Try-Catch-Finally implementation for C.

I also found Axel-Tobias Schreiner’s book, Object Oriented Programming in C very helpful. A PDF version of the book is available online (alternate link).

First Post^M^M^M^M GPLv3 Relicense

To celebrate today’s release of the GPLv3, I’ve released updates of my two ODP-related programs, dumpcheck and odp2db under the GPLv3 license.

GPLv2 – Where the future begins tomorrow

My one complaint about the new license is the changed wording in the How-To section. The GPLv2 How-To section had a neat Thomas Pynchon / Buckaroo Banzai reference to Yoyodyne in the example copyright disclaimer. The GPLv3 How-To section drops the example disclaimer altogether. They also removed the reference to version 69 of the Gnomovision program in the example interactive mode copyright. Whatever happened to Gnomovision anyway?

Random software and robot news

I’ve been doing a little more C programming lately. On the embedded level, I’m porting some odometery and waypoint navigation code written by David P. Anderson for use on my own robot. This is part of a larger project to put together a GPL’d library of mobile robot code. Don’t expect to see it anytime soon but we are making progress.

I’m also trying to squeeze in time to keep up the work on mod_virgule. I’ve made a lot of progress over the last few months, benefiting both robots.net and Advogato. The ToDo list seems endless but next up is some code refactoring and work on the data schemas used for the XML database and HTML entry forms. This work will hopefully allow me to fix a long standing bug in the HTML forms and make the field layouts a little more flexible.

Pycon

I’ve fallen a little behind in my blogging so I better post this before too much time slips by! Since the Pycon conference was held in Dallas this year, I stopped by a couple of times in the hopes of meeting fellow Advogato users. I also wanted to hear Guido van Rossum speak. I did get to hear Guido’s keynote but was somewhat underwhelmed. That’s probably because I come from the Perl camp and was expecting something on the level of a Larry Wall talk. Rossum’s keynote was more of a boring, corporate powerpoint type thing where he listed off random features that might turn up in the next version of Python. At least he made a good entrance. He walked across the conference room to podium followed by a hunched over guy who was banging two halves of coconuts together in Monty Python and the Holy Grail style. In Guido’s defense, he did start his talk by saying his entrace would be the most entertaining moment.

Later, I got a chance to meet titus. Susan and I took him to nearby Kampai Sushi & Grill and we talked about Python, Perl, programming, the problems with the education system in the US, bioinformatics, Advogato, and a dozen other things. He mentioned several much more interesting sounding Pycon talks and panels that I wish I’d managed to hear.

In any case, I enjoyed the chance to hear some talks and meet some new people.

The Year is off to a Good Start for Free Software

Everywhere I look lately, I’m seeing good news about 3D graphics acceleration support for free software users.

Since I started collecting numbers last year, the highest glxgears results we’d seen for any free software driver was a little over 3,000 FPS. Now we’re begining to see number for the R300 code that has been added to the X.Org radeon driver and we have two reports in the 5,000 – 6,000 FPS range on ATI X800/X850 hardware. These may be the highest glxgears number attained on free software to date (if there are higher ones, hopefully somebody will send us a report). With numbers like that, I think the Ubuntu folks won’t be able to use performance as a reason for switching to proprietary drivers (at least for ATI).

A growing number of reports are showing improvments in the performance of the X.Org Intel graphics driver too.

Meanwhile, the nouveau project, which is busy reverse engineering nVidia’s proprietary hardware, has hit a milestone. They posted a screen shot of their driver successfully running glxgears in late December.

Nouveau also came up in a recent debate on the linux kernel mailing list over proprietary binary drivers. Alan Cox suggested getting nouveau’s DRM module (that’s Direct Rendering Manager, not Digital Restrictions Management) into the kernel ASAP. The DRM module is the kernel side of the X.Org DRI driver. The nouveau folks don’t think the code is quite ready but it’s good to know nVidia 3D acceleration is getting closer.

Not enough good news? The Open Graphics Project took delivery of their first OGD1 development boards and are now in a testing cycle. The development board, which includes two FPGA chips, will have a GPU clock rate of 150MHz. Performance is expected to clock in faster than an ATI Radeon 7000 and a little below the nVidia Ge Force2 GTS. The hardware design is completely open and licensed under the GNU GPL. When the development is completed the design will be moved to custom ASICs, allowing a cheaper (and possibly faster) final board for end users.