groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <>
Subject Re: Is it possible to enable CompileStatic for an entire project
Date Fri, 24 Jun 2016 20:55:50 GMT
On 24.06.2016 18:12, Mr Andersson wrote:
>> static Groovy is on par most of the time, dynamic Groovy depends, but
>> I think it is more in the range of being 2.5 times java (100ms runtime
>> becomes 250ms). I think that is close enough.... and there is still
>> some potential
> But a Java fork would be almost 1:1, if all it generated was Java like
> code.

Java like code means to do what Java does. Basically you want a language 
that includes Java and does things different only in parts, which are 
not in Java... That means loosing ==, that means loosing our array 
access logic, that means loosing double dispatch of course.. doing 
builders will become difficult... unless you want to do them like 
Kotlin. Runtime meta programming basically impossible

> I think the performance issues is the invokeDynamic calls that
> groovy does internally, and they might not necessarily be needed.

there not that many of those, really.

> However, any editor could in principle, and in theory tell you on any
> call, what exceptions can be thrown and what kind of exceptions you
> could choose to handle. Ofcourse that would result in many exceptions
> often but the need to declare them on each method is largely syntatical
> and ugly.

think of a public method and an unknown subclass overriding that method. 
How can your editor know, that your library method can only throw the 
exceptions you use in your code and no other? It cannot, unless you make 
the method final, or say you donĀ“t do libraries ;)

bye Jochen

View raw message