You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/06/06 04:01:00 UTC

[jira] [Commented] (GROOVY-9157) Conflicting statements in Groovy 3.0 release notes

    [ https://issues.apache.org/jira/browse/GROOVY-9157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16857264#comment-16857264 ] 

Paul King commented on GROOVY-9157:
-----------------------------------

That note from the release notes is slightly dated. We now have a more optimized implementation for lambda expressions. Instead of creating instances of {{Closure}}, we now create instances of {{LambdaExpression}} which is a much more streamlined and efficient class. We may yet optimize that further and support fully native lambda expressions similar to how we now support native method references:

[http://groovy-lang.org/releasenotes/groovy-3.0.html#_method_references]

We will likely adopt a similar approach where the fully native bytecode is produced in {{@CompileStatic}} blocks since there are pros and cons of each approach and it would be nice to have both possibilities available.

In any case, we should update the implementation note in the release notes and the bit about JDK7 should simply move into the 2.6 release notes. That branch is retired but the comment is applicable to the alpha releases we made.

> Conflicting statements in Groovy 3.0 release notes
> --------------------------------------------------
>
>                 Key: GROOVY-9157
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9157
>             Project: Groovy
>          Issue Type: Bug
>          Components: Documentation, parser-antlr4, release
>            Reporter: Ben McCann
>            Priority: Major
>
> The release notes say that lambda expressions are turned into Groovy closures to support JDK7. It then later says that only JDK8+ is supported. Perhaps the strategy for lambda syntax should be reconsidered if we're now supporting only JDK8+? (I'm personally supportive of supporting only JDK8+)
> *Java-style Lambda syntax*
> The Java syntax for lambda expressions is now supported.
> Note Experimental Status: While this feature will remain, we regard its current implementation as experimental. Currently, lambda expressions are turned into equivalent Groovy closures. An advantage of this approach is that it works even when using JDK7 (i.e. using Groovy 2.6 with Parrot parser enabled on a version 7 JRE) but it doesn’t easily enable the same level of type inference and checking that Java 8 offers even when using @TypeChecked or @CompileStatic and might be much less performant in a range of scenarios. We are currently exploring supporting native lambda expression either instead of, or in addition to, conversion to closures. If we change the implementation, most users would experience no behavioral differences in their programs though a native implementation would likely be faster but only work on JDK8+. Our goal is to clarify this aspect of the language before reaching release candidate status.
> *JDK requirements*
> Groovy 3.0 requires JDK9+ to build and JDK8 is the minimum version of the JRE that we support.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)