Operational Dynamics
Technology, Strategy, and IT Operations Consulting   |   Open Source Research and Development   |   Blogs

Opening GTK to Java programmers

The past, present, and future of the java-gnome bindings project

This was first given as a talk at foss.in/2006, India's premier Open Source conference, 26 Nov 06. A much updated followup version was given at GUADEC, the GNOME Developers' Conference, 19 Jul 07 at Birmingham. You can view the slides online here, or download them in PDF form.


Opening GTK to Java programmers: the past, present, and future of the java-gnome bindings project

Abstract

One day you casually install a package to see if it works. Along the way you submit a bug or two on the packages. The next thing you know you're tracking upstream, so you end up writing entirely new package descriptions and submitting them to your distro.
Meanwhile you try the thing out. You join their IRC channel and get a bit of help. You open a few bugs upstream. Then you really get hooked, find something stupid broken, and start submitting patches. Pretty soon, the maintainers get tired of committing your patches for you, and arrange to grant you commit access to the source code repository.
Then the next day you wake up and find that you are now the maintainer. Sucker. Welcome to Open Source. :)

java-gnome is the project to provide a set of Java bindings to allow GNOME and GTK+ applications to be written in Java.

You might think this goes without saying, but the target audience for our project are people who are Java programmers who happen to be using GNOME on Linux or Solaris and who just might like to write an application and want it to look good and therefore want to write it in their native environment - GTK. Unfortunately, GTK itself is hard! The GTK APIs themselves are rich and powerful but with that richness comes complexity and detail that needs to be mastered. In its native C, GTK programs are very nearly impenetrable, certainly exceedingly verbose, and brutally difficult to debug.

All these factors are areas where Java in general and java-gnome in particular are a great improvement. In particular, we've already seen that the combination of a naturally object-oriented language like Java along with the code completion features of a rich IDE like Eclipse make for a really excellent development experience.

Unusually for an Free Software project, java-gnome has been through five teams of maintainers over the nine years since it was started. This is remarkable. Yet longevity does not automatically define success. Over time, the code has become unwieldy, coverage is spotty, the mapping of the underlying libraries to the API we publish is inconsistent and worst of all the whole mess is entirely manually crafted. (And people use it? Yikes!)

So the java-gnome team, lead by Andrew Cowie, has embarked on a complete re-engineering of the bindings. Along the way we've had to figure out the answers to some pretty fundamental questions. Like who are we doing this for (and who are we not doing it for)? What do we want it to feel like? How can we invest effort now so that the maintenance effort required in the future is marginal? And most importantly, should we bother?

The existing pool of people with Java expertise is enormous and is a large audience whom free software have largely ignored over the years. More than anything, we are working to ensure we give these people the power to write rich desktop programs and clients, and in the process bring a whole new crowd of people into the amazing world that is GNOME and Software Libre. And that is worth doing.

Why will this talk be of interest? No matter what project we work on, we all want our work to be valued, and to be used! Yet the magic formula for success in an open source project remains obscure. So in this presentation we will talk about the challenges we have faced, both technical (engineering & design) and social (bringing diverse collaborators together) and how we believe we have solved them.

Without boring people to tears, this will nevertheless be a consummately technical talk. We will delve into some of the hard issues that arise when trying to do binding of a C library from Java. We will talk about the complexity of doing handling memory allocation in an environment where one side is a managed runtime and the other is doing simplistic reference counts. And we will discuss best practices in API design we've gleaned as a result of input from experts across the Open Source spectrum.

The result won't be just a talk about Java. Or GNOME. Or even just about the java-gnome bindings. But it will be about how to find your way across boundaries so that regardless of your project or interest, you will have a better idea of how to collaborate with those around you. Get along and get it done in the Open Source community.


These documents copyright © 2006-2007 Operational Dynamics Consulting, Pty Ltd unless otherwise noted. Copyright of work by other authors is retained by those authors. Most material in this site is made available under an Open Source or Open Content licence; see the top level LICENCE file in that project's source repository for details

Files on this site (notably program code) will be delivered as Content-Type: text/plain unless syntax-highlighted or binary. Optimized for standards. All times UTC