Older blog entries for rmathew (starting at number 29)

"Things a Computer Scientist Rarely Talks About"
My friend Ananth has just gifted me a copy of "Things a Computer Scientist Rarely Talks About", a very different book by Donald Knuth. Having admired and being in awe of most of Knuth's work and being an atheist, this book should make some interesting reading for me.

Other recently acquired books on my "reading pending" list (besides almost the whole of my library) include "The Art of Unix Programming" by Eric Raymond and "Five Point Someone" by Chetan Bhagat, a novel about life in an IIT.

C++
Nathan Sidwell is on the laudable mission of introducing statically typed trees to GCC replacing the much abused and overloaded "tree" structure. Some people were of the opinion that it might be much better to just write a front end in C++ or at least a reduced subset of C++ ("C with classes"?). Some though were a bit apprehensive of the idea, saying that once you let in a bit of C++, there will really be nothing stopping developers from bringing in all of C++ and then you'd find yourself in a nightmare of trying to support all those C++ compilers on all supported platforms that differ sometimes subtly, sometimes not quite so in their interpretation of the language standards.

Tom has rewritten the GCJ front end in C++ and has done awesomely well and quite a lot in such a short period of time.

Looks like there's no escaping it now...

But...

I have never been able to bring myself to like this language. There is no one thing that I can point to nor can I write detailed and knowledgeable analyses like this or this, though I do agree completely with a lot of points raised in these.

Perhaps it is because of the boring and overly complex book on the language by Stroustrup that happened to be my first introduction to C++ (in a sharp contrast to that masterpiece of brevity, accessibility and utility that was written by Kernighan and Ritchie). Perhaps it is because of the mind-scarring error messages spewed by the versions of the IBM xlC compiler on AIX containing literally two to three lines of mangled names of instantiations of templates. Perhaps it is because of the fact that GCC is so slow compiling programs using the STL. Perhaps it is because I found that as a programmer I had to know so many things about the nuances of the language just to be able to program anything with a semblence of confidence.

I really like object-oriented programming, but I find Java to be way better and much simpler in expressing myself than C++. I would not at all mind if GCC were to be rewritten in Java, though I'm not at all a Java fanboy.

I just want a natively compiled, simple programming language without many "gotchas", that lets me easily express decent object-oriented designs and that comes with a standard and fairly comprehensive runtime library. Perhaps I should take a dekko at Objective C.

(See? This is what happens when Advogato comes back up online after a long time.)

Advogato Is Back!

Finally!

My inane ramblings can now resume.

Mwahahahaha!!!

Small World
Niraj Kumar, who contributed the support for FreeBSD's UFS2 filesystems to the 2.6 series Linux kernel is also from Bangalore!

Not only that - he works for Oracle India as well and in fact sits in the same building as I do!

I am yet to meet him though. :-/

GCJ and Definite [Un]Assignments
I spent most of my free time this weekend trying to resolve some of the issues with definite [un]assignment in GCJ as specified by the JLS.

I just wanted to be able to see zero new FAILs with Jacks, but that goal proved to be quite elusive - I fix one bug and that uncovers problems elsewhere, I fix some of those bugs and they uncover some more, ad nauseam - I had to give up after a certain point and just came up with something that is the least disruptive.

All this effort on something that I do not even agree completely with! I mean, this part of the JLS must be one of the shadiest - Sun has just converted into a specification whatever they felt they could reasonably implement in their own compiler, never mind if someone else can come up with a more thorough code flow analysis and give out less stoopid warnings. Sheesh!

www.advogato.org server woes
Even the Advogato server has been having problems lately! The result is that I've not been able to post diary entries for around a week now. (Not that I have anything insanely useful or profoundly interesting to say, but still...)

The following is what I intended to post around a week ago:

GCC Gets Tree-SSA
After almost 4 years of development, the tree-ssa project has finally been merged into the GCC mainline!

The Static Single Assignment (SSA) form enables all sorts of funky optimisations to be implemented in GCC, making it possible for it to compete effectively with commercial optimising compilers.

Thanks in large part to Jeff Sturm and Andrew Haley, GCJ starts off as a first class citizen in this new avatar of GCC, that too with no libjava testsuite regressions. In fact, the Jacks testsuite now shows 30 unexpected successes (XPASSes) with GCJ and only 5 new failures (FAILs)!

The GCC bootstrap time seems to have regressed by around 20% percent, but one should not forget that quite a bit of new code has been added, not to mention the increased number of Trees that are created and the now redundant RTL optimisers.

And oh, by the way, say "Hello!" to Tree Browser!

ELF DSOs
"How to Write Shared Libraries" (PDF) is a paper by Ulrich Drepper that should be mandatory reading for every serious UNIX programmer. If nothing else, it lets one throw terms around like GOT and PLTs at newbies! ;-)

12 May 2004 (updated 12 May 2004 at 06:05 UTC) »
gcc.gnu.org/sources.redhat.com overseers list
Finally there is a backup for the overseers list for this very important server for Free software.

tree-ssa into mainstream GCC
And so it begins...

gcc.gnu.org Server Woes
The server that hosts gcc.gnu.org as well as sources.redhat.com had to be moved out of its colo facility at a very short notice. Its IP address was therefore changed and the RAM was also upgraded to 4GB. However the corresponding DNS entry's TTL was one whole day, so the IP address change did not quite propagate as soon as one would have liked it to. So we couldn't access the server for that period. However, worse was yet to follow.

The increased bandwidth and RAM somehow caused a RAID driver bug that results in hard lock-ups to show up much more frequently than ever before, with the result that the server is only intermittently up for useful work. (It responds to "ping", but CVS, SSH, etc. seem to be down.)

As of this writing, the server is down again - I really hope this issue gets resolved as soon as possible.

By the way, what I do not understand is why the "overseers" mailing list that is used to coordinate the activities of the maintainers of this important server for free software seems to be hosted on the server itself!

Package-Private Accesses in GCJ
My patches for PR 15073 and 9685 are finally in.

Gmail
Gmail is a real pleasure to use - thanks to Yumpee Saar, I've had a Gmail account for a while now. It still lacks a couple of things and is not as customisable as one would have liked it to be, but it is still so much better than any other web-based email service I have seen. Like so many great innovations, it has so many neat and simple features that make you think "Why hadn't anyone thought of this before?". Nice.

I have since had four opportunities to invite others and my wife, my sister, Kingshuk and Srikanth were promptly doled out these invitations.

Package-Private Class Access in GCJ
This weekend I thought I would try my luck at nailing down another instance of illegal package-private access that GCJ lets through (PR java/15073). As luck would have it, I was able to come up with a patch that fixes that problem. The great thing about this patch is that it also simplifies my fix to the other package-private access problem, by removing a nagging kludge that was needed for that fix to work properly. (If you must know, not_accessible_p() in "java/parse.y" was being called even for classes and not just members as it was supposed to be - the kludge was needed to account for such rogue TYPE_DECLs.) Cool!

GCJ Front End Hacking
A couple of remarkable things happened while I was working on the above. First, my wife got curious about what I was trying to fix and how I planned to fix it and pretty soon I found myself walking my wife through the parsing bits of the GCJ front end, including the Java grammar!

She and my sister then left for a movie that I was not at all keen to watch, so I spent that time at home hacking on GCJ - that resulted in four and half hours of continuous hacking that was masochistically exhilarating, helped of course by the fact that I was actually able to find a satisfactory solution at the end of it.

Such hacking binges are sadly so rare now, but used to be so frequent during my undergraduate days. ~sigh~ :-(

Anyway, I found out that the GCJ front-end is not such a mess after all - there's a method to the madness, as they say, but it requires a bit of patience and perseverance to understand. Of course, to use another cliché, I have just seen the tip of the iceberg - who knows what horrors lurk as I try to delve deeper into the front end?

Anyone wishing to understand the front end should definitely try out Alexandre Oliva's debugx to step through the code using a debugger like GDB to see how it works. Inside a debugger, GCC's cool debug_tree() function can be used to examine a TREE node. The GNU coding standards make it very easy to search for the implementation of a function in a file (ESC/^foobar in vi, for example). The function java_parse_file() in the file "java/jcf-parse.c" provides the "big picture" for the front end.

Illegal Package-Private Accesses Checking
...in the current GCJ is just plain broken. I have had a simple patch for fixing this for accesses to package-private members for a long time now, but the bug had let in a few instances of wrong code to creep into libgcj that were sometimes trivial, sometimes not so trivial, to fix. Yesterday, Michael Koch committed the fix for the last of these problems and therefore I promptly submitted a revised version of my patch for review.

Unfortunately, this still does not fix illegal access to package-private classes though.

Sadder still is that GCJ still has a bunch of problems related to access control. :-(

GCC 3.4.0 Released
GCC 3.4.0 is out with tonnes of improvements! Notable among these are cool optimiser improvements (profile feedback based optimisation and unit-at-a-time compilation), a rewritten C++ parser that brings g++ much closer to standards conformance, much better GCJ and a Java interpreter that can actually run Eclipse 2.x(!), etc.

CVS Updates Over SSH
The slow CVS updates from the GCC repository that I was facing were mostly due to filesystem corruption on the machine hosting gcc.gnu.org and sources.redhat.com. Now that these problems have been fixed, my CVS updates over SSH are acceptably fast over my dial-up link at home.

TrueType Fonts Under FreeType2
If you are in a country where software patents do not (yet) apply - or if you just do not believe in them - you should always compile FreeType2 with TT_CONFIG_OPTION_BYTECODE_INTERPRETER defined in the file "include/freetype/config/ftoption.h". This improves the display of TrueType fonts. However, "Times New Roman" and "Courier New" still do not render nicely enough under Mozilla for me. :-(
(Yes, I do have the Xft/Gtk2/Pango enabled build of Mozilla.)

NV40 a.k.a. NVIDIA GeForce6
Wow!

Awed by GRUB/Linux
I had heard of the "loop" capabilities of mount and the Linux kernel, but I experienced its full utility only yesterday - very, very cool!

We needed to install SuSE Linux apart from the existing Red Hat installation on our machine at the office, but neither was the floppy drive enabled nor was it possible to get a bootable CD burned from the corresponding ISO image from SuSE due to the existing "IT policies". (Yes, big corporations are like this some times.)

So we first reformatted our swap partition as a regular ext3 filesystem, "loop" mounted the ISO image and copied over all the files into the newly created filesystem. Then we used the cool edit-boot-parameters-before-booting feature of GRUB to temporarily boot using this filesystem and proceeded to the actual installation. No floppy or CD required!

SuSE Linux 9.0 has a lot more eye candy than a default installation of Red Hat Enterprise Linux 9.0 and also has a couple of cool extra features. I look forward to exploring this variant of my favourite OS.

But I still love Slackware and yearn for its simple methods.

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