Monday Sep 23, 2013

The JavaOne 2013 Technical Keynote

by Timothy Beneke

Mark Reinhold, Oracle’s Chief Architect, the Java Platform Group, took the stage to kick off Sunday’s technical keynote at the Moscone Center. He began by quoting “father of Java” James Gosling. For Java to thrive, it must maintain what Gosling called the “feel of Java”. In other words, it must retain the key values of readability, simplicity, and universality.

“If we keep those,” said Reinhold, “then Java will remain not just productive but fun. It is not enough to simply add popular features each year.”

Lambda Expressions – The Single Largest Upgrade Ever
He turned to lambda expressions, which he described as the single largest upgrade to the programming model ever -- larger even than generics. “This is the first time we have done a carefully coordinated co-evolution of the JVM, the language, and the libraries all together – and the results still feel like Java,” said Reinhold.

He then welcomed Oracle Java Language Architect, Brian Goetz, to share the stage and began by remarking that while most developers understand that lambda offers a simple way to express code as data, some are not sure how it helps Java. Goetz responded that lambda expressions would more than help Java. “It’s going to change the way we all program in Java every day,” he explained. “Programming well is about finding the right abstractions. We want the code we write to look like the problem statements it’s trying to solve, so we can look at it and immediately know it’s correct. Java has always given us good tools for abstracting over data types. I wanted to do better in abstracting over patterns of behavior – that’s where lambda comes in.”

He illustrated this with some simple code that was, strictly speaking, “good” code, but weighed down with boilerplate and did not read like the problem statement it was trying to solve. It could be improved by using an inner class tool, but that too generated a lot of boilerplate. Reinhardt pointed out that improving the code made it less pleasant to work with, as if the developer was being punished for doing the right thing. This often causes developers to give up and do it the “dumb and ugly way”.

Lambdas can replace inner classes with a lambda expression which is simply an anonymous method that captures a behavior without a lot of syntactic boilerplate. “Lambdas are a nicer syntax,” said Goetz. “But they are also something deeper. It’s not just a compiler generating inner classes for you – it uses the invokedynamic feature to get more compact and higher performance code. It will make a qualitative difference in the way we program.”

If the right way to write a program is unpleasant, then people are less likely to do it according to Goetz. They are more tolerant of doing it the wrong way. He gave an example of how lambda expressions address this with the collections API involving a new abstraction to the JDK called stream and showed how to represent a simple query through applying a filter and mapping transformation, followed by an aggregation, in a way that is fused into one path without creating any intermediate weapons.

Reinhold summarized the key points: “So lambda brings 3 weapons to Java – syntax, performance and abstraction.”

“Plus parallelism,” Goetz added. He explained that Java 7 has the fork/join framework for parallel decomposition that is powerful, flexible, and highly efficient – but not the easiest thing to use. Goetz showed how lambdas enable better parallelism without needing to write fork join code: by asking the collection for a parallel stream it uses fork/join under the hood.

Lambda also helps with normal sequential code by making code clearer, less noisy, and easier to read. “When you have code that is hard to read, that’s where bugs come from. You are trying to maintain some code, you look at the code and think you know what it does, but don’t actually know what it does, and boom! – you’ve introduced a bug.”

All in all, the message was clear: Lambda expressions make Java code easier to read and easier to write.

Working with Lambda and the Collections Framework
For lambdas to be successful, they must work with the Java Collections Framework, which is now 15 years old. So an evolution of the interface was in order. Goetz’s team had to grow an interface over time without breaking implementations of the interface. They added a concept that allows developers to compatibly add a method to an interface, as long as a default implementation is provided.

Reinhold remarked that he has now written a couple of thousand lines of code with lambda features and really enjoyed it. “I can be more productive, and the end result still feels like Java,” he said.

To get started learning lambda expressions, Java developers can go to the OpenJDK Project Lambda page and download the developer preview builds there.

Reinhold reminded attendees that there is a great deal more in Java SE 8 besides lambda expressions. Developer preview builds can be downloaded at JDK8.java.net. “Now is a great time to download JDK 8 and take it for a spin. Every planned feature is in there. It’s reasonably stable and it passes almost all of the tests. If you have any feedback, please send it in!” said Reinhold. 

Playing Chess
In the rest of the technical keynote, Oracle’s John Ceccarelli, head of engineering for Oracle’s NetBeans team and Oracle’s JavaFX architect Jasper Potts, arrived on stage to demonstrate a Duke pad running real Java via a chess program that was connected to a server. The iPad operated through an HTML5 client talking to a Java EE 7 back end with an EE server in charge of  messaging, communication, game state, and so on, with clients hook into it – all built with NetBeans. Jasper Potts further showed off the chess demo with an HTML5 client using a front end to a chess server that was managing the chess games. Then a robot, powered by Java ME 8, took over the game.

Oracle Software Engineer, Santiago Pericas Geertsen, who built the chess server, also described how it was built with 5 distinct functional modules.

In sum, attendees witnessed a server running Java EE 7 hooked up with a variety of clients, some written in HTML5, one written in JavaFX on a Duke pad, one using JavaFX 3D on a powerful laptop, plus a Java ME 8-powered robot contributing to the ongoing chess game. In the process, the powers of the Raspberry Pi were demonstrated.

Developers were encouraged to jump in the water, go for a swim, and have fun with NetBeans and Java embedded.

Java SE 9 and Beyond
Wrapping it up, Reinhold peered a bit into the future and suggested some possible directions for Java, some of which are already in development:

One is Java on GPUs, graphic processing units. As GPUs are being used more and more widely to process big data he suggested that it would be good to make Java work directly with the GPU rather than having to call out to some primitive interface. An OpenJDK called Sumatra has people working on this.

Reinhold spoke of the need for reification. Java’s generics, added in 2004, are based on the notion of erasure for good technical reasons as a sound way to create a type system that supports migration compatibility. But this creates programming problems in which the erasure approach severely limits what can be expressed. Reinhold suggested that introducing some reification and eliminating the “annoying dichotomy between primitive and reference types” would be of value.

He mentioned JNI 2.0 and said, “It just shouldn’t be so hard to integrate Java with native code after all these years.”

He called for memory efficient data structures: “As we get into big data – all this boxing and pointer chasing makes it hard to do big data well. We could have less boxing and pointer chasing and load a lot more data into memory.”

Finally, he talked about the notion of a truly modular platform. “The compact profile in Java 8 is a start but it is not flexible enough. We need to continue to unify the Java SE and Java ME platforms.”

JDK 8

OpenJDK Project Lambda

Watch Keynote and Session Highlights on Demand

More on the JavaOne 2013 Strategy Keynote - IBM's Java Focus

John Duimovich, Java CTO and IBM Distinguished Engineer, took the stage at Sunday’s JavaOne 2013 keynote and stated that IBM had a new approach to this year’s JavaOne. They arrived at JavaOne with 20 developers of all ranks, giving 28 sessions -- and only one marketing person. This was consistent with a mantra he repeated throughout his keynote: “It’s a great time to be a developer.” Duimovich also commented several times that developers ultimately have a lot of power, a recognition that leads IBM to shape many policies around the needs and desires of developers.

“With so many frameworks, languages and tools available, developers have all they need to create great applications,” he observed. “With the cloud and PaaS it is easy to go to market and, in fact, possible to take a good idea, test it, and deploy it within a day.” This, he insisted, has changed the landscape for developers. Since Java is the leading platform being used to deploy to the cloud, along with Javascript and HTML5, IBM will continue to follow and invest in developers.

Systems of Interaction and Engagement
Duimovich identified an interesting turn of events. “There is a new class of application development out there now called systems of interaction, which are typically delivered via the cloud." “Systems of interaction” is a term that encompasses what has traditionally been called systems of record, which are what many Java developers work with in Java EE using containers and databases in such domains as business process-oriented bank accounts and HR systems.

He observed that there are new and growing open cloud ecosystems centered around such platforms and projects as CloudFoundry and OpenStack, offering the next “big thing” for developers -- the ability to access a whole open stack and write applications. “What’s different about IBM is that we are investing in open things a bit earlier in their life cycle,” said Duimovich. “We don’t wait until they are done and competing with us. We try to influence them early.”

New applications are being developed that offer systems of interaction which he characterized as user-centric applications specifically targeted to support user work flow.  These are mobile apps similar to what is in a phone or a car that bridge both systems of record and social networks. “So the application might take Twitter or Facebook into account, while bridging big data and bring together capabilities that drive user-focused applications,” explained Duimovich. “You are on the way to the airport and the app tells you the plane is late; you take off and the app tells you about the weather in the city of arrival. After that, you might be interested in where to buy new clothes because your luggage is still at the airline.”

Such applications have contextual “awareness” driving them. All of this is driven by the cloud as systems of record get pushed out to the cloud as services. “IBM has created an experimental platform that developers can try out called IBM BlueMix which is based on OpenSource and CloudFoundry,” said Duimovich. “It has runtimes and frameworks, like Java, and new ones like Node, and other scripting languages like Ruby.”

IBM BlueMix offers standard services such as database, caching, and messaging, but also includes new ones like social information, and location and geo-spatial database information. “This is all brought together so the enterprise can engage with their customers in a much richer way -- the way they do that is via the cloud.”

Java Innovation at IBM
He discussed the IBM WebSphere Liberty Buildpack, which is freely available for developers. It can be downloaded and pushed to any Cloud Foundry-based system. “This is our first step in making Java to PaaS deployment as easy as possible for developers.” Liberty is a Java profile that supports Java EE and is a container offering lots of features for clouds.

IBM has also been working on a multi-tenancy JVM, which means the VM can run and stack more VMs inside of it to save space and enable faster startup performance. This allows developers to manage life cycles independently. It’s intended for those who want to get more dense and efficient deployment on the cloud. “Just as peanut butter and chocolate go together – Liberty and multi-tenancy VMs are delicious,” said Duimovich.

He explained that running the Liberty profile and on the multi-tenancy JDK results in 2-3 times faster startup and twice as much density, so developers can stack twice as many instances on a machine than before without loss of performance.

Duimovich closed with some remarks about hardware innovation at IBM, and where the Java language may be headed in the future.

IBM BlueMix

IBM WebSphere Liberty Buildpack

Watch Keynote and Session Highlights on Demand

Videos: JavaOne Keynote Highlights

Watch highlights from yesterday's JavaOne keynotes.

JavaOne Strategy Keynote Highlights 

JavaOne Technical Keynote Highlights 

Want more? Read At the JavaOne 2013 Strategy Keynote.

Video: James Gosling at NetBeans Day 2013

JavaOne kicked off yesterday with User Group Sunday, including a celebration of NetBeans' 15th birthday. The NetBeans story began in 1996, when students at Charles University in Prague attempted to write a Delphi-like Java IDE in Java. 15 years later, NetBeans has over one million active users and mind-blowing functionality.  One user in particular is James Gosling. Watch what he says about NetBeans and the cool things you can do with Java. "It's kind of everything," he says...


About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« September 2013 »
SunMonTueWedThuFriSat
1
2
4
7
8
9
14
15
16
18
20
21
27
28
29
     
       
Today