Older blog entries for rmathew (starting at number 103)

I have been meaning to check out Lisp (or one of its dialects) for a very long time now. I first came across functional languages (via Standard ML) when we studied Principles of Programming Languages (PoPL) at college. PoPL was also responsible for introducing us to declarative programming (via Prolog). I found these two styles of programming very difficult to grasp as I had been programming with imperative languages (BASIC, Pascal and C) for around 4 years by then. The unfortunate part was that by the time we "got it", the semester was over and we moved on to other things. I told myself at that time that I would learn Lisp and Prolog on my own "soon".

Almost eleven years have passed since then and I still have not come around to actually learning these languages and the programming styles associated with them. Lisp at least keeps appearing on my radar every now and then. The urge to learn it becomes particularly strong when I read about the ravings of the early oldskool hackers in Steven Levy's "Hackers" or one of Paul Graham's articles on Lisp or SICP. Tromey's recent blog entries have once again aroused my interest in Lisp.

Instead of continuing to procrastinate, I want to start learning Lisp now. I think I would start by reading "Practical Common Lisp". I also hope to be able to understand the origins of Lisp by reading John McCarthy's original paper on Lisp. I hope to be able to overcome my revulsion for seeing so many parantheses in even the most trivial of programs.

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.

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.

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:

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
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.

94 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!