Do we even want Jigsaw?


Recently it was announced that the Java modularity Project Jigsaw would be pushed out of Java 8. Jigsaw and its older brethren JSR 294 and JSR 277 have a tortured history from years of fighting during Java 7. That fighting is not just internally on political and design issues but externally vs other modularity systems, namely OSGi.

InfoQ has a decent round-up of opinions on the matter. They say:

  1. Good agile development: Release early, release often; if Jigsaw is late defer it to the next release and deliver Java 8 on time.
  2. Java 8 without Jigsaw is not worth the disk it’s written to. Just wait for Jigsaw.
  3. Jigsaw has already been delayed twice and who knows if it will ever be delivered. Give up, Oracle and put your weight behind an existing technology.

Re #1 – Jigsaw is a titanic change to how Java is built, delivered, and used. Based on the JDK release cycle, this doesn’t even make sense in the context of the larger JDK. On a project basis, they have been releasing builds for years, so they’ve done that.

Re #2 – this is ridiculous. Java 8 will be delivering lambdas, an overhaul of the collections library, an interface extension mechanism, and hopefully JSR 310 which will find give us a date/time library in the JDK that would be worth using. These are going to be the most impactful changes on Java development since generics. Java 8 is useful without Jigsaw.

Re #3 – this seems to narrow the options to either Jigsaw or OSGi. A third alternative, is *don’t put modularity in the JDK*. Don’t get me wrong: I wish Java came with a level of granularity above the package and below the app (a “module”). I wish our classpath was defined by modules with support for versions etc and a way out of the linear “classpath hell”. But I am deeply concerned about Jigsaw being way more disruptive than valuable. I don’t see the status quo as being particularly that bad. It’s painful, but I’m so used to the pain I hardly notice it. :)

Personally, I was glad to see Jigsaw pushed out of Java 8. I’m happy to avoid thinking about what it means for a couple more years and allow the people involved to continue contemplating how to integrate Jigsaw in ways that don’t cause a schism of classpath vs modulepath for years to come. I’d far rather have lambdas and functional collection support than Jigsaw.


4 Responses to “Do we even want Jigsaw?”
  1. dario says:

    “I’d far rather have lambdas and functional collection support than Jigsaw.”

    Many of us feel the other way around and consider this delay again nothing but a broken promise of plan B which I know regret supporting. Perhaps we could assume there were other reasons (outside of purely technical reasons) that precluded the ability for third parties to provide jigsaw based JVMs?

  2. Gili says:

    I agree with Dario. I couldn’t care less about lambda functions. I think they are a bad fit for the language. It’s another kitchen sink feature that the language can and should do without.

    The main point of project Jigsaw, in my view, isn’t fixing classpath problems but rather introducing the ability to remove components from the JDK. This is extremely important for the long-term evolution of the language. Java Generics was a disaster primary because of backwards compatibility. Jigsaw will allow us to isolate older applications into their own runtime. Newer applications shouldn’t be made to pay for bad design decisions of the past.

  3. Just to add a small data point, our Java implementation has had a Jigsaw-esque (yet Java Compatible) capability for years, and many of our customers have been utilizing it to reduce the download size and disk footprint of their apps:

    We expect much better results once the Jigsaw team completes its titanic effort.

  4. Richard says:

    As I spent lot of time coding, I would say that developing with outdated langage structures and poor api
    (such as date) is a day to day concern, while modularity is not.

    About removing component from JDK (as says Dario), that’s a big +1 for me.

    I value both but I will simply welcome the one which comes first.