Older blog entries for robilad (starting at number 96)

10 Jul 2006 (updated 10 Jul 2006 at 20:11 UTC) »
Java Modularity Pointers

Every now and then, there is some thread somewhere where Java developers get to exclaim their demand for interesting features. It seems that modularisation is going to be a hot topic, judging by the JCP struggle between Sun and OSGi, i.e. JSR 277 and JSR 291, and talk at the various 'community' sites.

Looking at Richard S. Hall's slides from ApacheCon Europe, which lifts some of the NDA veils that Sun keeps for whatever weird reason on JSR 277, a lot of the thinking behind the various plans seems to work towards enabling annotations of the code with various constructs, be it annotations to describe module structure, versions, or bundles. If it requires manual labor, I'm not sure if it is going to take over the world, though. See Maven, OSGI bundles, Ivy, etc. all of which are pretty nice, but require someone to do some work to take care of the metadata, and keep it all up to date, which has kept the repositories relatively small.

So, what else is out there, that tries to solve the problem more automatically?

Beside Luca Cardelli's foundational work in the area, there has been a lot of interesting work done at DISI in Genua.

In an ideal world, my compiled classes would have additional information on their dependencies for rebuilding and linkage, in form of type constraints, so that I could query a module repository's database for the set of classes that would safely link, while preserving binary compatiblity, and refine the set to only the classes fullfilling constraints on their tagged versions, binary hashes, etc. The module repository database of type information would be largely automatically compiled by extracting exported types and their linkage constraints from the class files, and allow annotating them with some manual versioning information, for additional convenience. The module repository would be able to translate module names between its own format, and my local packaging system, and detect that it doesn't have to download a class that Debian already packages in a suitable bytecode version, or as a suitable gcj-ed native DSO. It'd be able to degrade gracefuly on systems without native software packaging mechanisms. In an ideal world, the module repository would figure out which native library to load based on the native linkage symbols in the class file, without requiring an explicit System.loadLibrary() call in the Java code, and the guessing game of DSO names.

That's what I'd like to see a future Java module system do or at least make possible.


I came accross an interesting paper on using Jumbo to optimize marshalling in Kaffe's ObjectOutputStream by a factor of magnitude, or two.

Makes me wonder what it would do for speeding up reflection, as well.

6 Jul 2006 (updated 6 Jul 2006 at 16:23 UTC) »
How not to license specification drafts

I've recently thought I should take a peek at what's happening with the Java Compiler API JSR, to see what all the years of effort have led to. It turned out that the recently published JSR spec draft is under one of those bogus licenses that the JCP uses per default, that make you promise to give up your freedom to develop what you want, in exchange for the opportunity to comment and help improve the respective specification.

That's bogus, of course, but that's how the JCP works. In particular, the Java Compiler API draft has the following gem of legalese in its license text:

"The grant set forth above concerning your distribution of implementations of the specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the specification. If you fail to do so, the foregoing grant shall be considered null and void."

Well, I don't think I'll be taking part in reviewing that spec's public draft, then, if I can't try to implement it, and keep developing my own work, after some arbitrary date.

The wisdom of creating specs behind firmly shut doors, like Sun does in most of the JSRs they lead, and simultaneously making specification review impossible for independant implementors unless they agree to stop development on their independant implementations, is rather questionable. That way, the only thing that's for sure, is that a specification gets next to no public review from people who'd be able to comment on it with practical experiences implementing it.

If the independant implementors are not supposed to be able to comment on the drafts, why publish them in the first place, or have the whole JCP system at all?

Unfortunately, the self-defeating licensing conditions of the Java Compiler API JSR public draft are no exception. In fact, the whole Mustang spec is licensed under the same conditions, judging by the license for the spec.

19 May 2006 (updated 20 May 2006 at 00:43 UTC) »
GNU Classpath At Java One At Last

Fernando did a podcast/talk at this year's Java One on the state of free runtimes, and associated projects. Nice stuff, though listening to demos of GNU Classpath feels weird, because I can 'see' what's being demoed.

Next year, I'll have to try to get a "Smashing The Java Trap: An Illustrated HowTo" talk accepted.

19 May 2006 (updated 20 May 2006 at 00:44 UTC) »
We've Come A Long Way, Baby

One of the benefits of Kaffe is that it is wildly portable. Almost any combination of cpu and os has got a port somewhere, and new ports keep coming in at a steady rate. In particular, you can now shortcut Sun's complicated build process for their proprietary 1.5 release using Kaffe, at least on x86_64-openbsd.

Fun, in a twisted way.

17 May 2006 (updated 17 May 2006 at 16:32 UTC) »

So, according to the last big news, the big question is no longer if, but how. This is how:

The closest collaboration point between free software Java developers outside Sun and the engineers on the other side would be the test suites. Since the free software projects like GNU Classpath and Apache Harmony, just like Sun's developers consider compatibility to be one of their prime goals, a merge of the respective test suite code to a common, free software, compatibility & regression test suite for the core Java specifications would be pretty useful for all implementors, as well as distributions using the DLJ.

Meanwhile, the simplest thing Sun could do to make open source Java reality a little sooner, and create a collaboration effort, would be to modify the current "Read Only" JCK license to allow compilation and execution of Sun's official test suite by independent implementations.

17 May 2006 (updated 17 May 2006 at 13:15 UTC) »

It's JavaOne time again, and Sun's collection of Java technology licenses includes a new addition, the Distro License for Java, aka DLJ.

On a cursory glance, I'd agree with what David Walluck said on debian-legal, it's a rather odd license choice, which seems to in part address some of the problems from the BCL, but in exchange seems to add a bunch of new ones.

I hope the forthcoming discussion on debian-legal will clear it up.


Some time after introducing Glasnost, there is a small substitution at Sun's leadership.

In the best Sun PR tradition of not letting facts get too much in the way of a PR message, the press release credits Sun for "the open sourcing of Java[tm]", something Sun never did.

Au contraire, mes amis: Here is a characteristic quote from McNealy on 'open sourcing Java': "I don't know what problem that would solve apart from IBM's childhood envy". Schwartz has been more diplomatic in explaining Sun's reasoning in the past, with quotes like "Our refusal has nothing to do with Sun being proprietary and everything to do with wanting to keep Java from forking", but has still sayed true to the party line.

Looking at Sun's handling of J2SE and the JCP, and Sun's lack of good fortune, last April's "Schwartz also predicted that companies that pledge support for open-source software but that keep their own products proprietary will eventually be exposed as hypocrites and fall by the wayside" sounds a bit ominous for Sun's future. As much as I hope that Sun does not fall by wayside, I doubt that Schwartz sees the need for a full-fledged open source Perestroika.

Who needs specifications, anyway?

Wontfixing standards

7 Apr 2006 (updated 7 Apr 2006 at 11:23 UTC) »
Hey, dude, where's my JSR??

Dear me, there was a real flurry of totally futuristic Java Specification Requests recently!

Watching Sun Microsystems turn into the mother of JSR invention recently was quite exciting. So far, it seems that Sun has said goodbye to earlier conservativism on all things regarding Java or the JVM, so apparently nothing is too outlandish to get into J2SE any more.

Embedding XML into the language? Sure, go help yourself. Adding new bytecodes to the JVM that are pretty pointless for running actual Java applications? Null problemo. Doing OSGi only sorta different with a twist? The JCP will let you have several JSRs for that. Loudly thinking that applying the idea of inner classes onto packages would be kinda cool on your blog? Woppiedoo, there is a JSR for you, too.

Last time someone tried to get people excited around one of those ueber-exciting JSRs that will totally reshape the future of Java (deployment), was JSR 277. That's the one where OSGi meets Maven, and they have a love child that is like a CPAN for Java, only with small JARs. Sorta. Kinda. It's hard to tell since the JSR 277 has not produced anything since its inception last summer, besides enthusiastic exclamations of support when it was announced. No drafts, no mails, no announcements, no calls for contributions, no nothing at all. Not even a java.net project, afaict. I guess it's one of those situations where JCP's approach to transparency via spec-leads really shines. So, yeah, if someone knows if JSR 277 is officially dead, or just looks like it, please do post a blog entry, or, preferrably, the JSR 277 mailing list archives. I am seriously morbidly curious if it was eaten by a grue, or something else happened to it.

What else does the future hold? Ah, "invokedynamic". A whole whopping new bytecode. The first one in approximately 10 years, afair.

So, it turns out that the whole "there is no Java in Ruby (on Rails) or PHP or Python" thing actually irks someone at Sun enough to do something about it, to give all those potential deflectors from the JVM something to hold on to, while the JVM gets rebranded as the language independant platform of the future. Since those programming languages are characterized as "dynamic" languages, someone at Sun thought really hard how to associate that cool, new buzzword with the not-really-well-known-for-its-dynamism JVM, and came up with a new bytecode, invoke ... tada ... dynamic!

Personally, I'd have gone with simply reserving bytecodes for "invokeweb", "invokeweb_2" etc. without specifying their behaviour, which would let future JVM designers easily choose which hype they want to invoke an association with. Less of a hassle with reworking the verifier.

And you know what? I'll let you submit that JSR. Consider this blog a draft spec, and go claim your five minutes of JSR fame.

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