Recent Valhalla News — Late January 2020
Recent Valhalla News — Late January 2020
In recent months, there has been significant discussion, design, implementation, and testing related to aspects of OpenJDK Project Valhalla.
Join the DZone community and get the full member experience.Join For Free
There has been significant discussion, design, implementation, and testing related to aspects of OpenJDK Project Valhalla in recent months, but a couple of things have struck me as particularly interesting over the last few days in terms of Valhalla progress. I briefly summarize those here.
You may also like: Project Valhalla: A First Look at LW2 Inline Types
Latest on JDK Release Associated With Valhalla
There are several interesting discussion points in these Valhalla Expert Group Meeting notes, but none may be more interesting than the answer to the question, "Is there a JDK release targeted for Valhalla?" In response to that question, the notes provide "bullets" that constitute Brian Goetz's response:
- "Too early to say"
- "VM work is consolidating"
- "Language work still needs significant work before having a road-map"
- "First release won't have all the features but have to have further additions in mind"
Although there's still much work required for Valhalla, I interpret these comments in a positive manner, especially when compared to responses to a similar question in months and years past.
The Future of
The previously referenced Valhalla Expert Group Meeting Notes for 29 January 2020 include this note attributed to Brian Goetz: "Retrofitting of Integer: seemed impossible, but now seems more feasible."
I am not certain of the context of those notes, but reading these notes did make me think of Brian Goetz's discussion in the December 2019 edition of "State of Valhalla" regarding "
Integer and friends."
In particular, Goetz discusses migrating primitives by changing the "wrapper types (such as
Integer and friends) to be interfaces" so that "these interfaces will become the reference projection for the primitives." Or, as Rafael Winterhalter articulates it, "inline class int implements Integer."
Related to this, Goetz wrote in the 6 December 2019 post "Long-awaited State of the Values docs" (I added emphasis):
The other major AHA buried in this document is the realization that the language and VM models need not align 100%. LWorld is the right VM model, but we can use it as a _translation target_ rather than our language model. This allows the primitives to blossom into full inline classes. In the new world, we have inline classes and identity classes, primitives are mostly just inline classes, and the relationship between inlines and identity classes is isomorphic to the current relationship between primitives and classes.
Goetz also discusses "migrating
Integer and friends to be inline-friendly" in the post " Superclasses for inline classes."
New Edition of "State of Valhalla" Coming Soon?
It sounds possible that there will soon be an updated version of "State of Valhalla." In the 29 January 2020 Vallhalla EG Meeting notes, there are these notes attributed to Brian Goetz:
- "Working on reference projection as an interface or an abstract class"
- "Possible update next week, working on simplification"
- "Would lead to rewrite of 'State of Valhalla'"
In the December 2019 edition of "State of Valhalla," Goetz introduced "new top interfaces"
To distinguish between inline and identity classes at compile time and runtime, we introduce a pair of restricted interfaces:
InlineObject. Inline classes implicitly implement
InlineObject; identity classes implicitly implement
JDK-8237069 ("[lworld] Introduce and wire-in the new top interfaces") captures the need to write these interfaces and Srikanth Adayapalam has added these new interfaces to repo-valhalla. Adayapalam describes these changes in the post "[LWorld] Definition and wiring in of the new top interface types.," which includes a link to the changeset. This changeset includes the new interfaces IdentityObject and InlineObject. From this new source, we can see that both interfaces are in the java.lang package and both interfaces have no methods defined (" marker" or "tagging" interfaces similar to java.io.Serializable).
The Javadoc for
IdentityObject simply states: "A restricted interface implemented by all identity objects." Similarly, the Javadoc for
InlineObject simply states: "A restricted interface implemented by all inline objects."
Project Valhalla continues to progress and developments in recent months create a feeling that Valhalla design and implementation are solidifying.
Published at DZone with permission of Dustin Marx , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.