Archive for the ‘Uncategorized’ Category

Java versus C# Delegates

This white
paper
explains why Java doesn’t have C#-style delegates. It
should be read with care; the “application footprint” section is
pretty bogus, contrasting the existing reality of delegates with a
hypothetical (but easily possible) future world where anonymous
classes have less metadata.

What I found most interesting about this paper, though, is its
bigger mistake. Much of its argument is actually quite reasonable.
However, it completely misunderstands the psychology of programming
language adoption by developers, and in particular of those developers
most likely to imprint on a language and argue (usually inanely) about
its details. People in this mode don’t want to hear reasons why not,
they want notational convenience. I’m there myself when I complain
about missing UI interconnects and missing Gnome features… I don’t
care about the cost, I just want the darn feature.

Usually languages handle this by using their bureaucracy to thwart
some kinds of additions — which is usually a good thing. Java is no
exception here, but the situation is somewhat unusual because C#
occupies such a similar niche but has a very different design
philosophy.

C++/CLI

I read a draft of the proposed ECMA C++/CLI language
specification. This thing is so bad that it is hard to know where to
start critiquing it. How about, context-sensitive keywords? Or, my
personal favorite, keywords with embedded whitespace? This latter is
scarily close to Dalibor’s joke that some future Java will have
keywords in color… “oops, you want the salmon ‘if’ there”.

(This will actually be an important development for two reasons. First it will allow the
long-promised but never-quite-actualized crossover between
programming and interior decoration. Second, it will give a new and
richer meaning to the traditional Emacs haiku:
M-x font-lock-mode:
Your buffers should resemble
Angry fruit salad)

But back to the subject… a language with both templates
and generics. Yeah! A language that adds “^” and “%”
operators to go alongside “*” and “&”! Rock! This language is
like an ordinary programming language that fell into a huge vat at a
chemical factory, and emerged as a supervillain. With tentacles,
laser beam eyes, and the ability to change sex at will.

Clearly, though, what we really need is Objective C++/CLI. That
way we can combine all the bad and overlapping features, all the
punctuation, and all the insanity into one nice package. Which we can
then detonate.

Interconnections

I saw that a new Chandler release came
out, and that reminded me of a missing interconnection.

I read a number of mailing lists via the excellent Gmane news gateway. This is great
because I can open a group and reply to a message.

Sometimes, though, I’ll run across a posting to some mailing list
via the list’s online archives. Replying to this is much harder —
really, absurdly hard. Mailing list archives ought to have associated
read-only imap servers, so I can drag a URL from Mozilla to my mailer
and have it magically start browsing the list in a reply-able way.

I suppose archives could add mailto: links all over. That would
work reasonably well for the particular case of replying.

A couple Frysk notes

Frysk remains a bit
opaque, unfortunately — there’s a steady stream of cvs commits but
little action on the mailing list and little marketing. That’s too
bad… sometime soon I’ll try to find out more about what is going on
and talk about it here.

One thing that did float by on the mailing list looked cool: scripting
frysk with python
. (This is kind of old but I’ve been wanting to
mention it.)

More JNLP stuff

I thought this
hack
was cute. Interconnection is awesome.

Classpath Update

Classpath
hit 98% of 1.4 today
, and I think we’ll see another big bump
tomorrow since the XMLEncoder patch went in today. I think we’re in
the 90s against 1.5, though it is hard to say since there hasn’t been
a branch merge in quite a while. Of course, japi isn’t the final word
on how we’re doing, which is why Mark is going to talk
about this at FOSDEM
.

The coming year looks as though it will be a very good one for gcj
and Classpath. I think we’ll finish 1.5.

Netx Hacking

I’ve been doing a little hacking on netx lately.
netx is a java web start implementation; this is a way of bundling a
java application so that you can click on a link in the browser and
have the application automatically download and execute. I set out to
make netx a bit friendlier for Linux use.

My first goal is to make it integrate more nicely with the panel
and the desktop. My idea was to make it so the user can drag a JNLP
link from Mozilla to the panel, and netx would invisibly download the
application, install it, and make a .desktop file for future launches.
The reason to download immediately is that this lets you disconnect
your laptop from the network and still have the application work.

I’ve got a patch to let netx download the application and make a
desktop file. This works great. I’m not sure how to do the next
step, namely integrate with Mozilla and the panel; something to
research.

My test app, by the way, is iRATE radio, which is pretty
cool and worth a look. Thanks to Anthony for pointing it out to
me.

The next idea I had was to make netx a bit friendlier if the
network isn’t up — instead of trying to update an application and
timing out, it should use DBus to discover whether the network is up,
and, if not, skip the check. I looked at the Java DBus bindings and
I don’t see any big problem here, except that I’m still running DBus
0.50 and the bindings want 0.60.

My final thought for netx was to have it gcj-compile jar files as
it downloads them. This isn’t super-friendly though… what I would
really prefer to see here is a push forward on gcc+llvm, so we could
have both AOT and JIT compilation for gcj. More on this later.

Trying VEP

I spent yesterday hacking on medi8 a little. I got thumbnails
working again as well as they ever did — meaning that we show some
image that is somehow related to your movie, just not the right
ones.

I also rewrote the monitor widget using VEP, the visual editor plugin
for Eclipse.

VEP has a couple of unusual features. First, it is not specific
to a particular widget set. It comes set up to handle AWT, Swing, and
SWT, and supposedly you can add your own toolkits to it as well.

Second, VEP uses the Java DOM that is built by Eclipse. All GUI
editors face a fundamental problem: how to represent the generated UI
in the user’s code. These days the consensus approach seems to be to
create an XML file describing the UI, and then provide a library that
turns this into a widget hierarchy. VEP’s approach is to understand
your source code; you can edit the VEP-generated code and it will
preserve your changes even while you modify the GUI.

So, this is cool and high tech. I’m not in a very good position
to say how well it works in practice; my edits were limited to adding
event handlers to buttons. It was able to recognize my own home-grown
widget as a bean with no fuss, and I was able to build a little
monitor widget with VCR-like controls pretty quickly, and without
knowing anything useful about SWT. … but that is about what I’d
expect.

However, VEP still has a long way to go. The handling of widget
layout leaves a lot to be desired, I had a lot of trouble figuring out
how to make it work. You have to know that the “layout” property of a
bean is editable in this general properties view, and then muck with
the settings there; sometimes it pulls up a dialog for you to mess
with. VEP could take a huge usability lesson from Matisse here.
Ideally I barely want to deal with layout at all.

Also VEP has an unusual implementation in another way — it runs a
second JVM to display your widget tree as you edit it, and then it (as
I understand) screen scrapes this to show you what you are editing.
This doesn’t perform very well and at least on my machine results in a
VEP window permanently hiding near the bottom of the screen.
Eww.

Really Big Birds

This morning I noticed that whenever you see a movie or read a
book including really big birds, I mean birds that are so big that you
can saddle them and ride them, the birds are always raptors of some
kind. But why not gigantic ducks? Or enormous flamingos with 30 foot
legs?

The Gift of Therapy

I just finished The Gift of Therapy, which Yalom describes as an open letter to
the next generation of therapists. I thought this book was
fascinating and Elyn and I have had a number of conversations about
it.

I also recommend reading Love’s Executioner or Momma and the
Meaning of Life, both of which are collections of stories about
therapy and don’t assume as much knowledge of what therapy is about.

Consumer Linux

This Christmas I bought an iPod Nano for Elyn and ran into a lot
of software ugliness.

First, her computer runs Windows 98, and, apparently, cannot be
upgraded to some more recent version of Windows. That sucks, but is
apparently unfixable. Naturally, iTunes doesn’t support 98. Some
sites on the web suggest that, perhaps, you can apply some hacks,
attach an iPod to the machine and use some software to copy music over
— but even then iTunes won’t work.

Of course there isn’t a Linux port of iTunes (too bad for us it
isn’t written in Java…).

I tried both Wine and CrossOver Office — the latter
can actually run iTunes, but unfortunately still does not support
connecting it to your iPod. It might be possible to do what I want
with some combination of iTunes, a program to remove the DRM from the
downloaded songs, and some Linux-based iPod program like gtkpod… but
this seems awful, even assuming it would work.

So, upgrading Elyn’s machine to Linux (if it is even possible)
wouldn’t help. The lack of TurboTax would also be a problem — they
have an online version but, from what I’ve read, it isn’t as
featureful. The Linux worlds needs to make inroads with ISVs in order
to get users like Elyn; I really couldn’t recommend Linux to her
today.

At this point it looks like buying a new machine is the only
answer. I hate computers.

Medi8 Thoughts

There’s been a fair amount of activity in the open source video
editing space lately, and unfortunately not nearly enough on medi8 (in fact we haven’t even updated
our web site so there is nothing to see there, aside from the
source).

Instead of going through the other projects I thought I’d finally
post my reasons for writing medi8 as an Eclipse plugin. I think at
first blush this seems like a strange idea — certainly I’ve gotten
negative reactions from a few people I’ve talked to about it.
However, really, it makes a lot of sense, as I will try to show; and
not
everybody disagrees
(I seem to be following Doug Schaefer around a
little lately. And likewise I sometimes feel that Per has been
everyplace interesting about 3 years ahead of me…).

Note that in particular we’re writing Eclipse IDE plugins, and not
an RCP application. For RCP the choice is mostly about technology:
what is the simplest way to get an application up and running? What
framework provides the platform support and ease of development that
you need? Etc. But, that’s not what we’re talking about here.

The basic observation is that editing a movie has a lot in common
with developing a program. It can be a large project, taking many
months and involving many people (back when I was seriously working on
my free software movie, on Vicki’s advice I planned to take 6 months
off work in order to edit). A “real” movie can involve a large number
of parts, some of which could be custom software (e.g., a custom
titling plugin to make cool credits); data management is a serious
issue; etc.

Once you draw this parallel the reasons for developing Eclipse
plugins become more clear. Using Eclipse as a framework gives us
many things for free.

We don’t have to worry about project structuring or management,
Eclipse has this. Likewise for file management, and Eclipse even
provides features that, were we to write a video editor from scratch,
we would not include — e.g., the option of integrated source control
(I saw a feature request for CVS support in Kino, and felt
vindicated). Eclipse also has infrastructure for help, for
manipulation of editors and views, for task management (to-do lists,
markers, and errors), and builders.

Really all we need to concentrate on is the mechanics of movie
editing, how our model works, and things like that. We don’t spend
any time writing the same application infrastructure that has been
written so many times before.

Of course this isn’t without drawbacks. Eclipse’s GUI tends
toward the cluttered and it could benefit greatly from a UI
designer
(I’m not very concerned about this, though; cleanups are
inevitable). There’s also the possibility that Eclipse will somehow
be incompatible with what we want to deliver; but the evidence is that
this is merely a theoretical worry.

The overall vision for this tool is pretty straightforward: a
full-featured sound and video editor built as a set of Eclipse
plugins. Part of the big goal is using Eclipse as a framework to
unify all the parts of film editing; so for instance I picture being
able to build effects plugins of various kinds as Eclipse projects
themselves, and have the final film project depend on the effects
written for it.