SlideShare a Scribd company logo
A Very Groovy Birthday Hamlet D'Arcy
Canoo Engineering AG
@HamletDRC
A Very Groovy Birthday Geneva JUG – 2 Years
Hamlet D'Arcy
Canoo Engineering AG
@HamletDRC
A Very Groovy Birthday Geneva JUG – 2 Years Groovy – 10 th  Year
Hamlet D'Arcy
Canoo Engineering AG
@HamletDRC
2003
2003
2003 Closure
“Refactored CompositeString  to be called ______ :)”
2003 Closure GString
2003 Range Closure GString
2003 Range MarkupBuilder Closure GString
new  groovy.xml.MarkupBuilder().root() { ( 1 .. 3 ).each { child(id:  "child $it " ) } }
new  groovy.xml.MarkupBuilder().root() { ( 1 .. 3 ).each { child(id:  &quot;child $it &quot; ) } } <root> <child id='child1' /> <child id='child2' /> <child id='child3' /> </root>
2004 2003 Range MarkupBuilder Closure GString
2004 2003 JSR-241 Range MarkupBuilder Closure GString
2004 2003 JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
def  text =  '''Dear $person, So nice to meet you in <% print city %>. Sincerely, $signed''' def  vars = [person: 'JUG' , city: 'Geneva' , signed: 'Hamlet' ]  def  engine = new groovy.text.SimpleTemplateEngine()  engine.createTemplate(text).make(vars)
def  text =  '''Dear $person, So nice to meet you in <% print city %>. Sincerely, $signed''' def  vars = [person: 'JUG' , city: 'Geneva' , signed: 'Hamlet' ]  def  engine = new groovy.text.SimpleTemplateEngine()  engine.createTemplate(text).make(vars)  Dear JUG, So nice to meet you in Geneva. Sincerely, Hamlet
2005 2004 2003 JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
2006 2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
2006 2005 2004 2003 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 0.1-0.3
2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.1-0.3
String. class .metaClass.default = { self ->  self ?:  '<unknown>' } '' .default()
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
@Grab( group= 'org.ccil.cowan.tagsoup' ,  module= 'tagsoup' ,  version= '1.2' ) import  org.ccil.cowan.tagsoup.Parser def  parser = new XmlParser(new Parser()) def  url =  'http://twitter.com/hamletdrc' def  html = parser.parse(url)
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
def  (x, y) = [ 1 ,  2 ] @Singleton, @Lazy, @Immutable, @Delegate,  ... and more
def  (x, y) = [ 1 ,  2 ] assert  x == 1 assert  y == 2
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.3 0.9 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
Command Chains stand 7.minutes at busstop ride 10.stops on bus towards Basel
JSON Builder import  groovy.json.* def  json =  new  JsonBuilder() json.person { name  'William Tell' status  'mythological' }
AST Transformations @ToString, @EqualsAndHashCode @TupleConstructor, @Canonical @Log, @Field, @Package, ... and many more
2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0 0.17 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 2.0 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0 0.17 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
void  method(String message) { if  (message !=  null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } }
@groovy.transform.TypeChecked void  method(String message) { if  (message !=  null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } }
@groovy.transform.TypeChecked void  method(String message) { if  (message !=  null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } } 1 compilation error: [Static type checking] - Cannot find matching  method java.lang.String#toUppercase() at line: 4, column: 43
void  method(Object message) { if  (message  instanceof  String) { log.info( &quot;Received input: &quot;  + message.toUpperCase() ); } }
@groovy.transform.TypeChecked void  method(Object message) { if  (message  instanceof  String) { log.info( &quot;Received input: ${ message.toUpperCase() }&quot; ) } }
def   keys =  [x: 1 ,y: 2 ,z: 3 ] *.key def   values =  [x: '1' ,y: '2' ,z: '3' ] *.value keys*.toUpperCase() values*.toUpperCase()
Dimension d1 = [ 100 ]  Dimension d2 = [ '100' , '200' ]  Dimension d3 =  new   Dimension(   width:  100 ,    height:  100 ,    depth:  100 )
@groovy.transform.TypeChecked –  Not a static compiler –  No new syntax  –  No new semantics –  Bytecode not changed –  Targeted at Java developers

More Related Content

PDF
Osol Pgsql
PDF
Make Testing Groovy
DOC
X64服务器 lnmp服务器部署标准 new
PDF
Deterministic simulation testing
PDF
Varnish Cache and Django (Falcon, Flask etc)
PDF
Living With Garbage
PDF
CSS parsing: performance tips & tricks
PDF
BlockChain implementation by python
Osol Pgsql
Make Testing Groovy
X64服务器 lnmp服务器部署标准 new
Deterministic simulation testing
Varnish Cache and Django (Falcon, Flask etc)
Living With Garbage
CSS parsing: performance tips & tricks
BlockChain implementation by python

What's hot (20)

PPTX
concurrency gpars
PDF
Profiling and optimizing go programs
PPTX
Down to Stack Traces, up from Heap Dumps
PDF
Redis 101
PDF
MongoDB - Monitoring & queueing
PPTX
Groovy
PDF
Leap Ahead with Redis 6.2
PDF
CRUFT! - Peter Kriens, President, aQute
PDF
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
PDF
Rop and it's friends
PDF
Feb14 successful development
PDF
Pwning in c++ (basic)
PDF
Kubernetes Tutorial
PPS
Bdd: Tdd and beyond the infinite
PDF
iCloud keychain
PDF
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
PDF
Monitoring MongoDB (MongoSV)
PPTX
Project in programming
PDF
Common scenarios in vcl
PDF
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
concurrency gpars
Profiling and optimizing go programs
Down to Stack Traces, up from Heap Dumps
Redis 101
MongoDB - Monitoring & queueing
Groovy
Leap Ahead with Redis 6.2
CRUFT! - Peter Kriens, President, aQute
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
Rop and it's friends
Feb14 successful development
Pwning in c++ (basic)
Kubernetes Tutorial
Bdd: Tdd and beyond the infinite
iCloud keychain
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
Monitoring MongoDB (MongoSV)
Project in programming
Common scenarios in vcl
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Ad

Viewers also liked (20)

ODP
Static Analysis and AST Transformations
PPTX
Презентация Программы лингвистического обеспечения города Сочи
ODP
New Ideas for Old Code - Greach
PDF
Is MT ready for e-Government? The Latvian Story. Indra Samite, Tilde
PDF
Translation Automation Going Cloud: The New Landscape for Professional Transl...
ODP
Static Analysis in IDEA
KEY
33rd degree conference
PDF
PPTX
ELIA - Together: The growth from freelancer to translation company - Anja Jones
PDF
Aquaprofit - Chinese
PPT
example 4
PDF
The Elements of Service-Learning
PPTX
Periodismo político (1)
PPT
Trabalhos finais oa12 ut6 2010 2011
PPT
example 5
DOCX
Competency Statements
PPTX
Castelao
DOC
Holistic Health Examination Dr Shriniwas Kashalikar
DOCX
DOCX
JTTRANS
Static Analysis and AST Transformations
Презентация Программы лингвистического обеспечения города Сочи
New Ideas for Old Code - Greach
Is MT ready for e-Government? The Latvian Story. Indra Samite, Tilde
Translation Automation Going Cloud: The New Landscape for Professional Transl...
Static Analysis in IDEA
33rd degree conference
ELIA - Together: The growth from freelancer to translation company - Anja Jones
Aquaprofit - Chinese
example 4
The Elements of Service-Learning
Periodismo político (1)
Trabalhos finais oa12 ut6 2010 2011
example 5
Competency Statements
Castelao
Holistic Health Examination Dr Shriniwas Kashalikar
JTTRANS
Ad

Similar to 10 Years of Groovy (20)

PDF
The report of JavaOne2011 about groovy
PPTX
XML-Free Programming
PDF
JRuby @ Boulder Ruby
PDF
GR8Conf 2011: STS DSL Support
PDF
Better DSL Support for Groovy-Eclipse
ODP
Naïveté vs. Experience
KEY
Introduction to Groovy
PPT
2007 09 10 Fzi Training Groovy Grails V Ws
PDF
Groovy Fly Through
PPT
Slides
PDF
Groovy On Trading Desk (2010)
PDF
Groovy.pptx
PDF
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
ODP
Getting groovy (ODP)
PDF
concurrency with GPars
PDF
淺談 Groovy 與 AWS 雲端應用開發整合
PDF
JJUG CCC 2011 Spring
PDF
(Greach 2015) Dsl'ing your Groovy
PDF
Why Grails
The report of JavaOne2011 about groovy
XML-Free Programming
JRuby @ Boulder Ruby
GR8Conf 2011: STS DSL Support
Better DSL Support for Groovy-Eclipse
Naïveté vs. Experience
Introduction to Groovy
2007 09 10 Fzi Training Groovy Grails V Ws
Groovy Fly Through
Slides
Groovy On Trading Desk (2010)
Groovy.pptx
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Getting groovy (ODP)
concurrency with GPars
淺談 Groovy 與 AWS 雲端應用開發整合
JJUG CCC 2011 Spring
(Greach 2015) Dsl'ing your Groovy
Why Grails

More from HamletDRC (6)

ODP
AST Transformations at JFokus
ODP
Java Boilerplate Busters
ODP
Groovy Ast Transformations (greach)
ODP
AST Transformations
ODP
Java Boilerplate Busters
ODP
Ast transformations
AST Transformations at JFokus
Java Boilerplate Busters
Groovy Ast Transformations (greach)
AST Transformations
Java Boilerplate Busters
Ast transformations

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Electronic commerce courselecture one. Pdf
PPTX
Cloud computing and distributed systems.
PDF
Modernizing your data center with Dell and AMD
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation theory and applications.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
KodekX | Application Modernization Development
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
A Presentation on Artificial Intelligence
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Electronic commerce courselecture one. Pdf
Cloud computing and distributed systems.
Modernizing your data center with Dell and AMD
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation theory and applications.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation_ Review paper, used for researhc scholars
KodekX | Application Modernization Development
CIFDAQ's Market Insight: SEC Turns Pro Crypto

10 Years of Groovy

  • 1. A Very Groovy Birthday Hamlet D'Arcy
  • 4. A Very Groovy Birthday Geneva JUG – 2 Years
  • 8. A Very Groovy Birthday Geneva JUG – 2 Years Groovy – 10 th Year
  • 12. 2003
  • 13. 2003
  • 15. “Refactored CompositeString to be called ______ :)”
  • 18. 2003 Range MarkupBuilder Closure GString
  • 19. new groovy.xml.MarkupBuilder().root() { ( 1 .. 3 ).each { child(id: &quot;child $it &quot; ) } }
  • 20. new groovy.xml.MarkupBuilder().root() { ( 1 .. 3 ).each { child(id: &quot;child $it &quot; ) } } <root> <child id='child1' /> <child id='child2' /> <child id='child3' /> </root>
  • 21. 2004 2003 Range MarkupBuilder Closure GString
  • 22. 2004 2003 JSR-241 Range MarkupBuilder Closure GString
  • 23. 2004 2003 JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
  • 24. def text = '''Dear $person, So nice to meet you in <% print city %>. Sincerely, $signed''' def vars = [person: 'JUG' , city: 'Geneva' , signed: 'Hamlet' ] def engine = new groovy.text.SimpleTemplateEngine() engine.createTemplate(text).make(vars)
  • 25. def text = '''Dear $person, So nice to meet you in <% print city %>. Sincerely, $signed''' def vars = [person: 'JUG' , city: 'Geneva' , signed: 'Hamlet' ] def engine = new groovy.text.SimpleTemplateEngine() engine.createTemplate(text).make(vars) Dear JUG, So nice to meet you in Geneva. Sincerely, Hamlet
  • 26. 2005 2004 2003 JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
  • 27. 2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
  • 28. 2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
  • 29. 2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
  • 30. 2006 2005 2004 2003 XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString
  • 31. 2006 2005 2004 2003 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 0.1-0.3
  • 32. 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 0.1-0.3
  • 33. 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 0.1-0.3
  • 34. 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.1-0.3
  • 35. String. class .metaClass.default = { self -> self ?: '<unknown>' } '' .default()
  • 36. 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
  • 37. 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
  • 38. 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
  • 39. 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
  • 40. 2008 2007 2006 2005 2004 2003 Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
  • 41. 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0, 1.5 0.4-0.7 0.1-0.3
  • 42. @Grab( group= 'org.ccil.cowan.tagsoup' , module= 'tagsoup' , version= '1.2' ) import org.ccil.cowan.tagsoup.Parser def parser = new XmlParser(new Parser()) def url = 'http://twitter.com/hamletdrc' def html = parser.parse(url)
  • 43. 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 44. 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 45. 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 46. 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 47. 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 48. 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 49. 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 50. def (x, y) = [ 1 , 2 ] @Singleton, @Lazy, @Immutable, @Delegate, ... and more
  • 51. def (x, y) = [ 1 , 2 ] assert x == 1 assert y == 2
  • 52. 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 53. 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 54. 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 55. 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 56. 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 57. 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.3 0.9 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 58. 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 59. 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 60. 2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 61. 2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 62. Command Chains stand 7.minutes at busstop ride 10.stops on bus towards Basel
  • 63. JSON Builder import groovy.json.* def json = new JsonBuilder() json.person { name 'William Tell' status 'mythological' }
  • 64. AST Transformations @ToString, @EqualsAndHashCode @TupleConstructor, @Canonical @Log, @Field, @Package, ... and many more
  • 65. 2011 2010 2009 2008 2007 2006 2005 2004 2003 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 66. 2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 67. 2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0 0.17 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 68. 2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 2.0 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0 0.17 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3
  • 69. void method(String message) { if (message != null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } }
  • 70. @groovy.transform.TypeChecked void method(String message) { if (message != null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } }
  • 71. @groovy.transform.TypeChecked void method(String message) { if (message != null ) { log.info( &quot;Received input: ${ message.toUppercase() }&quot; ) } } 1 compilation error: [Static type checking] - Cannot find matching method java.lang.String#toUppercase() at line: 4, column: 43
  • 72. void method(Object message) { if (message instanceof String) { log.info( &quot;Received input: &quot; + message.toUpperCase() ); } }
  • 73. @groovy.transform.TypeChecked void method(Object message) { if (message instanceof String) { log.info( &quot;Received input: ${ message.toUpperCase() }&quot; ) } }
  • 74. def keys = [x: 1 ,y: 2 ,z: 3 ] *.key def values = [x: '1' ,y: '2' ,z: '3' ] *.value keys*.toUpperCase() values*.toUpperCase()
  • 75. Dimension d1 = [ 100 ] Dimension d2 = [ '100' , '200' ] Dimension d3 = new Dimension( width: 100 , height: 100 , depth: 100 )
  • 76. @groovy.transform.TypeChecked – Not a static compiler – No new syntax – No new semantics – Bytecode not changed – Targeted at Java developers
  • 77. def v = 1 v = v.toString() println v.toUpperCase()
  • 78. Flow Sensitive Typing def v = 1 v = v.toString() println v.toUpperCase()
  • 79. Flow Sensitive Typing def v = 1 v = v.toString() println v.toUpperCase() – Under discussion
  • 80. int fib(int i) { i < 2 ? 1 : fib(i - 2 ) + fib(i - 1 ) }
  • 81. @groovy.transform.CompileStatic int fib(int i) { i < 2 ? 1 : fib(i - 2 ) + fib(i - 1 ) }
  • 82. @groovy.transform.CompileStatic – Is a static compiler – No new syntax – Requires new semantics – Bytecode is changed
  • 83. @groovy.transform.CompileStatic – Is a static compiler – No new syntax – Requires new semantics – Bytecode is changed – InvokeDynamic?
  • 84. 2011 2010 2009 2008 2007 2006 2005 2004 2003 2012 2.0 @Grab Gant 0.3 Duration MockFor XmlSlurper JSR-241 SimpleTemplateEngine Range MarkupBuilder Closure GString 1.0 1.0 0.17 1.0 1.8 2.0 1.3 0.9 0.4, 0.5 1.6, 1.7 1.1, 1.2 1.0 1.0, 1.5 0.4-0.7 0.1-0.3