News for hackers. Stuff that matters.
Re:RedHat Mandrel Makes Java Native by tannhaeuser on Thursday July 02, 2020 @12:43AM (#23710084)
Given the reliance of most, if not all, major Java apps on reflection, factory patterns, type parameters/generics, and other dynamisms a la Spring (which had been practiced and preached for the longest time), I'd expect most apps won't benefit from AOT compilation then.
Re:RedHat Mandrel Makes Java Native by darksaints on Thursday July 02, 2020 @01:12AM (#23710215)
Yeah, it is not going to compile everything. For most Java apps, which were built in a world where startup time was a known disadvantage of the JVM, they will probably be better off with a JITed VM anyway. This is more of a new capability, allowing JVM languages the ability to move into usecases where they have never shined before. Like CLI apps, for example. I would expect most usage of AOT compilation will be for new software, not existing software.

That being said, generics and factory patterns aren't a problem for graal at all. Reflection and dynamic class loading are the biggest offenders.

Re:RedHat Mandrel Makes Java Native by MaxBarraclough on Thursday July 02, 2020 @06:13AM (#23711699)
How about GUI? Does JavaFX rely on dynamic classloading? (I presume so, given its XML-driven approach.) If so, would it be possible to refactor it away? Or perhaps introduce a preprocessing phase of some sort?
Re:RedHat Mandrel Makes Java Native by vips7L on Friday July 03, 2020 @08:44AM (#23723485)
Gluon put out substrate which is supposed to do this:

https://github.com/gluonhq/substrate

Re:RedHat Mandrel Makes Java Native by MaxBarraclough on Friday July 03, 2020 @10:41AM (#23724445)
Great that this is in the works.

Do you know about its workings?

Re:RedHat Mandrel Makes Java Native by vips7L on Friday July 03, 2020 @02:14PM (#23726177)
I do not, other than it's based on GraalVM native image. I just know of its existence. I believe this is how gluon is pushing crossplatform for iOS since apple doesn't like the JVM JIT.
Re:RedHat Mandrel Makes Java Native by lenkite on Thursday July 02, 2020 @01:16AM (#23710236)
Reflection, factory patterns, type parameters/generics are are all handled by Graal. You just need to make the appropriate config file for your app.
Re:RedHat Mandrel Makes Java Native by ebruchez on Thursday July 02, 2020 @01:01AM (#23710156)
> type parameters/generics

Those are purely compile-time constructs.

Re:RedHat Mandrel Makes Java Native by erik_seaberg on Thursday July 02, 2020 @01:00AM (#23710153)
At least you'd still have AspectJ, because it can instrument bytecode before the AOT compiler sees it. Replacing Spring with Dagger would let you codegen your DI, but in 2020 you need a really good reason to blow that much eng work to improve your startup time.
Re:RedHat Mandrel Makes Java Native by pjmlp on Thursday July 02, 2020 @03:40AM (#23710867)
One of the things that those sticking to Java 8 are missing out are the JIT caches that are now part of all major implementations, as those features were integrated into the FOSS variants from the commercial products.
Re:RedHat Mandrel Makes Java Native by pjmlp on Thursday July 02, 2020 @01:19AM (#23710252)
Which is why most commercial AOT compilers for Java have been mostly focused on embedded deployments first, and as code caches or fast startup path on enterprise scenarios.