jastrachan | 8 Oct 08:53 2004

Re: [groovy-dev] making the bytecode generation more understandable

On 7 Oct 2004, at 22:55, Neil Ellis wrote:

> Forgive me if I'm wrong here, but from what I can see from looking at
> the parser and produced bytecode it would seem near impossible to get
> Java like performance for Groovy as many decisions are deliberately
> (because of the nature of the language) deduced at runtime.

Pretty much ever point in the language, a type modifier is possible. So 
for a variable, parameter, field you can specify the type. If you 
specify that, then we can make static method invocations / field 
accesses etc.

> I would suggest that it would be quite difficult to have Groovy make
> compile time decisions without substantially changing the nature of the
> language.


> While types are deduced at runtime, reflective measures (such as the
> Invoker class) would seem a necessity and by nature these method calls
> will keep Groovy a little behind on performance.
> Basically the issue is that Java thinks in strongly typed compile time
> decisions and Groovy doesn't.

No - Groovy can be used in both static or dynamic typed modes.