SlideShare a Scribd company logo
1 of 16
Getting Groovy with Eclipse:
Next generation tool support for
dynamic languages



                        Andrew Eisenberg
                          SpringSource
                           a division of VMWare



                                                                                                                             1
        Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
What is Groovy-Eclipse?

 • Eclipse tool support for the Groovy
   programming language
 • Recent release of Groovy-Eclipse 2.0.1
 • Two Goals:
    –   Deep integration with Java Development
        Tools (JDT)
    –   Editing support for Groovy's dynamicism



                                                                                                                                2
           Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
What is Groovy?

This is Java:
  public class Main {
   public static void main(String[] args) {
     System.out.println(“Hello, EclipseCon.”);
   }
  }




                                                                                                                                     3
                Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
What is Groovy?

This is Groovy:
 public class Main {
  public static void main(String[] args) {
    System.out.println(“Hello, EclipseCon.”);
  }
 }




                                                                                                                                   4
              Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
What is Groovy?

This is really Groovy:
  print “Hello, EclipseCon.”

• Groovy is a dynamically typed JVM language
• Builds upon the strengths of Java
     – syntax, libraries, runtime, ...
• Supports extra features
     – scripting, meta-programming, DSLs, …



                                                                                                                                    5
               Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Groovy-Eclipse


 • Deep integration with JDT
   – JDT compiler integration                                                                                        (Demo 1)

   – Debug support (Demo 2)
 • Editing support for Groovy's dynamicism
   – Groovy type inferencing (Demo 3)




                                                                                                                                6
           Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
What is deep integration with JDT?

•   Optimize Edit / Save / Compile / Test
     –   Same level of quality: Java <-> Groovy
•   Similar feature set where makes sense
•   Seamless Cross-referencing




                                                                                                                                 7
            Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
How to achieve Deep integration
  • Extended JDT compiler
      – Compiles both Java and Groovy
      – No need for stub generation
  • Compiler output not just class files
      – Abstract Syntax Tree (AST)
      – Java model




                                                                                                                                 8
            Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Demo 1


  • JDT – Groovy Compiler integration




                                                                                                                               9
          Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Debug support
 • Much like as in Java:
     – launching applications, tests
     – breakpoints
     – stepping
     – variables view
     – hot swap (new!)
     – display view (work in progress)
 • But, also:
     – launching scripts
     – closure support
     – filter uninteresting stack frames
                                                                                                                                 10
            Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Demo 2


  • Debugging – integration with JDT




                                                                                                                               11
          Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
IDE support for Groovy's
dynamicism

   Inferencing engine
   • guess type information statically
     def x
     x = (-1).abs()          x instanceof Integer

     x = “foo”               x instanceof String

     x.abs()                 MissingPropertyException!!!




                                                                                                                                  12
             Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Inferencing Engine is extensible


   • Custom DSLs can plug in (e.g., Grails)
   • Used for many parts of the UI:
       – Content Assist
       – Navigation
       – Search
       – Underlining unknown references




                                                                                                                                13
           Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Demo 3


  • Type inferencing provides IDE support for
    groovy dynamicism




                                                                                                                               14
          Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Groovy-Eclipse

•   Deep integration with JDT
     –   Editor
     –   Compiler
     –   Debugger
•   Support for Groovy's dynamicism
     –   Type inferencing




                                                                                                                                 15
            Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
Eclipse is now Groovy!



 Groovy-Eclipse:
 http://groovy.codehaus.org/Eclipse+Plu
   gin

 Andrew Eisenberg
 aeisenberg@springsource.com


                              Thank you!
          Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
                                                                                                                               16

More Related Content

Similar to Getting Groovy with Eclipse: Next generation tool support for dynamic languages

GEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
GEF SVG export in JWT: a newcomer’s rocky ride to EclipseGEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
GEF SVG export in JWT: a newcomer’s rocky ride to EclipseYoann Rodiere
 
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009Guillaume Laforge
 
Building domain-specific languages with Groovy
Building domain-specific languages with GroovyBuilding domain-specific languages with Groovy
Building domain-specific languages with GroovyYaroslav Yermilov
 
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
Rationalize Android Development with StAnD - Clement Escoffier, akquinetRationalize Android Development with StAnD - Clement Escoffier, akquinet
Rationalize Android Development with StAnD - Clement Escoffier, akquinetParis Open Source Summit
 
Spring Roo 1.0.0 Technical Deep Dive
Spring Roo 1.0.0 Technical Deep DiveSpring Roo 1.0.0 Technical Deep Dive
Spring Roo 1.0.0 Technical Deep DiveBen Alex
 
Poitou-Charentes JUG 2016 Eclipse Che: The Next-Gen Eclipse IDE
Poitou-Charentes JUG 2016 Eclipse Che: The Next-Gen Eclipse IDEPoitou-Charentes JUG 2016 Eclipse Che: The Next-Gen Eclipse IDE
Poitou-Charentes JUG 2016 Eclipse Che: The Next-Gen Eclipse IDEFlorent BENOIT
 
groovy and concurrency
groovy and concurrencygroovy and concurrency
groovy and concurrencyPaul King
 
Groovy introduction
Groovy introductionGroovy introduction
Groovy introductiongpottepalem
 
Aspects Every Where
Aspects Every WhereAspects Every Where
Aspects Every Whereguest9ff00
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finessemzgubin
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finessemzgubin
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java DevelopersPeter Ledbrook
 
Groovy Online 100
Groovy Online 100Groovy Online 100
Groovy Online 100reynolds
 
Javascript Apps at Build Artifacts
Javascript Apps at Build ArtifactsJavascript Apps at Build Artifacts
Javascript Apps at Build ArtifactsClay Smith
 
Run your Java code on Cloud Foundry
Run your Java code on Cloud FoundryRun your Java code on Cloud Foundry
Run your Java code on Cloud FoundryAndy Piper
 
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009Guillaume Laforge
 
Java programming basics
Java programming basicsJava programming basics
Java programming basicsPragya Rastogi
 
Dynamic Languages on the JVM
Dynamic Languages on the JVMDynamic Languages on the JVM
Dynamic Languages on the JVMelliando dias
 
Gr8conf Flying with Griffon
Gr8conf Flying with GriffonGr8conf Flying with Griffon
Gr8conf Flying with GriffonAndres Almiray
 
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!Iván López Martín
 

Similar to Getting Groovy with Eclipse: Next generation tool support for dynamic languages (20)

GEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
GEF SVG export in JWT: a newcomer’s rocky ride to EclipseGEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
GEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
 
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009
 
Building domain-specific languages with Groovy
Building domain-specific languages with GroovyBuilding domain-specific languages with Groovy
Building domain-specific languages with Groovy
 
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
Rationalize Android Development with StAnD - Clement Escoffier, akquinetRationalize Android Development with StAnD - Clement Escoffier, akquinet
Rationalize Android Development with StAnD - Clement Escoffier, akquinet
 
Spring Roo 1.0.0 Technical Deep Dive
Spring Roo 1.0.0 Technical Deep DiveSpring Roo 1.0.0 Technical Deep Dive
Spring Roo 1.0.0 Technical Deep Dive
 
Poitou-Charentes JUG 2016 Eclipse Che: The Next-Gen Eclipse IDE
Poitou-Charentes JUG 2016 Eclipse Che: The Next-Gen Eclipse IDEPoitou-Charentes JUG 2016 Eclipse Che: The Next-Gen Eclipse IDE
Poitou-Charentes JUG 2016 Eclipse Che: The Next-Gen Eclipse IDE
 
groovy and concurrency
groovy and concurrencygroovy and concurrency
groovy and concurrency
 
Groovy introduction
Groovy introductionGroovy introduction
Groovy introduction
 
Aspects Every Where
Aspects Every WhereAspects Every Where
Aspects Every Where
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finesse
 
Groovy Finesse
Groovy FinesseGroovy Finesse
Groovy Finesse
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
 
Groovy Online 100
Groovy Online 100Groovy Online 100
Groovy Online 100
 
Javascript Apps at Build Artifacts
Javascript Apps at Build ArtifactsJavascript Apps at Build Artifacts
Javascript Apps at Build Artifacts
 
Run your Java code on Cloud Foundry
Run your Java code on Cloud FoundryRun your Java code on Cloud Foundry
Run your Java code on Cloud Foundry
 
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
Practical Groovy Domain-Specific Languages - SpringOne Europe 2009
 
Java programming basics
Java programming basicsJava programming basics
Java programming basics
 
Dynamic Languages on the JVM
Dynamic Languages on the JVMDynamic Languages on the JVM
Dynamic Languages on the JVM
 
Gr8conf Flying with Griffon
Gr8conf Flying with GriffonGr8conf Flying with Griffon
Gr8conf Flying with Griffon
 
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
Gr8Conf US 2017 - From Java to Groovy: Adventure Time!
 

Getting Groovy with Eclipse: Next generation tool support for dynamic languages

  • 1. Getting Groovy with Eclipse: Next generation tool support for dynamic languages Andrew Eisenberg SpringSource a division of VMWare 1 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 2. What is Groovy-Eclipse? • Eclipse tool support for the Groovy programming language • Recent release of Groovy-Eclipse 2.0.1 • Two Goals: – Deep integration with Java Development Tools (JDT) – Editing support for Groovy's dynamicism 2 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 3. What is Groovy? This is Java: public class Main { public static void main(String[] args) { System.out.println(“Hello, EclipseCon.”); } } 3 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 4. What is Groovy? This is Groovy: public class Main { public static void main(String[] args) { System.out.println(“Hello, EclipseCon.”); } } 4 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 5. What is Groovy? This is really Groovy: print “Hello, EclipseCon.” • Groovy is a dynamically typed JVM language • Builds upon the strengths of Java – syntax, libraries, runtime, ... • Supports extra features – scripting, meta-programming, DSLs, … 5 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 6. Groovy-Eclipse • Deep integration with JDT – JDT compiler integration (Demo 1) – Debug support (Demo 2) • Editing support for Groovy's dynamicism – Groovy type inferencing (Demo 3) 6 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 7. What is deep integration with JDT? • Optimize Edit / Save / Compile / Test – Same level of quality: Java <-> Groovy • Similar feature set where makes sense • Seamless Cross-referencing 7 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 8. How to achieve Deep integration • Extended JDT compiler – Compiles both Java and Groovy – No need for stub generation • Compiler output not just class files – Abstract Syntax Tree (AST) – Java model 8 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 9. Demo 1 • JDT – Groovy Compiler integration 9 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 10. Debug support • Much like as in Java: – launching applications, tests – breakpoints – stepping – variables view – hot swap (new!) – display view (work in progress) • But, also: – launching scripts – closure support – filter uninteresting stack frames 10 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 11. Demo 2 • Debugging – integration with JDT 11 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 12. IDE support for Groovy's dynamicism Inferencing engine • guess type information statically def x x = (-1).abs() x instanceof Integer x = “foo” x instanceof String x.abs() MissingPropertyException!!! 12 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 13. Inferencing Engine is extensible • Custom DSLs can plug in (e.g., Grails) • Used for many parts of the UI: – Content Assist – Navigation – Search – Underlining unknown references 13 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 14. Demo 3 • Type inferencing provides IDE support for groovy dynamicism 14 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 15. Groovy-Eclipse • Deep integration with JDT – Editor – Compiler – Debugger • Support for Groovy's dynamicism – Type inferencing 15 Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
  • 16. Eclipse is now Groovy! Groovy-Eclipse: http://groovy.codehaus.org/Eclipse+Plu gin Andrew Eisenberg aeisenberg@springsource.com Thank you! Copyright 2010 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 16