Closures after all?
Apparently Mark Reinhold announced that closures would be added to JDK 7 at Devoxx today:
I can’t say what to make of that really. For years Sun has been saying that there is no consensus on closures and delayed the formation of a JSR or expert group on the subject despite having three proposals, all with prototypes.
Neal Gafter’s BGGA closures proposal is easily the most fully baked and has a fairly complete prototype and all of the necessary specification changes. I would have to guess that Mark’s announcement must be based primarily off the ideas in Neal’s work, but we’ll know more soon I guess.
After years of saying no, no, no to come back and announce a solution without any opportunity to enlist the community in what has been a previously contentious discussion seems destined to piss a lot of people off. This is the sort of thing people have been getting angry at Sun about for years (often wrongly imho but this won’t help). But maybe this is just an announcement that a JSR will be formed and not a declaration by fiat. It would be nice to have some more details.
It also throws into ever sharper relief the strange place we are with Java standardization. Sun has spent years moving the JDK into open source and more years improving the JCP process so there is a way to officially create a standard Java blessed by all. Yet, we are now at a point where the process for “Java 7 as a standard” is broken by all accounts, forever blocked by the Sun-Apache licensing issues. And instead of a process for creating a standard, Sun is mostly just doing whatever they want in the guise of the reference implementation “JDK 7″. That’s ok as an interim step but it assumes that at some point the Java 7 process will become unstuck, the community (via JCP) defines and approves a standard and has a say in where we are going with Java. If it doesn’t, then we’ve basically blown up the notion of a “standard” Java, which is the whole thing Sun’s been blabbing about for years.
To me, that would kill the biggest reason people use Java in the first place and that so many huge companies have bet their product lines and IT systems on it in the first place.
Hopefully, I’m reading too much into what at this point is just some tweets and a picture. I’ll try to keep posting updates here as I see them.
Links to info added as I see them:
- Geertjan Wielenga: Sounded to me like Mark Reinhold created a new syntax for Java closures on the flight from US to Belgium. He pretty much said that.
- Jean-Laurent Morlhon: from what I’ve understood, jdk7 is pushed to end of 2010, which should give enough time to include “lite” closures.
- Stephen Colebourne: Closures will probably be in JDK7, and they are very like FCM closures! The FCM spec: http://docs.google.com/Doc?id=ddhp95vd_0f7mcns.
- I talked to Bob Lee a bit at QCon and he thought it was possible that the extended timeline for JDK 7 may allow the ParallelArray work to come back in and make use of the new closure support. And that would indeed be a worthy inclusion in my book.
- Neal Gafter has updated the closure spec here v0.6a
- Starting to see some discussion of this on the Coin mailing list with some discussion of syntax and the spec.
- Comments at Hacker News
- Comments at Reddit
- Stephen Colebourne gives an in-depth overview
- Cay Horstmann gives some examples and commentary
- java.net has some analysis
- Helpful update from Reinier Zwitserloot from the Devoxx BOF
- Ted Neward drops some thoughts
- Neal Gafter clarifies in this thread that the 0.6a spec referenced above was written about two weeks before Devoxx, prompted by a discussion with Gosling about a compromise spec. He doesn’t know whether Mark read it or not.