Neal Gafter announced a draft closures JSR a few days ago. I'd like to give the JSR a cautious welcome, but also wish to emphasise that the 'consensus' term could be misleading.
At present, there are three key proposals in the 'closure' space - BGGA from Neal Gafter et al, CICE from Josh Bloch et al, and FCM from Stefan and myself. Conceptually, these proposals meet differing visions of how far Java should be changed, and what is an acceptable change.
----------------------------------------------------------------
Simpler More complex
----------------------------------------------------------------
No change Better inner Method-based Full-featured
classes closures closures
----------------------------------------------------------------
No change CICE FCM BGGA
----------------------------------------------------------------
In deciding to support this JSR, a number of factors came into play for me:
- I want to see closures in Java 7 - unfortunately it may already be too late for that
- I'm not a language designer, and don't have the knowledge to run a JSR myself on this topic
- The text of the draft JSR is clearly phrased as a derivation of the BGGA proposal
- There has been positive feedback on Java forums about each of the three proposals - the Java community does not have a settled opinion yet
- Many Java developers feel uncomfortable with any change in this area
- Groovy, a Java derived language, uses an approach similar to FCM
- This is the only JSR proposal currently available to support
- Private emails
In the end, taking all of these factors into account, I took the judgement that this JSR was currently the only game in town and it would be better for me to participate rather than stand outside. And that is why I give it a cautious welcome.
Unfortunately, the extensive list of pre-selected Expert Group members (not including FCM) and Expert Group questionnaire came as rather a surprise, especially given the 'consensus' tag.
On the point of consensus, some commentators have assumed that this means a compromise proposal has been created, or agreement reached. This isn't the case.
Looking forward, my preference would be for Sun to finally play their hand on this topic. As a neutral player, they are well placed to encourage all parties to take a step back for a minute and put the focus firmly on what is best for Java going forward. Let the Sun shine :-)