r/java • u/artpar • Oct 05 '23
How does the lombok magic work underneath?
https://www.unlogged.io/post/how-does-the-lombok-magic-work-underneath
133
Upvotes
r/java • u/artpar • Oct 05 '23
View all comments
Show parent comment
28
u/pron98 Oct 05 '23 edited Oct 05 '23
It is different in the most basic sense: Annotation processors conform to the JLS, hence they're Java (they are very carefully designed to do that, and that's why they can only generate code in different files); Lombok does not even remotely conform to the JLS, hence it's a different language, like Clojure, even though it's a language that's more similar to Java than Clojure is.
Maybe Lombok is great — it's an interesting concept for a language and it has a cleverly-constructed compiler — but it's not Java so you shouldn't say it is; it is not an annotation processor, so you shouldn't say it is; it is not a plugin so you shouldn't say it is.