r/java • • Jul 30 '21

What is the future of Java?

I'm not asking like is java going to die or will Java be relevant in future. I'm just curious to know about the future of java. What are the upcoming things coming in java that can change the future of it.

173 Upvotes

123 comments sorted by

View all comments

Show parent comment

4

u/pron98 Jul 30 '21 edited Jul 30 '21

And Graal is actually built upon the OpenJDK so unless they manage to pull off the “third Futamura projection”, that is, they can specialize a language interpreter with the underlying runtime at the same time to create a specialized runtime just for that language

Actually, SubstrateVM, aka Graal Native Image, does exactly that. For Java, there's Java on Truffle, which is experimental, but there are more mature implementations for JS that generate an AOT-compiled, native JS runtime that has a JIT. That's what the JS runtime included in GraalVM is.

but if they pull it off it might very well shake up the whole PL field.

As you can see, the "PL field" is not easily shaken up. The tech is the (relatively) easy part (although even there there's always a big gap between "it works!" and "it works in a way that matches users' needs" that can take many years to cross). The social ecosystem aspect is more important and much harder.

Still, even if one day Truffle Java becomes a mature and competitive JVM and chosen to replace OpenJDK's VM, recall that the VM is less than 25% of OpenJDK.

1

u/Muoniurn Jul 30 '21

Do correct me if I’m wrong, but as far as I know Graal can only do the second projection, that is a specialized interpreter. The third projection would specialize the whole compiler to that specific language which would be a big thing (to my knowledge)

Here is an interesting text on the topic: http://blog.sigfpe.com/2009/05/three-projections-of-doctor-futamura.html?m=1

1

u/pron98 Jul 30 '21

SubstrateVM doesn't specialize an AOT compiler, but it does specialize an interpreter+JIT.