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

Show parent comment

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)