h1 Introduction to Groovy
Groovy is a new agile dynamic language for the JVM combining lots of great features from languages like Python, Ruby and Smalltalk
and making them available to the Java developers using a Java-like syntax.
Groovy is designed to help you get things done on the Java platform in a quicker, more concise and fun way - bringing the power
of Python and Ruby inside the Java platform.
Groovy can be used as an alternative compiler to javac to generate standard Java bytecode to be used by any Java project
or it can be used dynamically as an alternative language such as for scripting Java objects, templating or writing unit test cases.
h2 Features
- Closure support
- Native syntax for Lists and Maps
- Groovy Markup
- Groovy Path expression language
- Groovlets for implementing Servlets easily in simple Groovy scripts
- Groovy SQL for making SQL more Groovy
- Groovy Beans for simpler syntax for working with beans
- Groovy Template Engines which are pluggable, simple to use, integrate GPath and compile to bytecode
- Ant Scripting
- Regex syntax for neater scripting with regular expressions
- Operator Overloading to simplify working with datatypes Collections and Maps
- Polymorphic iteration and Autoboxing
- Compiles straight to Java bytecode & works cleanly with all existing Java objects & libraries
h2 Getting started
Probably the best way to get started on Groovy is to install a binary distribution and
play with it.
Or try reading the user guide or browsing some of the links on the left of this page.
The Groovy development team is happy to announce the joint releases of Groovy 1.8.9, 2.0.7, and 2.1.1!
InfoQ interview Groovy project lead Guillaume Laforge about the recent release of Groovy 2.1.
In this interview, the discussion centered around the new features of that release, including coverage of the "invoke dynamic" support, performance, meta-annotations, compiler configuration, and more.
- offers full support for the JDK 7 “invoke dynamic” bytecode instruction and API,
- goes beyond conventional static type checking capabilities with a special annotation to assist with documentation and type safety of DSLs and adds static type checker extensions,
- provides additional compilation customization options,
- features a meta-annotation facility for combining annotations elegantly,
- and provides various other enhancements and minor improvements.
- complete invoke dynamic support when running with the "indy" JAR on JDK 7
- upgrade to GPars 1.0: the Groovy distribution now bundles the GPars 1.0 final release
- @DelegatesTo annotation: to help IDEs and the static type checker and compiler to know that method calls in a method parameter closure are delegated to another parameter of the method -- nice for DSLs like in Gradle build files
- custom type checking extensions: so you can type check your DSLs at compile-time with your own logic
- a meta-annotation system: which allows you to define a new annotation actually combining several others -- which also means being able to apply several AST transformations with a single custom annotation
- custom base script class flag for the groovyc compiler: to set a base script class when compiling Groovy scripts
- compiler configuration script: to let you define various configuration options for the Groovy compiler, like specifying custom file extensions, various compilation customizers to apply, etc.
- compilation customizer builder: a special builder for specifying compilation customizers
- jar://, file://, http:// prefix support for launching Groovy scripts from the command line
- and many bug fixes and various minor improvements
As promised before the Christmas / New Year's Eve break, I'm happy to announce the availability of the Release Candidate for Groovy 2.1.0.
- complete invoke dynamic support when running with the "indy" JAR on JDK 7
- upgrade to GPars 1.0: the Groovy distribution now bundles the GPars 1.0 final release
- @DelegatesTo annotation: to help IDEs and the static type checker and compiler to know that method calls in a method parameter closure are delegated to another parameter of the method -- nice for DSLs like in Gradle build files
- custom type checking extensions: so you can type check your DSLs at compile-time with your own logic
- a meta-annotation system: which allows you to define a new annotation actually combining several others -- which also means being able to apply several AST transformations with a single custom annotation
- custom base script class flag for the groovyc compiler: to set a base script class when compiling Groovy scripts
- compiler configuration script: to let you define various configuration options for the Groovy compiler, like specifying custom file extensions, various compilation customizers to apply, etc.
- compilation customizer builder: a special builder for specifying compilation customizers
- jar://, file://, http:// prefix support for launching Groovy scripts from the command line
- and many bug fixes and various minor improvements
Since the world didn't seem to end today, it is with great pleasure that we bring under your Christmas tree the following presents: the release of Groovy 2.1.0-beta-1 and Groovy 2.0.6.
- complete invoke dynamic support when running with the "indy" JAR on JDK 7
- upgrade to GPars 1.0: the Groovy distribution now bundles the GPars 1.0 final release
- @DelegatesTo annotation: to help IDEs and the static type checker and compiler to know that method calls in a method parameter closure are delegated to another parameter of the method -- nice for DSLs like in Gradle build files
- custom type checking extensions: so you can type check your DSLs at compile-time with your own logic
- a meta-annotation system: which allows you to define a new annotation actually combining several others -- which also means being able to apply several AST transformations with a single custom annotation
- custom base script class flag for the groovyc compiler: to set a base script class when compiling Groovy scripts
- compiler configuration script: to let you define various configuration options for the Groovy compiler, like specifying custom file extensions, various compilation customizers to apply, etc.
- compilation customizer builder: a special builder for specifying compilation customizers
- jar://, file://, http:// prefix support for launching Groovy scripts from the command line
InfoQ is running a reader-driven research about JVM languages. If you like Groovy, don't forget to vote for us ![]()
Groovy project manager, Guillaume Laforge, recently presented an online webinar on Groovy 2.0.
You can watch it on SpringSource's Dev channel on YouTube: What's new in Groovy 2.0?
And you can have a look at the slides on Slideshare.
Syndicate this site via RSS