Groovy
Groovy | |
---|---|
![]() |
|
Basic data | |
Paradigms : | object-oriented , partly declarative , imperative |
Publishing year: | 2003 |
Designer: | James Strachan |
Developer: | The Groovy Project, Apache Software Foundation |
Current version | 3.0.5 (July 19, 2020) |
Typing : | strong , static , dynamic |
Influenced by: | Python , Ruby , Java |
Operating system : | platform independent |
License : | Apache License 2 (Open Source) |
groovy-lang.org |
Groovy is a programming language and scripting language that supports dynamic and static typing . It is one of the languages that are executed on the Java Virtual Machine , which enables it to be available for many platforms such as Linux , macOS and Windows in particular . The original developer James Strachan's design goal was to combine a “polished” version of Java syntax with the concepts of Ruby .
Groovy has some features that are not available in Java: native syntax for maps , lists and regular expressions , a simple template system with which HTML and SQL code can be generated, an XQuery- like syntax for running object trees, operator overloading and a native representation for BigDecimal and BigInteger.
Unlike other script languages, Groovy is not executed via an interpreted abstract syntax tree , but translated directly into Java bytecode before the script is run . Syntactically, Groovy is much further removed from Java than BeanShell , but much closer to Ruby and Python .
Groovy is used, among other things, in the financial sector due to the easy handling of BigDecimal. Groovy is considered to be better integrated than most of the other scripting languages on the JVM. This enables easy use of existing libraries or the use of Groovy objects and classes in Java.
The project started in 2003. Groovy was included in the Java Community Process for standardization in 2004 as JSR 241 . The JSR, originally founded by James Strachan, is led by Guillaume Laforge, who is also the project manager of the implementation project. Long before Groovy version 1.0, which was released in early 2007, Strachan switched to ActiveMQ. In 2015, Groovy was accepted as an incubator project by the Apache Software Foundation .
For Groovy there are plugins for Eclipse , IntelliJ IDEA , NetBeans , Visual Studio Code , vim and Emacs .
example
The following compact Groovy script source code that runs in this form
["Rod", "Carlos", "Chris"].each { println it }
corresponds to this abbreviated Java code snippet that lacks the Java method in which the code must be executed:
List.of("Rod", "Carlos", "Chris").forEach(System.out::println)
See also
- Gradle
- Grails , a Groovy based on Ruby on Rails
literature
- Dierk Koenig, Guillaume Laforge and Andrew Glover: Groovy in Action 2nd . Manning, 2015. ISBN 978-1-935182-44-3 .
- Dierk König u. a .: Groovy in action , Hanser Verlag, 2007, ISBN 978-3-446-41238-5
- Jörg Staudemeyer: Groovy - Kurz & Gut , O'Reilly Verlag, 2014, ISBN 978-3-95561-602-1
- Joachim Baumann: Groovy basics and advanced techniques , dpunkt.verlag, 2008, ISBN 978-3-89864-445-7
- Kenneth Barclay, John Savage: Groovy Programming: An Introduction for Java Developers . Morgan Kaufmann, 2006. ISBN 0-12-372507-0 .
Web links
- Official website
- Online short introduction to Groovy
- Groovy for Java developers - OpenBook from O'Reilly Verlag (PDF, approx. 3 MB)
Individual evidence
- ↑ Release 3.0.5 . July 19, 2020 (accessed July 21, 2020).
- ↑ groovy.codehaus.org: From source code to bytecode ( Memento of the original from March 8, 2009 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice.
- ↑ JSR 241 in the Java Community Process
- ^ Groovy Project Incubation Status. The Apache Software Foundation, April 16, 2015, accessed October 26, 2015 .
- ↑ code-groovy