Archive for September, 2004

GDirect Again

This evening I spent a little time hacking on GDirect. No new
features, but now it is purely JNI based. This means it is portable
to any JVM that uses JNI (i.e., basically all of them). I even tested
this theory using both gij and the BEA JDK. Eventually I’ll probably
add some gcj support to make it work more efficiently there, but that
is lower priority than a few needed features. If you’re interested
you can find it in the gcjx cvsroot on sourceforge.

GDirect and Others

I did some research today into alternatives to GDirect. Time to
do a little more hacking on it, I suppose.

I’ve been talking to the NativeCall guys for a
little while, hoping to convince them to take a more GDirect-like
route. Their approach is more like Java reflection: construct an
object representing a native call, then use an invoke
method on that object to actually call it. This is a nice idea,
complementary to GDirect’s current approach; I’ll probably add it at
some point. Unfortunately they’re taking the wrong direction
implementation-wise, writing custom inline assembly for each kind of
method call. This will never scale. By way of contrast, even in its
half-baked state GDirect already works on 11 architectures for any
combination of (primitive) arguments and return types. Also, the
reflection-like approach is great when you need to call a native
function in a fairly dynamic way; but GDirect’s current approach is
superior when you want to wrap a native API. Both are probably
needed.

Noodle
Glue
sounds really great but, as far as I can tell, is not open
yet. (There are a couple other proprietary libraries in this space
too, like we care.)

JNIDirect is basically a
free version of the non-free inspiration for GDirect. Reading through
the white paper indicates that it has some functionality I hadn’t
thought up yet, so that’s cool. It seems to be Apple-specific, so
that isn’t very interesting.

Jace looks
more like a library to make JNI friendlier. Basically it lets you
write something like CNI that is portable across VMs. That’s pretty
cool (though not exactly what I’m looking for). It would probably be
worthwhile exploring how to make CNI and Jace source compatible.

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.