Groovy 3 Adds Parrot Parser
Written by Kay Ewbank   
Monday, 17 February 2020

The latest version of Apache Groovy is available with with a brand new parser (code-named Parrot) among other improvements. Groovy is an optionally typed and dynamic language, with static-typing and static compilation capabilities, for the Java platform.

The aim of Groovy is to improve developer productivity because of its concise, familiar and easy to learn syntax. The developers say it integrates smoothly with any Java program, and delivers powerful features including scripting capabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functional programming.

groovy

Groovy has both a dynamic nature (supporting code styles similar to Ruby and Python) as well as a static nature (supporting styles similar to Java, Kotlin and Scala). The developers of Groovy aim to support and improve both those aspects of the language. In this release Groovy has been improved to better manage null values. You can use Groovy's null-safe navigation operator, piggy back on Java's Optional or provide a null-checking extension to the type checker. These are augmented in Groovy 3 with null-safe indexing for arrays, lists and maps and a new AST transformation @NullCheck for automatically instrumenting code with null checks.

Performance improvements have been gained by the use of more efficient type resolution during compilation.The addition of a Maven Bill Of Materials (BOM) allows more flexible usage of Groovy from other projects.

The new Parrot parser is described as more flexible and maintainable than the parser in previous versions of Groovy. It’s called the Parrot parser because in the early days of creating the parser, the goal was for the new parser’s output to be an exact echo of what the old parser produced. It has since been extended to support additional syntax options and language features.

Other improvements include support for Java’s class do/while loop, as well as  support for the more elaborate form of Java’s classic for loop with comma-separate expressions. Support has also been added for Java-style array initialization and for Lambda expressions.

groovy 

 

 

More Information

Groovy Website

Related Articles

Groovy Joins Apache

Groovy And Grails Lose Sponsor

New Groovy       

Gradle 2.0 Released       

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Android Studio Iguana With Crash Reports
05/03/2024

Google has announced that the latest version of Android Studio, Iguana, is now stable. It has version control system support in App Quality Insights and new built-in support for creating baseline prof [ ... ]



Android 15 Developer Preview Released
19/02/2024

Android 15 Developer Preview has just been released by the Android team with features including partial screen sharing and the latest version of the Privacy Sandbox.


More News

Last Updated ( Monday, 17 February 2020 )