Oracle Valhalla
Written by Kay Ewbank   
Tuesday, 05 August 2014

Oracle has announced an experimental OpenJDK project for trialing new features for Java.

Project Valhalla for Java is in its early experimental stages, and it will be well into the future – past JDK in 2016 – before any changes to the language syntax will be incorporated into Java. The proposed initial enhancements are support for generics over primitives, and for value types.

 

 

In the announcement of the project Oracle’s Brian Goetz describes it as Oracle’s

“incubation grounds for advanced language-VM co-development projects such as Value Types (http://cr.openjdk.java.net/~jrose/values/values-0.html)

and Generic Specialization

(https://bugs.openjdk.java.net/browse/JDK-8046267).

Goetz says that it is likely that the first several rounds will not look anything like the final result, adding

“don't assume that just because the prototype operates by name mangling, or classfile mangling, or requires the operator to do the Chicken Dance, that this is the ultimate plan – it’s just an expedient way to get to the point where we can experiment with something tangible.”

One area Oracle is looking at changing is the way Java handles generic types. At the moment, generic type arguments are constrained to extend Object, meaning that they are not compatible with primitive instantiations unless boxing is used, which undermines performance. In other words you can't write a generic sort that works with integers or floats without wrapping them as objects. 

The proposal is that Java will support specialization of generic classes and interfaces when instantiated with primitive type arguments. Generic specialization is a feature that many developers have requested and that has already been added to some other JVM languages.

The second major idea proposed for Valhalla is value types. Describing them on OpenJDK as “Codes like a class, works like an int,” the Valhalla team of John Rose, Brian Goetz, and Guy Steele say the idea is to add support for small, immutable, value types with no identity.

Developers would be able to use them as though they were a new user-defined primitive type added to the current list of eight hardwired primitive types: byte, short, int, long, float, double, char, and boolean. The Valhalla team expects to borrow most of the definition and encapsulation machinery from classes, allowing users to easily and safely build new value-based data structures. They say:

“in particular, we believe that it is useful, both at the JVM and language levels, to regard value type definitions as specially marked, specially restricted class definitions.”

If you’re interested in keeping track of Valhalla, you can subscribe to the valhalla-dev mailing list.

It is worth keeping in mind the Wikipedia entry on Valhalla:

"Valhalla (from Old Norse Valhöll "hall of the slain") ...  half of those who die in combat travel to Valhalla upon death..."

 

 

More Information

valhalla-dev mailing list

Related Articles

Jigsaw Shelved Until Java 9

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


Udacity's New Discovering Ethical AI Course
12/04/2024

Udacity has just launched an hour-long course on Ethical AI. Intended for a wide audience across many industries, it introduces to basic concepts and terms needed to step into the world of Ethica [ ... ]



CISA Offers More Support For Open Source
22/03/2024

The Cybersecurity and Infrastructure Security Agency (CISA) has announced a number of key actions that they hope will improve the open source ecosystem.


More News

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 05 August 2014 )