Archive for the ‘Uncategorized’ Category

Eclipse again

I did a little hacking on Classpath using Eclipse again. You can
really feel like you’re making progress this way: set it up, turn on a
bunch of warnings, and then go fix them all. Eclipse even has a
“Quick Fix” feature that will supply the fix for the really easy ones;
lots of warnings are fixed with just a couple of clicks.

This is a mirage, though. At this point most of the warnings are
trivia. Still, it is fun. All that remains is to wire the Quick Fix
code to Phil Muldoon’s ChangeLog plugin, and Eclipse will be able to
do 80% of the fix automatically.

I’ve also got an Eclipse style file for reindenting Classpath
code; I’ll check that in soon. And I’ve also done a little work on my
own Eclipse plugin, but details on that will have to wait until I’m
more ready.

gcjx

I checked in the private member access trampoline code, which is a
long way of saying: nasty Java compiler hacks that they should have
fixed some other way. I also integrated the bytecode verifier into
gcjx, but it isn’t actually used by anything yet. I’m planning to add
a mode that will let you verify the bytecode it makes, as a debugging
feature.

Sky Captain and the World of Tomorrow

I suppose the comparisons to Buck Rogers (look for the comic cameo
in the movie) or perhaps Metropolis are inevitable, but for me the
immediate comparison was to Careful or Twilight of the Ice
Nymphs
, solely due, I suppose, to the soft and fuzzy filtering.
In any case, this is a movie that starts strong, with a nice visual
style and old-style hooks. And, while the second half contains some
wonderful visuals, plot-wise it degenerates in a more or less standard
action flick. Worth seeing.

Scooby Doo 2

I liked the first Scooby Doo, so I rented this a couple nights
ago. This is a complete stoner movie, but I found it pretty funny
un-stoned. It even has a nice line about its own A-Team
Sequence
from Shaggy: “they’re having a whole montage in there
without us”.

Fedora Core 2

I’m really enjoying Fedora Core 2 quite a bit. It has solved the
memory problems I had with Red Hat 9 — over time RHL 9 would seem to
forget about memory, and after a few weeks I would have to reboot or
else enter swap more or less constantly). It’s like getting a whole
new machine. On top of that, now there’s yum and apt, so it was very
easy to set up all the nice stuff I always put off back in the 9 days.
So, congratulations Fedora people. I’ll probably upgrade to FC3 in a
more timely way, given how nicely this worked.

GCJ

I’m back hacking on gcj again. I’ve been working on the binary
compatibility branch for the most part, and in particular right now
I’m rewriting class preparation and initialization — this was always
ugly code, but the advent of the BC ABI has turned it into sour mush.
Today I got the rewrite not to crash, and I can still run Eclipse, so
there should be checkins relatively soon.

gcjx

News on the gcjx front: Dalibor pointed out that it couldn’t build
kaffe, so I fixed a lot of bugs (and added an iconv input
converter). Now it all compiles; there seem to be some runtime
problems, but neither of us has looked into it yet.

I’ve got a big unfinished patch to add line numbers to the
bytecode as well as trampolines when required. The latter is the last
known remaining bytecode generation issue. (The story is, an inner
class can reference a private member of its outer class, but in this
case you need to generate a non-private accessor method.) I haven’t
had time to finish this up, and unfortunately at the moment gcc cvs
head doesn’t work well for C++.

I also made a branch to hold the multi-threading code. This
doesn’t work yet (Benjamin’s libthread++ isn’t quite ready for
checkin), but the idea is there. In theory with libthread++ in place
you could run multiple parses in parallel, and also multiple code
generators. Semantic analysis is still single-threaded — making this
work will require quite a bit more surgery.

C++

I heard a couple of nice C++ rumors on the gcc list recently (no
links since gcc.gnu.org is down presently).

Answering an earlier question of mine, one rumor says that a
future standard may allow the use of explicit on
user-define conversion operators. If so, nice (though I don’t really
give this rumor much credence).

Second, apparently there is a proposal from Bjarne to simplify
iterations — call it the C++ answer to foreach:

for (auto i = collection.begin (); i != collection.end (); ++i)
   whatever;

Upgrade

Last night I finally upgraded my main machine to FC2. I’m pretty
cautious, since I don’t work in an office and so if I mess things up
I could be pretty screwed. And, I’ve had some really bad upgrade
experiences in the past — in fact a long series of them dating back
to when I was a sysadmin long ago. The funny thing this time is that
my cautious approach is what took up all the time. For instance I
tried to upgrade my lesser-used machine first, but it turns out that
machine is tweaky.

This upgrade wasn’t without other pains. x-chat forgot about my
configuration information, so I had to re-enter it. Likewise, the
Gnome panel once again forgot all my settings… this one was a real
loss, since of course I had 10 launchers and 10 other applets all
nicely configured, and I got to redo that last night. This sort of
thing is super annoying, and on top of that the panel seems to have
had some more random UI changes, so for instance now an auto-hide
panel on the right side of the screen will center itself instead of
letting me put it in the upper right where I always had it. I know,
preferences are uncool, but I actually used this one. On top of that
some of the launcher icons are resized funnily, making them appear
blurry.

I suppose I should report this and all the other goofy things I
found.

UI Note

I like the fact that everything has a tooltip these days. It can
be helpful, especially with the new menus that just say “web browser”
— when what I really want to know is “does it launch mozilla?”.
Sometimes the tooltip will tell me, other times I’ve had to actually
look at the launcher to figure this out.

That said, tooltips on menus are annoying in a way. They appear
too quickly and they tend to blot out some of the context on the menu.
Sometimes, like say when I’m configuring my panel, I’m actually
searching through the menus for something. So I’ve learned to move my
mouse constantly to avoid having the tooltip show up. To me this
seems like a feature that is getting in the way, there must be a way
to change it a little so it is still useful without requiring a
workaround. Positioning the tooltip so that it doesn’t obscure the
menu (or its parent) might work.

Anarchist Sneakers

Check out anarchist
sneakers
.

Hitchens

I read letters
to a young contrarian
last night. I enjoyed Hitchens’ writing
quite a bit. He’s funny, self-deprecating, but also erudite and lets
you know it. His relentless anti-religiosity is sort of a relief in
these — what? — nothingness-forsaken times.

He does include a long defense of reductionism that I thought
missed the point. Most questions don’t resolve to simple moral
principles where we can take an unqualified stand; people adding
unnecessary complexity to a situation can (and his own principles
support this) be attacked on the grounds of disingenuousness; and
finally one might suspect reductionism simply because “all the wrong
folks are doing it.” (There’s a funny, but private, story about this
phrase, but I was too lazy to find another way to put it.)

He did call himself a “soixante-huixtard”, a term I’ve always
rather liked, just because I was born in 68 and feel a sort of literal
affinity for it as a good year :-).

The idea that “only an open conflict of ideas and principles can
produce any clarity” could be said to be one of the underlying
principles of free software.

Word Freak

I also read Word
Freak
. This is an interesting look at both Scrabble and
consequently obsession. I found it quite gripping, though at times
(perhaps necessarily) predictable in terms of its format and topics.
I’d recommend it even to non-Scrabble enthusiasts.

Reading about Maven (not the Java Maven, the Scrabble-playing
program Maven) reminded me of my long-shelved plan to write a program
to play Clue (Cluedo for Europeans). My problem playing Clue was
always finding a nice way to represent all the information going by, I
thought it would be nice to have an omniscient assistant. I looked a
little but couldn’t find a free software program for this.

FindBugs is Cool

I was talking to Dalibor and he pointed me at the FindBugs
paper
, which is super-cool.

Figure 14 (page 10) is particularly interesting. This is the one
where they show Classpath as having 724 flagged bugs in 457 KLOC, and
the 1.5 JDK as having 3,314 flagged bugs in 1,183 KLOC.

First, the size disparity is interesting here. Classpath is about
60% complete (by a naive count that excludes a lot of libraries that
exist but aren’t integrated). This suggests that our code is 64% the
size of the corresponding JDK code. (These numbers are a little
fuzzy, since we aren’t doing comparisons against 1.5 yet, so perhaps
that first 60% is a little high.)

Second, our bug rate is much better: 1.6 bugs per KLOC versus 2.8
for Sun. My theory here is that bugs in free libraries tend to be
fixed, whereas bugs in Sun’s library tend to be worked around. Even
though the JDK source is “available”, it is only available under a
very restrictive license that provides a strong disincentive to bother
fixing problems in it.

I’d love to see us running FindBugs nightly against Classpath, and
mandating that code be “FindBugs clean” (to the extent reasonably
possible).

75%

As I mentioned above, there are free Java libraries out there,
like Tritonus, that implement parts of the standard library but aren’t
part of Classpath. If you roll all these into the nightly comparison,
it turns out that we’re above 75% complete (versus 1.4). That’s quite
good, especially when you consider where we were a year ago.

Sad Day

A hard lesson from vet: we’re merely a syringe away from the
grave.

Today was sad. Elyn’s cat had cancer and was put to sleep. We
buried her and planted a tree.

Eclipse and gcj

One of the big projects in gcj land this year is implementing the
new binary compatibility ABI. I spent today trying it out on
Eclipse.

First I tried to set a baseline, so I ran Eclipse with gij. I had
to add Mark’s little Makefile tweak to make this work (now on the
branch); unit-at-a-time breaks the interpreter at the moment. BTW I
used Eclipse 2.x, since I knew it “should” work — but this technique
doesn’t require application changes, and Eclipse 3 is definitely on my
to-do list.

Then I compiled startup.jar like so:

gcj -fPIC -fjni -findirect-dispatch -shared -g -o GCJLIBS/startup.jar.so startup.jar

After a little tweak to URLClassLoader (also checked in),
this Eclipse started up fine too. Finally I compiled a few more jar
files from Eclipse using the same approach, and that worked too — I
looked in /proc/.../maps to see that the shared libraries
were actually loaded.

This, or something like it, is definitely the way forward. It has
turned precompiling Eclipse from a labor-intensive effort to something
that is basically trivial, and also that applies well to other
applications. There’s still some dispute about where we should look
for the shared libraries corresponding to jar files, but that’s just a
minor detail.

FindBugs

Take a look at FindBugs. They have a
Java bug-finder that found some things in Classpath; it is pretty
cool. I’d love it if this was being run on Classpath every night.
Maybe next time I hack my nightly build infrastructure…