Older blog entries for rmathew (starting at number 80)

GCC Bootstraps
As anyone working on GCC would know, GCC bootstrap times are getting worse. It is so excruciating on some platforms that it is nearly impossible to keep those platforms up-to-date even if people want to. Of course, many more optimisations, new languages and their ever-bloating runtimes, more comprehensive support for language standards, etc. make it inevitable that bootstrap times increase, but does it really have to increase so much?

On my home PC, a "c,c++,java" bootstrap takes more than three hours and a complete testsuite run takes a lot of time as well. Considering that any change to the main compiler needs a complete bootstrap and testsuite run twice over (once without and once with your patch), that too in the best case of no regressions, is it small wonder that many people who might want to otherwise volunteer to help with GCC development just cannot afford to? I have only so much free time left after my job and my family and many a time I feel I am much better off reading a good book or watching a good movie, for example, than literally losing sleep over GCC. Small wonder then that almost all of the prolific contributors to GCC either work on it as a part of their job or on really fast machines with loads of memory (or both).

Perhaps it is not a good idea after all to have a single compiler codebase support so many languages and runtimes at the same time. Perhaps it would be better to start over by creating a well-defined (in terms of the structure and contract) set of language and platform-independent intermediate languages (different avatars of GENERIC and RTL) and have the front-ends and the back-ends as separate projects from the core framework. Of course, if things were this simple people would have done it already, but a man can dream, can't he?

QEMU 0.7.0 is available now.

"Fortress" (PDF) is a new language from Sun. (Yes, courtesy LtU once more.)

"You and Your Research"
Today I read the transcription of a greatly inspiring speech given by Richard Hamming, courtesy Lambda the Ultimate.
Qt Assistant as a Java API Viewer
I was trying to learn Qt to create a simple Java API Viewer on Linux for my own use, when I stumbled upon the fact that Qt Assistant can be configured easily for displaying one's own help documentation. With a little bit of ugly shell scripting, I was able to create a Qt Assistant "profile" from the JDK documentation index files and now I have a simple but quick and effective JDK API viewer on Linux. Cool!

Needless to say, my interest in learning Qt has evaporated and so has my desire to create a native Java API viewer for Linux.

Coding Competitions
There is a weekly coding competition for Indian coders running right now at www.azealots.com and there are fairly attractive prizes to be won. This is apart from the regular TopCoder competitions. train.usaco.org seems to be a nice site for practising for such things.

By the way, I found a nice set of slides explaining the Static Single Assigment (SSA) form here (PDF).

Lastly, GCC 4.0.0 has been released!

Java Language Specification: Finally Updated
JLS3 is finally available, though only as one big PDF right now. It took them quite a while to update it to reflect the new features introduced with JDK1.5.

I think it is really weird that the specifications for C and C++ are not freely available and that you have to shell out moolah to get them from ISO. Every programming language meant for general developers must have its language specification freely available. On that count, Java fares much better and full marks to Sun for ensuring that.

16 Apr 2005 (updated 16 Apr 2005 at 20:10 UTC) »
Broadband Ahoy!
After many a pestering call and almost two months of waiting, I finally have BSNL's DataOne broadband connection. At 256Kbps it is hardly that "broad" a band, but it is so much better than the old dial-up connection as well as those peddled by most of the competing service providers! BSNL is owned by the Indian government and used to suffer from the usual red-tapism and apathy. In recent times however, it has improved vastly and has become quite competitive with the private telecom operators. By the way, the main reason I went with BSNL instead of the private operators was that most of them used to actively block outgoing connections to several network ports (including tcp/6667 for IRC) in the name of "security" while BSNL does not (so far) have any such restrictions. What's the point of an always-on broadband connection if you can't even chat?

Another very cool thing about BSNL's package is that you get a Huawei SmartAX MT880 ADSL modem-cum-router that has a built-in firewall and is rather cheap at Rs 2000/- for outright purchase. All you need is an Ethernet card. At the moment, the private operators are nowhere close to giving such a deal.

Paul Brook has created a Free replacement for kqemu called qvm86. Both are Linux kernel modules that enable QEMU to run guest operating systems at near-native speeds. kqemu is unfortunately closed-source though it is free of cost for non-commercial use.

SRM-238 was only slightly less worse than SRM-236. Muddled thinking ("coder's block"?) once again ensured that I could solve only one of the problems in the given time. I really suck as a coder. I should also stop writing about SRMs.

Mark Wielaard has written a nice article on GCJ in LWN.net. I did not completely grok Nathan Myers's (ncm) problems with the design of the Java language as written in the comments section for that article. Ditto for Jamie Zawinski's problems with Java for that matter. I have a long way to go before I can even begin to understand some of the objections people have for the design of programming language.

It sucks big time that gtkhtml requires the whole GNOME schmear. Unwieldy dependencies seem to be the general rule in Gtk/GNOME-land. Time to learn Qt.

Code Coverage
I hate having to write meaningless tests merely to improve arbitrarily-fixed code-coverage metrics in regression suites.
Yet another miserable performance from yours truly. The first problem was to find out the task finally left from a set of tasks after the n-th task (assuming the list is circular) is removed and the process repeatedly applied till there is only one left. I took too much time on this one, all because of a rather silly off-by-one error. The second problem was to find the n-th smallest Hamming number given a set of factors. If X1,..,Xn are the given factors, a Hamming number is X1^P1 * ... * Xn^Pn, where Pi >= 0. For example, for 2 and 3, the Hamming numbers are 1,2,3,4,6,8,9,.... My brute-force solution was too slow and timed out for large values. I could not finish this one before the deadline and thus could not attempt the third problem.

Naturally, my rating fell yet again, but the good thing is that I'm back in Division 2 where I should at least get easier problems.

Java Web Start (JDK 1.4.2_07) on Linux (Again)
I found a neater way of working around the bug in Sun's javaws in JDK 1.4.2_07 on a Linux system running kernel 2.6.x and glibc 2.3.3+ that I referred to in my previous blog entry - I wrote a wrapper for waitid() that tolerates the bogus options passed by javawsbin and calls the real waitid() with saner options. With this code, I am finally able to run javaws without problems. Note that this bug seems to have been fixed by Sun in JDK 1.5.0_02.
/* Quick and dirty pre-loaded DSO to make buggy javawsbin
   in JDK 1.4.2_07 work on Linux with kernel 2.6.x and
   glibc 2.3.4.

Compilation: gcc -O2 -fPIC -g0 -shared -o mywait.so mywait.c

Usage (Bash): LD_PRELOAD=/path/to/mywait.so /path/to/javaws <Launcher URL> */ #include <dlfcn.h> #include <sys/wait.h>

int (*real_waitid)( idtype_t, id_t, siginfo_t *, int);

int waitid( idtype_t idtype, id_t id, siginfo_t *infop, int options) { int retVal = -1;

void *handle = dlopen( "/lib/libc.so.6", RTLD_LAZY); real_waitid = dlsym( handle, "waitid");

options = (options == 0) ? WEXITED : options; retVal = (*real_waitid)( idtype, id, infop, options);

dlclose( handle);

return retVal; } /* End pseudo-waitid() */

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