Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9157

Conflicting statements in Groovy 3.0 release notes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chengas123 Java Developer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: