Older blog entries for rmathew (starting at number 43)

Jacks
Tom thinks that Jacks should be forked since development on it has stalled and no one seems to respond to any mails. Anyone checking out the Jacks CVS repository regularly or taking a look at the Jacks mailing list archives would also come to the same conclusion. Jacks is a fantastic testsuite but sadly has not kept up with the language constructs introduced in JDK 1.5 (or "Java 2 Version 5" or "Java 5" or whatever) and patches to fix this have been mostly ignored for some reason.

In fact, there seems to be a proposal to merge Jacks with Mauve. That would be really neat. I hope it is kept as a separate module within the Mauve CVS repository though, as compiler and runtime testsuites ought to be kept separate, in my opinion.

As an aside, I found that GCJX gives different results (as is to be expected) when run against Jacks and different values for the --source option. For example, the construct Object foo = 1; now seems to be valid due to automatic boxing. Perhaps Jacks should be modified to tailor the status of testcase executions based on the language level targetted by the compiler being tested. Or perhaps it can just target the latest language specification.

Talking of GCJX, a simple clarification I asked for on the GCC mailing list resulted in a big thread - thankfully, the patch I suggested to work around the issue was approved, so that the part of GCC used by GCJX can now be compiled by a C++ compiler once again.

GCJX
Tom has been having great sucesses with GCJX lately. He announced his intentions to start a branch on gcc.gnu.org to continue with its development. He also wanted to take suggestions for an alternative name for this project. The straightforward one in the grand hacker tradition of recursive acronyms would perhaps be "GING" for "GING Is Not GCJ" or maybe "GRAG" for "GCJ Rewritten As GRAG". Or perhaps "JAC4J" for "Just Another Compiler For Java", though that one almost looks like it has come from a marketroid.

Corrupt RAM Modules
Once again, I have been bitten by bad RAM modules, this time in the Dell Optiplex GX270 machine I use at work. Memtest-86 was able to diagnose the problem after I spent almost a month wondering why programs randomly crashed on me and trying out all sorts of software updates.

Doom 3 on Windows 98
The load at work has finally eased a bit and I can now actually get home in time! ~phew~

So I decide to try out a few game demos ("Doom 3", "Far Cry" and "Prince of Persia: Sands of Time") and finish the full version of "Uru" that had been abandoned when the mad rush to finish the project at work started.

While Far Cry and PoPSoT are gorgeous games, Doom 3 just refused to run on the Windows 98 that I have. Specifically, it needed "GlobalMemoryStatusEx" from kernel32.dll, which is available only in Windows 2000 and XP. Now I am not going to buy Windows 2000 or XP just to play the demo of a game.

Of course others have also faced the same issue but alarmingly people have just been editing the doom3.exe binary to zero out the "Ex" of "GlobalMemorysStatusEx" in the import table to match another function that is available on Windows 98. It seems to work for them, but is wrong because the former method returns a BOOL while the latter does not and the former takes in a struct of a different size altogether!

So using MinGW I wrote a simple dummy DLL named "mykrnl32.dll" which provided an implementation of GlobalMemoryStatusEx using GlobalMemoryStatus from the real kernel32.dll and forwarded all other calls to the real kernel32.dll. The forwarding bit was done by using "export forwarding" support in Windows Portable Executable files. (Interestingly, export forwarding is supported by MinGW's dllwrap tool but not by its "gcc -shared".) I then changed "kernel32.dll" in the import table of the doom3.exe binary to "mykrnl32.dll".

This got me past that particular failure, but I had to do a couple of more tweaks (none related to Windows 98 per se) to get it running. Suffice it to say that I did manage to get it running well enough in the end! So Doom 3 can run on Windows 98 (and perhaps 95 and ME), but doesn't because of some sloppy coding on iD's part - hey even libiberty in GCC knows how to do it right!

However, the game itself was a terrible letdown - it is so dark throughout the game and while the characters look detailed, their klunky contours are quite distracting! Far Cry is much better looks wise (but with terrible controls) as well as for playability (those enemies with their A.I.!) and PoPSoT is far more polished than either of these.

In any case, I enjoyed this little bit of hacking.

GCC 4.0
So the next version of GCC will be numbered "4.0.0" after all! I was hoping this would happen and could never quite understand why some people were so against bumping the major version number.
GCC and Stack Slot Coalescing
RTH does it again - GCC now has stack slot coalescing! This feature is especially important for the kernel developers.
GCC
The pressure at work to meet the project deadline is not letting me spend any time on GCC hacking. :-(

A quick perusal of the lists show that some very exciting things are happening with GCC and with GCJ. GCC will soon be entering Stage 3 and a lot of people are working hard to get their stuff in before that. Jan Hubicka seems to be on a mission to reduce the memory taken up by GCC after the tree-ssa merge. Sebastian Pop has actually implemented loop interchanging for code that ought to have been written properly in the first place - I am happy that GCC is becoming smarter but sad that this would let sloppy code go unpunished.

Tom and Andrew are back at hacking furiously at the BC-ABI for GCJ while Michael has finally liberated GCJ from the clutches of a hacked automake. Bryce seems have taken on the role of the GCJ PR man while triaging (and fixing) a lot of GCJ bugs.

I can't wait to get back...

"Effective C++"
I read this book by Scott Meyers this weekend and grew even less fond of C++! I mean, it's almost as if this language goes out of its way to ensure that you end up with several "gotchas" to worry about in addition to what you set out to code in the first place!

UPS Woes
My UPS by APC was out of action and at a service centre this weekend - it switched off while I was working on my computer and then started emitting these highly irritating beeps that I couldn't quite do much about (it being 11PM in the night). To add insult to injury, the service centre guys apparently kept it under observation for two days and did not find any problems with it whatsoever!

Miscellaneous
GDB 6.2 is out finally and so is Linux Kernel 2.4.27.

"Keeping Programming Fun"
I came across an Ask Slashdot question that touches upon something that has really been bothering me lately - as a professional programmer , how can you keep programming fun enough to dabble in your favourite Free or Open-Source or personal project after work at home?

Many a time, I am just too mentally tired to do any useful programming work at home on weekdays and I would like to keep the weekends free for other non-programming activities (reading books, socialising with friends, watching movies, etc.). So where is the time for a poor hacker to work on his favourite projects?

Some of the possibilities:

  • Work for a company that will actually pay you for your work on your favourite project. Not everyone can be so lucky and sometimes there are other factors (location preference, desired minimum salary, etc.) which make this impossible. In addition, I have this weird problem where a thing becomes totally uninteresting to me and a chore the moment I am asked or expected to work on it by someone else. :-(
  • Work for a company where the day job is not so taxing (usually) on your creative juices, yet pays you well enough to bring food to your table and to pay for your loans (mortgages). In Bangalore, this is a possibility. ;-)
  • Switch professions - get a job that does not involve programming. The problem with this, apart from the need to be educationally qualified to do such a job, is the danger of the job getting too boring or too interesting - the former can be disastrous while the latter saps into your creative juices just the way a programming job does.
  • Forget about personal projects for a while, concentrate on your job, wait for the Peter Principle to take effect and get promoted into management - you will then have more money as well as a job that does not involve coding. Personally, this will profoundly depress me, killing all the enthusiasm I have.

The comments in the Slashdot article linked above provide some more options, but there is nothing that really helped me.

How do you cope up with it?

No News is Bad GNUs
What's up people? There haven't been regular updates on Planet Classpath from a lot of you for a long time... Get off your Glutius Maximii and tell us what you have been up to recently!

SQL and PL/SQL
After almost a decade of "abstinence", I am finally attending a training course on learing SQL and PL/SQL. Two of the big products that I have been involved with at work (at my current as well as previous employer) have had almost all of the core business logic in PL/SQL, so saying "I'm a Java programmer - I won't look at that!" doesn't quite work that well when it comes to understanding these systems.

My fears and reluctance in learning these earlier were mostly unfounded - these are not that bad to learn and to use, though it seems that elegance is something that their designers didn't particularly have high on their minds.

GCJX
I am playing with Tom's GCJX now whenever I get some time, trying to understand it and see if I can contribute a little to add in some of the missing pieces. Last weekend I contributed JAR/ZIP reading. It turns out that this is a bit slower than reading from expanded folders containing the compiled classes.

By the way, GCJX is most definitely much easier to understand and tweak than the current GCJ front end. It also uses standard STL containers instead of the ubiquitous GCC trees or hash tables.

A disturbing thing that I discovered was that GCJX compiled with debugging information is around 48.5MB(!) on my machine and when stripped, comes down to somewhat reasonable 1.5MB. Could it be that we need to exorcise the Template Instantiation demon?

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