Mark Reinhold Talks About JDK 7, Closures, JRockit, and HotSpot
The first feature in JDK 7 that Reinhold talks about is the effort to modularize the Java SE platform, called Project Jigsaw. Along with addressing performance, Reinhold says that a key benefit of Jigsaw will be the ability to not only scale up, but scale down as well, specifically into small devices. Project Jigsaw installs just a piece of the JDK in those small devices without requiring the cumbersome 60MB of space for the whole thing. Project Jigsaw, he says, will also solve the problem of .jar hell once and for all. Developers will finally get a chance to play with Jigsaw in mid-March when build 88 is released. It won't be integrated into the core of the platform, but it will be available in a form that others can test-drive.
Improving support for various dynamic languages is another major goal of JDK 7. The project will add general purpose extensions to the JVM in order to run non-Java languages with performance levels comparable to Java itself. Project Coin will make other significant additions to the Java language akin to the set of changes in Java 5, said Reinhold. The big language features for Java 5, he said, were generics and the for-each loop. Much like those changes, Coin is intended to make everyday development easier. Reinhold mentioned a few of the Project Coin additions such as the "surprisingly useful" strings and switches, and the diamond operator, which he called a "huge win for complicated generic types." Project Coin also includes features that will make java syntax more compact, said Reinhold, "much like Python."
Other productivity enhancements that Reinhold mentioned were Type Annotations and a new I/O filesystem API. He said that the changes in JDK 7 would finally bring in a real filesystem API. He said that this feature on previous JDKs was a joke. Type Annotations, he said, are a big improvement to static program checking. He calls the new feature "a type checker on steroids." At a high level, Reinhold says the new fork-join network is going to be very beneficial along with truly parallel thread-safe class loaders. One viewer asked him about JSR 310, the Date and Time API. He said he would love to see it finished since its been sitting around for so long.
Reinhold also discussed his motivations behind starting Project Lambda to add closures to Java 7. When the idea of closures in Java was first brought up, he said there was less motivation at the time and he didn't see a proposal that fit well with the Java language. The expansion of multi-core processing has been a game-changer for Java, and now Reinhold says it would be so much easier to harness multiple cores with real closures. MapReduce-type bulk operations in Java "are a pain to express," he said, "it's nauseating." The extended schedule for JDK 7 was the opening he needed to introduce closures now, rather than in JDK8.
Reinhold thinks that developers have a desire to see Java evolve and "show signs of life" while still maintaining readability of code. He says that Project Lambda already has a number of people involved and the second draft for the spec is nearly complete. Milestone 6 is on its way, he says, but it won't involve a lot of new features like the last milestone.
In addition to his work on the JDK, Reinhold has been in several meetings with developers from Sun, Oracle, and other sources to discuss the possible integration of HotSpot and JRockit. They're very much in the exploratory stages right now, seeing how the two JVMs will fit together. The plan is evolving, he says, and they are not dealing with easy problems. JRockit and HotSpot have been in a tight race for many years and each one comes with its own advantages. He says that JRockit, for example, has better serviceability. Their primary goals will be to improve performance and see how much further the two codebases can be pushed.
Another viewer asked Reinhold about working with Oracle and his hopes for the JCP. Reinhold said he is confident that Oracle can make the JCP more participatory and he looks forward to the JCP not being jammed up like it has for so many years. In his HotSpot/JRockit meetings, Reinhold says that Oracle has some very open-minded technologists. When they buy a company, he says, they sometimes set aside their own technology if the acquired technology is better (BEA's WebLogic, for example). Finally, Reinhold was asked about his plans for this year's JavaOne in September. He said he'd probably do what he usually does - participate in a bunch of talks, socialize with the community, and stay out late.