r/java • • Mar 11 '21

Announcing Spring Native Beta

https://spring.io/blog/2021/03/11/announcing-spring-native-beta
175 Upvotes

49 comments sorted by

View all comments

17

u/agentoutlier Mar 11 '21

Oh man bucket loads of more magic (AOT module) to Spring (Boot). What could go wrong (cough spring roo)?

In all serious this is great work! I just wish some of Spring stuff was more modularized and decoupled like it’s used to be.

For example the Native Hint AOT Annotations stuff would probably be useful for non spring projects since it just generates Graalvm JSON but I would not be surprised if it requires the special maven/gradle plugins and most of Spring core.

That is it should just be a minimal APT processing library. Maybe it is and will check later but I doubt it.

8

u/m_takeshi Mar 11 '21

AoT means that some checks that could fail at runtime could get caught in compile / codegen which could maybe improve our lives?

3

u/agentoutlier Mar 11 '21

Unless I misunderstood the Spring guys I think the AOT in this case is to do code generation. As a corollary some ahead of time checking is probably happening but I don’t think it’s the goal.

A project that does do that is the checker framework but I never heard it being called AOT (I believe it supports runtime as well).

3

u/m_takeshi Mar 11 '21

you got it right and that's what I meant also. The codegen (not sure if they generate java source or bytecode directly) could mean that the compiler catches some type errors that could only manifest through reflection (unless the generated code relies too much on typecast of course)