Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Does Java need value types, now that Espresso is in the works?
2 points by divs1210 on July 10, 2020 | hide | past | favorite | 1 comment
A JVM in Java called Espresso is in the works under the Graal umbrella. I believe it has the potential to surpass Hotspot in terms of performance.

This paper: https://www.researchgate.net/publication/319855993_Applying_Optimizations_for_Dynamically-typed_Languages_to_Java says it can eliminate boxing etc.

Given this information, does it really make sense to add value types to the language specification?



The VM can only do most of its magic for fields where it can prove that they won’t get shared. That often is doable for local variables, but not for objects passed to or escaping a function.

Value types help (potentially a lot) in that they can make such objects more efficient. They also make it easier for the VM to prove fields won’t be shared (Rule: if it’s a value type, the value won’t be shared, because it can’t)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: