Valhalla - Where Are We? by Brian Goetz

preview_player
Показать описание
Brian will give an update on Project Valhalla. Valhalla is augmenting the Java object model with value objects, combining the abstractions of object-oriented programming with the performance characteristics of simple primitives. Supplementary changes to Java’s generics will carry these performance gains into generic APIs.
Рекомендации по теме
Комментарии
Автор

I don't use Java but stumbled upon this talk, it was fantastic! Swift is probably my favourite language and it was really cool to hear you talk about how you came to a lot of the same conclusions they did. Of course the Swift team didn't have a 30 year legacy to contend with.

I'll be really interested to see the Java team's answer to generics and union types when the time comes.

MessioticRambles
Автор

Looking at the slide at 20:22. Using "new" in a loop like that would require some habit changing, for sure. But it's nothing new (no pun intended): with Loom, people had to change their habits around pooling threads and otherwise treating them as a scarce resource.

PavelRappo
Автор

Useful information! Feels like Valhalla is just around the corner now (maybe 2 years if we ask nicely?)

My only requests for Valhalla are:

1) if we offer certain guarantees in Java, I don’t think we should force the VM to make those guarantees in all situations as well. A general purpose VM is better for everyone!

2) The memory model of the program, at least at a high level, is inherent to the work of the programmer - hence I think we should have reliable control over things like secret boxing of large value objects (e.g. base it on an exact byte size and offer an annotation or compiler flag to fail at compile-time when a class or function exceeds that limit, etc.) Depending on the byte limit, this could be a *major* headache for game developers to track down.

3) Multi-threading is already a massive “abstraction leak” of how a program is supposed to work imo. If there’s a critical section error, then all bets are already off, no? So I would rather Range be a value class and multi-threading have slightly worse consequences for failure than the other way around. (Those multithreaded guys are smart anyway, they can handle it!)

In any case, thank you! I learned a lot from your talks that I’ll be applying to my own projects as well. Complexity is hard to deal with!

philbertius
Автор

So I'm guessing any attempt to get object identity will throw an exception when done on value class instances?

If so, I have this question: after changing obvious JRE classes to value objects, is there any estimate how much existing code will start failing because someone, somewhere, does synchronized() on an Integer? Obviously not much because it's probably a mistake, but it wasn't forbidden before as such.

radekc
Автор

I think it's somewhat strange the language never got a text primitive

shadeblackwolf
Автор

I'd be disappointed if we land in a place where "long" is not nullable but "complex" is. Seems like we shouldn't need to say "complex!" everywhere.

prdoyle
Автор

I feel like this is so 'rust-like', but with a lot of burden rust doesn't need to bare.

zhenyuzhang
Автор

Why does the presenter as if these problems were not already solved in C#?

The innovation was already done in that ecosystem. Java is just playing catch-up.

alexsmart
Автор

Java has basically becoming the new Cobol, little to no forward movement and an absolute focus on keeping legacy code bases around forever.

---...---...---...---...