I think the Wikipedia explanation is actually not very well formulated.
Reflection (or introspection) is not about creating code at runtime, but rather about the ability of the code to reflect itself at runtime (and modifying its behavior based on this). Examples are obtaining information about the type of an object (for example, RTTI in C ++) or obtaining metadata associated with an object (for example, annotations in Java).
Generating run-time code is more about first-class than reflection, so I would say that the current Wikipedia article is wrong.
UPDATE
In other words, answer this:
Ok, now my question is: how can a static language (without the ability of eval) have a reflection (like Java)?
... it would be that reflection is independent of evel's ability. These are two separate language features.
And also, as Giulio Franco pointed out in the comments: Java is capable of generating runtime code (script manipulation) (see CGLIB , for example).
source share