logoalt Hacker News

pjmlplast Monday at 7:27 AM1 replyview on HN

The goal for Valhalla is value types, reiifed generics if they ever happen is still open.

The project was announced in July 2014, hardly 20 years.

Also the reason they are still at it, is how to run old JARs withouth breaking semantics, in a Valhalla enabled JVM.

Had Oracle wanted to do a Python 3, Valhalla would have been done by now, however we all know how it went down, and Java 9 was already impactful enough to the ecosystem.


Replies

ygralast Monday at 7:53 AM

> The goal for Valhalla is value types, reified generics if they ever happen is still open.

But if they want the List<int> use case to be fast they basically have to keep this information at runtime and will have to make changes to how objects are laid out in memory. I'm not sure there's a good way around that if you want List<int> to be backed by an int[] and `get` returning an int instead of an Object. This may or may not be available to developers and remain internal to the JVM in the beginning, but I think it's necessary to enable the desired performance gains.

They also state on the website: »Supplementary changes to Java’s generics will carry these performance gains into generic APIs.«

show 1 reply