Older blog entries for rmathew (starting at number 126)

Can you write a valid Java program to print out "Hello" on the standard output without using a single semi-colon in the source code?

When Srikanth asked me this question, my immediate and disingenious response was to hide the semi-colon using a Unicode escape sequence like this:

public class Sriki
  public static void main( String[] args)

However, he has a better solution:

public class Sriki
  public static void main( String[] args) throws Exception
    if( System.out.getClass( ).getMethod(
      new Class[] { String.class}).invoke(
        new Object[] { "Hello"}) == null)

Can you come up with a better solution?

FOSS.in 2005 Sessions
The detailed schedule of sessions for FOSS.in 2005 is available now (check out the names of the halls!). The good thing is that there are so many speakers and sessions to choose from. The bad thing is that many of the sessions one wants to attend either clash horribly with one another or overlap partially in incompatible ways. For example, on the very first day at 3:15PM, I have to choose between "Google and Open Source" by Zaheda Bhorat, "GCC Backend and Machine Description file" by Amber Ved, "equivalence configuring" by Andrew Cowie and "Introduction to cross-platform programming techniques" by Jaimon Jose!

Delegates from outside Bangalore might want to check out the annual book sale by the great Strand Book Stall while they are here in Bangalore. The venue for the sale is the Chinnaswamy cricket statium and is quite close to the venue for FOSS.in 2005. Veteran bibliophiles in Bangalore would readily tell you how friendly a store Strand is and how you can get some really good deals (up to 80% off) on books during their annual sale. Unfortunately for them, both Landmark and Crossword have now opened big stores in Bangalore. These stores do not usually give you as good a price on books as Strand, but are closer to the watering holes of many young people and have much more space where you can actually sit down and peruse a book at your leisure. I personally get most of my non-technical books from Landmark now simply because it happens to be much closer to my house and my place of work.

"Information Wants to be Free!"
I really hate it when I come across a reference to a paper or a standard and I am not able to read it because I must buy it or be a member of a subscription plan at prices that are atrocious by the standards of developing nations. In my line of interest (Computer Science), the biggest culprits are the ACM Digital Library and ISO. Fortunately, most of the times I can work around this limitation by using Google with a query like '"<title of the paper>" filetype:pdf' or by taking the help of a friend. I really wish researchers use arXiv or an equivalent service more often. The whole point of publishing papers is to help advance your field, not to retard it, right? (Apparently, the situation is still bearable in Computer Science but is unbearably ridiculous in basic sciences like Physics and Mathematics; hence the genesis of arXiv.)

If I ever publish a useful book, an article or a paper, I would try my best to make it publicly available for all.

More Videos
Apart from the SICP Lecture Videos, also interesting to watch are the Knuth videos, the Alan Kay videos (Part 1 and Part 2), the Hans Bethe videos and the FORTRAN 25th anniversary film. Some stuff in the DDJ Technetcast is also interesting.
SICP Lecture Videos
Thanks to Ramakrishnan (a.k.a. "VU3RDD" on Amateur Radio), I now have the complete set of SICP Lecture Videos. Now I need to burn these videos to DVDs and then take the time to watch them. Thanks a lot to all the others as well who offered to help me get these videos.

By the way, my first attempt to burn these to DVDs failed because I had not realised the sundry incompatible formats in which DVDs come. I had access to a DVD+RW drive and I had initially bought DVD-R discs. Thankfully, I could get a refund on all the discs except the one that I had opened.

More Improvements to GCC
Apart from the projects already planned for GCC 4.2, we now have proposals for Link-time Optimisation, New Register Allocation Method and LLVM Integration. The integration with LLVM, should it happen, would be the most significant change to GCC since Tree-SSA. Pretty exciting times for a hacker to be involved with GCC!

FOSS.in 2005
Andrew Cowie has bullied me into attending FOSS.in 2005 after all. He made me realise what a shame it would be to miss this once-a-year opportunity to meet like-minded Free Software hackers from all over the place when it is happening right here in Bangalore. Of course it also helps to have supportive bosses to grant you leave from work for the period. So here's looking forward to meeting kindred souls. Thanks Andrew!

Subversion, Old Dog, New Tricks
It turns out that I do not need too much of extra disc space for working on trunk and gcjx-branch using SVN compared to CVS after all. This is because I used to always create a snapshot of GCC sources and use it as a working copy for fear of messing up my checked-out sources. Since SVN always keeps a copy of the pristine sources around (which is the major cause of the increased disc space usage) and it is easy and fast to use svn diff to figure out the damage and to use svn revert to restore sanity, I no longer need to continue with my weird model of development. It is also quite simple to just ignore everything from the GCC SVN repository except for the interesting stuff - for the gcjx-branch, my checkout only has the bare minimum stuff needed to bootstrap C, C++ and Java and run the libjava testsuite, while for trunk I have removed all the Ada stuff since I can't build Ada anyways. Of course, all this would probably have been possible with CVS as well, but there weren't nice instructions in the GCC Wiki for lazy souls like me for doing this with CVS.

Videos of SICP Lectures
Most of the coders who have read Structure and Interpretation of Computer Programs (SICP) would agree that it is a profoundly insightful book that teaches you a whole new way of coding. So when I found out that the videos of the SICP lectures given by Abelson and Sussman are now available for download, I was excited. However, my excitement turned to dismay when I found out that the videos were huge - even a single DivX-compressed video of a lecture would bring me perilously close to my monthly broadband download quota, not to mention take an awful amount of time.

So if any of you out there have all these videos already downloaded, would you be willing to burn it to a DVD-R and send it to me? I am of course willing to pay for the cost of the media, package, postage and reasonable labour charges. Drop a message to rmathew AT gmail DOT com if you can. I would prefer the DivX-compressed versions. I had already written to Hal Abelson to know if they provided such a service and they indicated that they don't.

Back From Vacation
I am back from a wonderful vacation in Ooty and the Deepawali holidays. Before going on vacation, I discovered that my Creative 52x CD-ROM drive had gone completely bonkers, randomly opening and closing by itself under any operating system. Apparently, this is not uncommon for these drives from Creative. In any case, I have taken it out and have put in a hard disc that I had lying around in the IDE slot that was thus freed. This was a remarkable coincidence as GCC also moved to Subversion in the interim and I was looking for extra space to fit the bloated copies of the SVN repositories. However, I must first take a backup of the existing stuff on the hard disc onto CDs and that is a painful process I am not really looking forward to.

FOSS.in 2005
There are so many talks I would like to attend in FOSS.in 2005, but it happens to fall bang in the middle of a work week, that too at a time when I cannot afford to take too many days off work. Uggghhh!

OpenOffice.org v2.0
I have been waiting for this release for quite some time now, so as soon as it came out, I downloaded the Linux tarball. To my horror, I find that unlike previous releases it does not contain a simple installer but many RPMs! Why did they have to do this? It is so silly. An alternative for me is to build it from sources, but I do not have the energy or the enthusiasm to do it. Sheesh!

I made the mistake of inadvertently posting a single message to comp.compilers using my office email address and within a day I was being spammed hard! That account had remained SPAM free for almost three years and it is rather painful to see it in the hands of these idiots. Thankfully, Thunderbird is getting better and better every day at detecting this SPAM, so there is some relief.

Subversion and GCC
GCC would be moving to Subversion around this weekend. In general, I feel this is a good move and will probably help our prolific developers a lot. I do have concerns about its alarming usage of disc space relative to CVS though. As it is, my home PC is under a bit of a strain trying to squeeze in GCC mainline and gcjx-branch copies, not to mention snapshots of these that I actually use as working copies, on the hard disc partitions that I have provided to Linux. After the move to Subversion, I will have to make some adjustments to the disc partitions to fit all this stuff in.

However, this will probably have to wait as I would be on vacation in Ooty most of next week.

Dumping Parse Trees
GCJX now accepts an "-fdump-tree" option that prints out the abstract syntax tree of a Java source file to stdout.
A Walk Among The Trees
I implemented a simple pretty-printer for the AST used in GCJX over this weekend. It works just like the debug_tree() function in GCC and is accessed by using the dump_tree() function in GCJX. For convenience, I just change "-fdump-methods" to call dump_tree() instead of dump_method(). That way I can easily see the ASTs created for various Java source files. For someone like me who is new to GCJX in particular and compiler construction in general, this can be quite enlightening.

While debugging the GCJ front-end, I have found debug_tree() to be an immensely useful tool. I hope dump_tree() proves similarly useful for GCJX.

By the way, I added a small page to the GCC Wiki describing how to go about debugging GCJX.

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