groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesper Steen Møller <>
Subject Re: [VOTE] Release Apache Groovy 2.6.0-alpha-1
Date Tue, 22 Aug 2017 12:11:36 GMT
It's two problems in one.

A) The code generation itself is not quite so bad as you might think, especially if we for
a moment ignore serializable lambdas. For instance, here's how Eclipse's JDT does it:

It's a matter of recording a bootstrap method in the constant pool of the class, and then
emitting a invokeDynamic to "hit" that bootstrap method.

B) The really tricky issue is the type analysis you need to have in place to figure out the
type signature of the Lambdas type signature and implementation method. Both javac and  ECJ
grew significantly in complexity in working to find this out, including backtracking. The
choice of the lambda's type will in turn affect which possible overload to call.

Only the static compilation will have a chance to do this right, and getting it "perfect"
(including variable and member capture) is pretty tricky.


> On 22 Aug 2017, at 12.11, Paul King <> wrote:
> It's on my TODO list too! But it's a long list! :-)
> Paul.
> On Tue, Aug 22, 2017 at 6:58 PM, Daniel Sun < <>>
> Hi Paul,
>      As to the native lambdas, it is always on my TODO list. I wish I had
> enough time to study how to generate bytecode for it...
> Cheers,
> Daniel.Sun
> --
> View this message in context:
> Sent from the Groovy Dev mailing list archive at

View raw message