Closures in Java 7: Not Likely

| 24 Comments

Five months ago, I posted Closures in Java 7 After All to celebrate the announcement that JDK7 would include closures.

The schedule seemed optimistic at the time, given that Mark Reinhold decided to start with a blank slate rather than adopting one of the existing closure proposals. And sure enough, it was wildly optimistic. The schedule says that JDK 7 will be "feature complete" on June 3rd. But the closures specification being developed by Project Lambda is at version 0.15

Activity on the Project Lambda mailing list has petered out as engineers from Sun/Oracle have become non-responsive. [Update: this has now changed. See my more recent post.] Neal Gafter, one of the hardest-working advocates for closures in Java, has politely and repeatedly asked for clarification of the schedule and of Oracle's commitment to closures.

The only answer he's gotten is from Alex Buckley:

Schedule information for Lambda will be shared when available.

Resourcing decisions are out of scope for this list, but I am sure that any resources assigned to Lambda will be directly or indirectly visible on this list.

It seems that Alex is not permitted to speak openly about this. But given that no activity is directly or indirectly visible through the mailing list, we can infer that there is basically no one at Oracle working on closures. And it makes me wonder: is there anyone one at Oracle with the time and the authority to alter either the release schedule or the feature list for JDK 7?

24 Comments

Java is dying. Very slowly, but it does.

While C# has evolved very much with FOUR versions i a very short time and new JVM languages like Scala emerging, I don't see a future for Java if it doesn't start to evolve (faster).

Bloody hell, when will Java be a competent language again?? There'll be no progress if no risks are taken. Java had so many long years and till date it hasn't tried inventing closures!
That's it. I'll be using Scala from now..

Java is an awesome programming language. All of .net is crap, not necessarily from an implementation standpoint, but mainly due to the fact that if you want to work at optimal capacity then you need Visual Studio (which in itself is a horrid bloated piece of software) which you have to pay for.

Since when does not having 1 measly feature like closures make Java an "incompetent" programming language? Closures are just the latest "feature du jour" in programming languages but the truth is that the general developer population could care less about them. They are a nice to have, but overall irrelevant. Last time I checked Gmail (largely written in Java) was the best webmail client out there and lighting fast...all without closures.

One measly feature? Where are the lambdas in Java? Where are the extensions? Where is LINQ? Where are the optional and named arguments? How about the dynamic psuedo-type that now lives in C# that allows ungodly simple access to scripting languages? And of course its missing closures.

Forgive me if any of these have been recently implemented. I am sure I am also forgetting some stuff C# has that will probably get in some draft spec someday for Java.

I used to program in Java in the early days (1.0, 1.1, 2.0) and have spent the last several years in C#. I cringe when I think about going back to Java. It really is now a second-class language when you think about C#, or Python, or Ruby, etc.

I'm actually glad that Java is staying more conservative. I did a bit of programming in C# about 5 years ago, back when it was quite similar to Java 1.4 or so. I can't even decipher a block of C# nowadays after years of language changes. This is not a 'Good Thing' IMO.

Esoteric, experimental, academic, and 'cool' features exist for many alternative languages, both on the JVM and .Net.

As an 'enterprise' Java developer, 90% of my time is now spent integrating the multiple layers and frameworks involved in a project - ORM, application server, clustering, database connections, xml mapping, client side code, build process, dependency management, etc. When it is all said and done, being able to use a closure instead of having to write a for loop isn't really that big of a deal.

I think that rumors of Java's death have been greatly exaggerated. Sure, it would be nice to have better closures in Java, and I was looking forward to the prospect in JDK7 (still holding out hope), but a careful approach to language evolution can be a good thing. And, of course, Java technically already does have (real) closures in the form of anonymous inner classes. I use them all the time. (BTW, I'm a recent Java convert. I remember hating it back in school but I'm actually enjoying it with the work I'm doing now.)

@Devlin. I think Java is a great language. So is C#, and so is VB.NET for that matter. Just to clarify one thing though, it may not be widely known but there's an entirely free version of Visual Studio available. It's missing minor bells-and-whistles from the commercial versions, which curious people could learn about on microsoft.com somewhere. If you don't want to use VS, you can use SharpDevelop on Mono or .NET. You can even use Eclipse with C#, though I haven't personally tried this. You can also just use the command line compilers with your text editor of choice: Notepad, vim, emacs, Notepad2, Notepad++, EditPlus, e-texteditor, etc. I personally love VS, but for those who don't there are many other options out there.

Seems like Oracle is breaking up with Java. I wonder if this will be a traumatising experience, and if they will ever obtain closure.

How did Oracle not see it coming? Anyway, finalization of the details will be a some indeterminate point in the future, it seems.

Maybe now that Gosling has left they'd be more open to taking cues from C#? I'm probably just being overly optimistic.

I'm a SharpDevelop user myself. My concerns for whats going on with Java 7 stem from its upgrade to IPv6 support...

Java 5/1.5: supposedly IPv6 works as a client on XP+2003
Java 6/1.6: IPv6 works on XP+2003 as a client-server & spotty support on Vista+7+2008
Java 7/1.7: IPv6 works as a client-server on Vista+7+2008

Because of the way dual-stack IPv4+IPv6 is done on the Windows 6.x platforms, Java's IPv6 support breaks. However, this is fixed by JDK 7 binaries. But with Java 7 languishing, what apps can be deployed outside a Linux-based OpenJDK environment for the coming wave of v6 deployments?

I use IPv6 in my work VPN: and I did have IPv6 support for a while when using OpenFire XMPP server with JDK binaries on one of my 2008 servers. But its unstable, not supposed to be used in production, and with this Oracle crap going on, I had to revert to 6.20 and forgo the IPv6 support to my Linux clients. I've contemplated trying to have OpenFire ported to C# to retain IPv6 support on Windows hosts.

Closures may be not that important (although I think they are), but postponing it once again says something about the will to let java 'grow'.

Java is the rightful heir to COBOL and I think it has all it takes to write big boring business applications.
Sun already messed up generics (type erasure, arrrg) and I'm not very keen to see how they mutilate another good idea.

I would just like to point out that MonoDevelop is an awesome IDE, and IMO C# is very much superior to Java even on Linux/OSX being that the Mono+MonoDevelop tool set actually is very good.

Whether you like it or not, Java is a great programming language. The fork-join stuff & NIO 2 are much more important to me than closures.

Oracle does not talk about anything not for sale at the current time in order to keep their salesmen selling -- can't put off that purchase if you do not know new feature X will pop up next month. They are killing the Open Source MySql folks who have a culture of speaking about what is coming in the next release.

I smell a bit of undereducated javanese here, plaqued by Java tunnel vision... Anyone should study multiple programming languages (apart from the one that pays his or her checks) so that he can appreciate lambdas and closures.
If Java doesn't implement closures and other improvements from modern programming language research, it is bound to become boring Cobol like language for business types, crunching database driven forms again and again.

Jave evolving just fine, but under the name Scala.

Java is evolving just fine, it is called Groovy.

Jave evolving just fine, but under the name Stab

@Bill:
"Esoteric, experimental, academic, and 'cool' features exist for many alternative languages, both on the JVM and .Net."

Yes, esoteric, experimental, academic and 'cool' features exist even in Java. It's called 'object oriented' and 'garbage collection' or even 'generics' and all this fancy stuff. I don't need that too, I will stick to my COBOL ....

Sorry, just kidding, but what you give funny names is called "progression" by other people.
And for me it is hard to imagine that we both work in a profession which has "development" in its name.

"As an 'enterprise' Java developer, 90% of my time is now spent integrating the multiple layers and frameworks involved in a project - ORM, application server, clustering, database connections, xml mapping, client side code, build process, dependency management, etc."

So am I and do I (and you forgot parallel and concurrency handling, distributed computation a.s.o.). Therefore I am glad for any help a programming language gives me to make all of the above tasks (which get more and more complex over time) less annoying.

"When it is all said and done, being able to use a closure instead of having to write a for loop isn't really that big of a deal."

Have you ever worked with a closure-aware language, or with any other language than Java recently??

There are several resources that are working on closures at Sun/Oracle. We are reviewing schedules for Java 7. As soon as we get done, we will publish those milestones as part of OpenJDK. Java is alive an kicking and so are closures in Java.

"Project Lambda

The goal of this Project is to formulate a proposal to add first-class functions, function types, and lambda expressions (informally, "closures") to Java."

So closures are lambda expressions...?

What I'd like is a book which tells how these things work under the hood.
For example: programming Java you keep the C idea in mind of a pointer to an array. But how do Haskell's lazy lists work on a deeper level?

It is time for a comparison.

Jazz is totally correct i think this could happen.

Leave a comment

Books

Comprehensive coverage of Ruby 1.8 and 1.9

"The New Most Important Ruby Book"
Peter Cooper,
rubyinside.com

Completely updated for Ajax and Web 2.0

"A must-have reference"
Brendan Eich,
creator of JavaScript

The classic Java quick-reference

Advertising

Pages

Hosted By

Powered by Movable Type 4.21-en