Older blog entries for rmathew (starting at number 102)

GoF Honoured by ACM SIGPLAN
The authors of "Design Patterns" have been honoured by ACM SIGPLAN this year with the "Programming Languages Achievement Award". I personally think that this award is justly deserved. Their book has had a strong influence on the way I approach designing a program. I would gladly recommend this book to any programmer - you do yourself a disservice if you haven't read this book yet, for whatever reason.

Unfortunately, I see either a rampant abuse of Design Patterns ("Let's see how many design patterns we can fit into our design for this project") or a refusal to accept that they can have any merit besides being useful in impressing your PHB. Whether by diktat or by choice, if you are trying to come up with an object-oriented design for a project, it helps tremendously to know how other people have solved some of the specific problems in a way that allows the design to remain flexible while solving the immediate constraints. The flexibilities are precisely what come in handy in the face of ever-changing requirements. A secondary benefit is being able to use a common vocabulary to describe parts of your design to others, who can then immediately grasp what you are trying to do.

Prelinking
I have now become yet another fan of pre-linking. It works wonders on the startup times of most applications. Many thanks to Jakub Jelinek for creating prelink for Linux.
28 Jul 2005 (updated 28 Jul 2005 at 09:43 UTC) »
100 Inane Ramblings
I have put in more than 100 inane entries into my Advogato diary by now.

Here is a nice weblog entry (try to ignore the awfully distracting background image) by James Gosling talking about the problems in "correctly" implementing sin() and other trigonometric functions in Java.

Yumpee had pointed me to some nice papers by some of his fellow Googlers a while ago. They make for some great reading. Try to at least read the papers on Google FS, MapReduce and Sawzall (in that order).

Some day, I hope to be able to decipher what Graydon says about programming languages.

GCC v/s glibc
I had configured and built GCC 3.4.4 with "--with-arch=pentium3" and was happily using it for everything till I decided to compile glibc 2.3.5 with it. The build failed with a weird assembler error message as noted in glibc bug-701. That bug however, had been been closed unceremoniously and marked a duplicate of bug-333, which itself looks unnecessarily obnoxious.

After a bit of poking around, I found out that GCC pre-defines "__i686" if "-march=pentium3" is used (see $GCC_SRC_DIR/gcc/config/i386/i386.h) and this was causing the problem with glibc (see $GLIBC_SRC_DIR/sysdeps/i386/elf/setjmp.S). So I had to explicitly use "-march=i386" with GCC to be able to compile glibc. However, "make check" still fails. I will now build and install a vanilla GCC 3.4.4 and see if that is able to properly build glibc.

By the way, glibc 2.3.5 can not be built with GCC 4.0.1, though Dan Kegel seems to have patches to enable you to do it. It can not be built with anything lower than GCC 3.2 either.

Miscellany
I come back from a two-week vacation in Bhopal and find that GNU Classpath crosses a million lines of source code and that Tom has done the big GNU Classpath merge into libgcj that should make importing changes from GNU Classpath much easier than before. I also found out that people were still discussing the semantics of overflow of signed integers in C on the GCC list and that Zack Weinberg has left GCC development.

Daniel Berlin has set up an automated patch queue for GCC patches. All you have to do now is to include a line like:

:ADDPATCH java:
in your patch message and it would be added to the patch queue for the area "java". Cool!

Nvu, the new incarnation of Mozilla Composer and a standalone program like Firefox and Thunderbird, has reached version 1.0. I took it for a spin and was able to easily create a few nice-looking HTML documents. Apparently it also supports CSS, XHTML, etc. but I don't know much about them yet to find out how good it is at supporting them.

After having ignored all this while the RSS and other feed aggregation capabilities of Mozilla Thunderbird, I now find this feature absolutely indispensible and liberating. Now I can waste even more of my time reading weblogs and sites that I otherwise would not have bothered to visit with such regularity.

Barry Andrews became yet another person to let out a primal cry of joy and pride after he successfully built GCJ 4.0.1 for Win32 by following my document. Based on his suggestions, I have refactored the document a bit and have highlighted some of the more important points.

Projects for GCJ
Here are some random projects for GCJ of varying complexity that I would personally like to see implemented as soon as possible:
  • Generics - Although Ken Arnold says generics are a mistake, they are still very useful in my personal opinion and GCJ should be able to handle them. Of course, it would mean fixing PR9861 first.

  • Assembler - a Java assembler is a very useful tool to have, especially when you want to create invalid class files to test bytecode verification. We should either get Jasmin integrated into Classpath Tools, or create one ourselves. The latter option would be eased if we could get ASM integrated into Classpath Tools via Archit Shah's work on a new RMI compiler (which is still waiting to be checked in for some reason).

  • JIT Interpreter - I think QEMU's portable dynamic translation is a really nifty idea and it seems to work rather well judging by the speed at which QEMU emulates a guest operating system. This can perhaps be used by gij to implement a "real" JIT.

GCC Developers' Summit
The proceedings of the 2005 GCC Developers' Summit are now available (PDF). As usual, they make for very interesting reading. I was particularly interested in reading Vladimir Makarov's paper on the new register allocator infrastructure that he is working on since register allocation, especially for register-starved architectures like x86-32, is GCC's Achille's Heel. It seems that the new Tree-SSA infrastructure particularly aggravates the register pressure.

Dan Kegel also maintained a diary of his visit to the summit.

ICFP 2005 Programming Contest
Yumpee and I participated in the ICFP 2005 programming contest over this weekend. The problem was quite interesting and quite open-ended in that one could keep trying different strategies and play them against each other to see how they fare. In the end however, we ran out of time and we could only submit rather rudimentary cops and robbers - a cop that walks about randomly on the map hoping to catch a robber by serendipity rather than by design, a robber that just tries to rob the nearest bank while trying to avoid cops with a two-level lookup and a robber that walks about randomly on the map merely avoiding running into cops.

In terms of the implementation choice, the only middle-ground for the two of us turned out to be C++. I wasted much of the time debugging silly problems that arose mainly because C++ and the STL do not seem to have been designed with comprehension for lesser mortals like me in mind. Oh and we leaked memory with a perverse and gleeful abandon! (And our memory footprint at the end of any match was still less than the default no-op cop written in PLT Scheme that came with the BDK.)

I really enjoyed the coding binge and it was funky trying to coordinate rapid coding with a fellow hacker in a timezone that was 12 hours behind. At the risk of forfeiting the judges' prize, we still have two weeks to tweak our code and implement better strategies before the other half of the problem is announced. However, I'll be bang in the middle of my vacation during that period so it will entirely be up to Yumpee alone.

JumpDrive: Reprise
Today I received a replacement for the dead JumpDrive USB drive from Lexar Media. I am happy with the wonderful customer support service from Lexar Media.
"BSA or just BS?"
Some time back The Economist published a small article titled "BSA or just BS?" (subscription required) that questioned the rather dubious statistical method used by IDC on behalf of the Business Software Alliance (BSA) to come up with an estimate of lost revenues due to pirated software and use that to lobby for even more draconian legislation.

In short, they asked a small group of users for the number of applications installed on their computer (ignoring free applications like Firefox, WinAmp, etc.), used the average number of applications per PC thus obtained to extrapolate to get the number of applications installed on all PCs bought in the country and subtracted the actual sales of applications to get their figure for the revenue lost due to piracy. Very bad and rather disingenious use of statistics that doesn't even stand up to common sensical analysis. So The Economist naturally called it a load of crap.

This apparently enraged the BSA which promptly wrote a gem of a letter that appears in the latest issue and that is worth quoting in its entirety:

SIR - Your article on software piracy was extreme, misleading and irresponsible (``BSA or just BS?'', May 21st). The headline was particularly offensive. The implication that an industry would purposely inflate the rate of piracy and its impact to suit its political aims is ridiculous. The problem is real and needs no exaggeration.
 
Beth Scott
Business Software Alliance
London
I found the deadpan assertion of the penultimate line rather funny.

The Economist also had an article on the recently released OECD report questioning the music industry's dubious assertions that the loss of sales of music CDs is entirely due to file sharing via P2P applications (and not at all due to the alarming lack of quality of the "music" churned out by the industry) which it then uses to convince legislators to come up with draconian laws limiting file sharing.

Sudoku Mania
The first time I read or heard of Sudoku puzzles was in an article in The Economist. A little over a fortnight later, The Times of India's Bangalore edition started publishing regular Sudoku puzzles of moderate difficulty and I have been hooked to them ever since. For those who can't get enough of them, there is also a GPL-ed Sudoku solver and generator.

93 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!