SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Scala Support in Eclipse
Monkey-patching the JDT for fun and profit?




                   Miles Sabin, Chuusai Ltd.
                    http://www.chuusai.com/

               http://uk.linkedin.com/in/milessabin
                      http://twitter.com/milessabin
Outline
●
    JVM Languages Need Java-level Tools
●
    The Scala IDE for Eclipse
●
    History
●
    How to Move Forward?
●
    AspectJ and Equinox Aspects
●
    Who is Using This Approach?
●
    Retrospect and Prospects
The Need for Java-level Tools
●
    Many of the new JVM Languages offer
    significant productivity gains over Java, but
    ...
●
    Mainstream adoption requires
    improvements across the entire toolchain
    ●
        A x2 productivity gain at the language level is
        irrelevant if there's a /2 loss at the tool level
●
    Especially so for IDEs
The Need for Java-level Tools
●
    A subset of JVM languages are also “Java-
    compatible”
    ●
        Close source and binary mapping to Java
        –   Scala, Groovy, JavaFX, AspectJ
●
    This holds out hope that many Java tools
    will Just Work, or work with minor
    adaptation
    ●
        eg. Java annotation driven tools generally work
        as expected with Scala
●
    Additional promise of gradual migration
The Need for Java-level Tools
●
    Does this carry over to IDEs?
    ●
        On the positive side there is much common
        infrastructure across languages
        –   This is reflected in IDE extension APIs
    ●
        Buts it's not enough to provide orthogonal
        support
        –   Gradual migration demands that major features of
            the Java tooling be aware of new language artefacts
    ●
        The big value features are the ones which are
        informed by language semantics
        –   Typically private to IDEs language tooling
The Scala IDE for Eclipse
●
    The Scala tooling for Eclipse is an attempt
    to answer the preceeding question in the
    positive
●
    The aim of the project is to achieve tooling
    which approaches that of the Eclipse JDT
    but with vastly less effort
History 1
●
    Started very early on in Scala's timeline
    (early 2005)
●
    Very simple IDE plugin
●
    Little functionality beyond basic syntax
    highlighting and build invocation
●
    Written in Java
●
    There was a least one other similar offering
    at the time: Scaliptor
History 2
●
    Announced December 2005, first release
    February 2006 (2.1.0)
●
    Rewritten in Scala
●
    Some semantic features acquired (eg.
    limited auto-completion)
●
    Even at this early stage requests for the
    ability to mix Java and Scala and JDT
    interop were coming in
History 3
●
    Announced June 2007, first release
    February 2008
●
    Attempted much deeper integration with
    the Scala compiler,
    ●
        Interactive error reporting
    ●
        Semantic highlighting
    ●
        Incremental compilation
    ●
        Dependency management
●
    Many hooks added to scalac
History 4
●
    Start of my involvement (May 2008)
●
    Prompted by very generous sponsorship by
    EDF Trading
●
    Primary goals
    ●
        Ease Java/Scala migation
        –   Mixed Scala/Java compilation in scalac
        –   Mixed Scala/Java projects in Eclipse
    ●
        Improved Eclipse stability and release process
History 4
●
    First commit to trunk in July 2008
●
    Results of the work first visible in
    2.7.2.RC1 in August 2008
●
    Final 2.7.2 release in November
●
    Goals somewhat met,
    ●
        Mixed Scala/Java enabled in scalac and Eclipse
    ●
        Release process dramatically improved
    ●
        However JDT integration limited and stability
        issues remain
How to Move Forward?
●
    Various non-options
    ●
        Fork Eclipse?
        –   It's open source, but too big and too rapidly
            changing. Maintaining a a patch against it would be
            a huge effort
        –   We want users to be able to install our tools into
            their existing eclipse environments
        –   If several JVM languages fork the JDT which one
            wins?
How to Move Forward?
●
    Various non-options
    ●
        Lobby for extensions to the JDT?
        –   Andrew Eisenberg's patch has been languishing in
            Eclipse Bugzilla for 3+ years
        –   JDT team understandably reluctant to see private
            implementation exposed as public API
        –   Alternative JVM languages still a minority interest,
            so little business motivation to make the change
●
    Fortunately AOP provides us with a Plan B
AspectJ and Equinox Aspects
●
    AspectJ is a well-know AOP extension to
    Java
    ●
        Allows behaviour of existing Java classes to be
        modified
        –   Pointcuts specify slices through execution flow
        –   “Advice” is code which is executed before, after or
            completely replacing original specified by pointcuts
AspectJ and Equinox Aspects
●
    Opinions are divided on AOP
    ●
        There are some compelling use cases
        –   Logging, error handling
        –   These cases are typically passive and observational
    ●
        Aspects can also actively modify behaviour, but
        –   It's a gross violation of encapsulation
        –   It can obscure the flow of execution
    ●
        Violating encapsulation is a bad thing ...
        –   ... except when that's exactly what you need to do!
        –   In which case AOP is an industrial strength tool
AspectJ and Equinox Aspects
●
    A collection of aspects is effectively a patch
●
    AspectJ was used to retrofit the desired
    extensibility features to the JDT and
    expose them via public API
●
    The key modification:
    ●
        The JDT's CompilationUnit is the entry point to
        it's internal model, but it assumes Java source
    ●
        An aspect can turn its constructor into a
        factory method
AspectJ and Equinox Aspects
●
    One more piece of the puzzle
    ●
        How to get these aspects applied to an Eclipse
        Installation?
    ●
        We can't require a custom Eclipse build or
        we're back to square one
●
    Enter Equinox Aspects
    ●
        Work of Martin Lippert
    ●
        An OSGi framework extension supporting the
        weaving of aspects into binaries at load time
Who's Using This Approach?
●
    Unsurprisingly the AspectJ tooling for
    Eclipse (AJDT) was the first
●
    The Scala tooling followed soon after
●
    JavaFX is the most recent addition
●
    The Groovy Eclipse tooling is taking the
    patch approach
●
    There has been significant collaboration
    across these projects
Retrospect and Prospects
●
    The results are a qualified success
●
    But the patch was premature,
    ●
        Experience has shown that although the initial
        round of JDT modifications removed the
        biggest hurdles,
        –   There are still many scenarios where Java source
            assumptions are made
        –   The retrofitted public API maps JVM language
            constructs to the JDT's model in a way which best
            fits Java extensions rather than new languages
Retrospect and Prospects
●
    More cross-language collaboration needed
    ●
        We need to draw on the experiences of the
        various groups and factor out common API and
        functionality
    ●
        We need to encourage other languages to
        follow, esp. languages not so close to Java
●
    We need to work with the JDT team to roll
    these changes into Eclipse
Demo
Find Out More
●
    Scala's home at EPFL
    http://www.scala-lang.org
    ●
        See also the scala-user and scala-tools mailing
        lists
●
    Scala IDE installation
    http://www.scala-lang.org/node/94
    ●
        Update site for 2.8.0 Beta 1
    http://www.scala-lang.org/
            scala-eclipse-plugin-beta-preview
Scala Support in Eclipse
Monkey-patching the JDT for fun and profit?




                   Miles Sabin, Chuusai Ltd.
                    http://www.chuusai.com/

               http://uk.linkedin.com/in/milessabin
                      http://twitter.com/milessabin

Más contenido relacionado

La actualidad más candente

Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System IntroductionDan Stine
 
It's a JDK- Jungle Out There – JDK 15 and OpenJDK 15
It's a JDK- Jungle Out There – JDK 15 and OpenJDK 15It's a JDK- Jungle Out There – JDK 15 and OpenJDK 15
It's a JDK- Jungle Out There – JDK 15 and OpenJDK 15Wolfgang Weigend
 
itft-Java evolution
itft-Java evolutionitft-Java evolution
itft-Java evolutionAtul Sehdev
 
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』Ryo RKTM
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Martin Toshev
 
I18N refactoring support and the TapiJI online translator
I18N refactoring support and the TapiJI online translatorI18N refactoring support and the TapiJI online translator
I18N refactoring support and the TapiJI online translatormreiterer
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of JavaFu Cheng
 
Java 9 Modularity and Project Jigsaw
Java 9 Modularity and Project JigsawJava 9 Modularity and Project Jigsaw
Java 9 Modularity and Project JigsawComsysto Reply GmbH
 
Introduction to Java
Introduction to Java Introduction to Java
Introduction to Java Hitesh-Java
 
Android Mobile Continuous Integration. UA Mobile 2016.
Android Mobile Continuous Integration. UA Mobile 2016.Android Mobile Continuous Integration. UA Mobile 2016.
Android Mobile Continuous Integration. UA Mobile 2016.UA Mobile
 
Programmatic Load of the Oracle Clinical Global Library
Programmatic Load of the Oracle Clinical Global LibraryProgrammatic Load of the Oracle Clinical Global Library
Programmatic Load of the Oracle Clinical Global LibraryPerficient
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Mihail Stoynov
 
How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17Johan Janssen
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Nuxeo
 

La actualidad más candente (20)

Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System Introduction
 
It's a JDK- Jungle Out There – JDK 15 and OpenJDK 15
It's a JDK- Jungle Out There – JDK 15 and OpenJDK 15It's a JDK- Jungle Out There – JDK 15 and OpenJDK 15
It's a JDK- Jungle Out There – JDK 15 and OpenJDK 15
 
History of java
History of javaHistory of java
History of java
 
itft-Java evolution
itft-Java evolutionitft-Java evolution
itft-Java evolution
 
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
 
I18N refactoring support and the TapiJI online translator
I18N refactoring support and the TapiJI online translatorI18N refactoring support and the TapiJI online translator
I18N refactoring support and the TapiJI online translator
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Java modules using project jigsaw@jdk 9
Java modules using project jigsaw@jdk 9Java modules using project jigsaw@jdk 9
Java modules using project jigsaw@jdk 9
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Java 9 Modularity and Project Jigsaw
Java 9 Modularity and Project JigsawJava 9 Modularity and Project Jigsaw
Java 9 Modularity and Project Jigsaw
 
Introduction to Java
Introduction to Java Introduction to Java
Introduction to Java
 
Android Mobile Continuous Integration. UA Mobile 2016.
Android Mobile Continuous Integration. UA Mobile 2016.Android Mobile Continuous Integration. UA Mobile 2016.
Android Mobile Continuous Integration. UA Mobile 2016.
 
Java Desktop 2019
Java Desktop 2019Java Desktop 2019
Java Desktop 2019
 
Programmatic Load of the Oracle Clinical Global Library
Programmatic Load of the Oracle Clinical Global LibraryProgrammatic Load of the Oracle Clinical Global Library
Programmatic Load of the Oracle Clinical Global Library
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
Java modules
Java modulesJava modules
Java modules
 
History of Java 2/2
History of Java 2/2History of Java 2/2
History of Java 2/2
 
How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17How and why to upgrade to java 16 or 17
How and why to upgrade to java 16 or 17
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
 

Similar a Eclipsecon 2010 - Scala Support in Eclipse

Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Miles Sabin
 
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!Voxxed Athens
 
Java Course 15: Ant, Scripting, Spring, Hibernate
Java Course 15: Ant, Scripting, Spring, HibernateJava Course 15: Ant, Scripting, Spring, Hibernate
Java Course 15: Ant, Scripting, Spring, HibernateAnton Keks
 
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"GlobalLogic Ukraine
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastUzairSaeed18
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware Tanzu
 
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...Raffi Khatchadourian
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Martijn Verburg
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with GradleWei Chen
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaLevent YILDIZ
 
Introducing the JAQ (Java, Angular, Sql/NoSQL) Stack
Introducing the JAQ (Java, Angular, Sql/NoSQL) Stack Introducing the JAQ (Java, Angular, Sql/NoSQL) Stack
Introducing the JAQ (Java, Angular, Sql/NoSQL) Stack Suren Konathala
 
Java Introduction
Java IntroductionJava Introduction
Java Introductionjaveed_mhd
 
Java Basics
Java BasicsJava Basics
Java BasicsKhan625
 
Java Basics in Mule
Java Basics in MuleJava Basics in Mule
Java Basics in MuleRajkattamuri
 
Java Course 1: Introduction
Java Course 1: IntroductionJava Course 1: Introduction
Java Course 1: IntroductionAnton Keks
 

Similar a Eclipsecon 2010 - Scala Support in Eclipse (20)

Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...
 
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
 
Java Course 15: Ant, Scripting, Spring, Hibernate
Java Course 15: Ant, Scripting, Spring, HibernateJava Course 15: Ant, Scripting, Spring, Hibernate
Java Course 15: Ant, Scripting, Spring, Hibernate
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
 
Java. converted (2)
Java. converted (2)Java. converted (2)
Java. converted (2)
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 Fast
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
Porting the NetBeans Java 8 Enhanced For Loop Lambda Expression Refactoring t...
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Introducing the JAQ (Java, Angular, Sql/NoSQL) Stack
Introducing the JAQ (Java, Angular, Sql/NoSQL) Stack Introducing the JAQ (Java, Angular, Sql/NoSQL) Stack
Introducing the JAQ (Java, Angular, Sql/NoSQL) Stack
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Java Basics in Mule
Java Basics in MuleJava Basics in Mule
Java Basics in Mule
 
Java in Mule
Java in MuleJava in Mule
Java in Mule
 
Java Course 1: Introduction
Java Course 1: IntroductionJava Course 1: Introduction
Java Course 1: Introduction
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Eclipsecon 2010 - Scala Support in Eclipse

  • 1. Scala Support in Eclipse Monkey-patching the JDT for fun and profit? Miles Sabin, Chuusai Ltd. http://www.chuusai.com/ http://uk.linkedin.com/in/milessabin http://twitter.com/milessabin
  • 2. Outline ● JVM Languages Need Java-level Tools ● The Scala IDE for Eclipse ● History ● How to Move Forward? ● AspectJ and Equinox Aspects ● Who is Using This Approach? ● Retrospect and Prospects
  • 3. The Need for Java-level Tools ● Many of the new JVM Languages offer significant productivity gains over Java, but ... ● Mainstream adoption requires improvements across the entire toolchain ● A x2 productivity gain at the language level is irrelevant if there's a /2 loss at the tool level ● Especially so for IDEs
  • 4. The Need for Java-level Tools ● A subset of JVM languages are also “Java- compatible” ● Close source and binary mapping to Java – Scala, Groovy, JavaFX, AspectJ ● This holds out hope that many Java tools will Just Work, or work with minor adaptation ● eg. Java annotation driven tools generally work as expected with Scala ● Additional promise of gradual migration
  • 5. The Need for Java-level Tools ● Does this carry over to IDEs? ● On the positive side there is much common infrastructure across languages – This is reflected in IDE extension APIs ● Buts it's not enough to provide orthogonal support – Gradual migration demands that major features of the Java tooling be aware of new language artefacts ● The big value features are the ones which are informed by language semantics – Typically private to IDEs language tooling
  • 6. The Scala IDE for Eclipse ● The Scala tooling for Eclipse is an attempt to answer the preceeding question in the positive ● The aim of the project is to achieve tooling which approaches that of the Eclipse JDT but with vastly less effort
  • 7. History 1 ● Started very early on in Scala's timeline (early 2005) ● Very simple IDE plugin ● Little functionality beyond basic syntax highlighting and build invocation ● Written in Java ● There was a least one other similar offering at the time: Scaliptor
  • 8. History 2 ● Announced December 2005, first release February 2006 (2.1.0) ● Rewritten in Scala ● Some semantic features acquired (eg. limited auto-completion) ● Even at this early stage requests for the ability to mix Java and Scala and JDT interop were coming in
  • 9. History 3 ● Announced June 2007, first release February 2008 ● Attempted much deeper integration with the Scala compiler, ● Interactive error reporting ● Semantic highlighting ● Incremental compilation ● Dependency management ● Many hooks added to scalac
  • 10. History 4 ● Start of my involvement (May 2008) ● Prompted by very generous sponsorship by EDF Trading ● Primary goals ● Ease Java/Scala migation – Mixed Scala/Java compilation in scalac – Mixed Scala/Java projects in Eclipse ● Improved Eclipse stability and release process
  • 11. History 4 ● First commit to trunk in July 2008 ● Results of the work first visible in 2.7.2.RC1 in August 2008 ● Final 2.7.2 release in November ● Goals somewhat met, ● Mixed Scala/Java enabled in scalac and Eclipse ● Release process dramatically improved ● However JDT integration limited and stability issues remain
  • 12. How to Move Forward? ● Various non-options ● Fork Eclipse? – It's open source, but too big and too rapidly changing. Maintaining a a patch against it would be a huge effort – We want users to be able to install our tools into their existing eclipse environments – If several JVM languages fork the JDT which one wins?
  • 13. How to Move Forward? ● Various non-options ● Lobby for extensions to the JDT? – Andrew Eisenberg's patch has been languishing in Eclipse Bugzilla for 3+ years – JDT team understandably reluctant to see private implementation exposed as public API – Alternative JVM languages still a minority interest, so little business motivation to make the change ● Fortunately AOP provides us with a Plan B
  • 14. AspectJ and Equinox Aspects ● AspectJ is a well-know AOP extension to Java ● Allows behaviour of existing Java classes to be modified – Pointcuts specify slices through execution flow – “Advice” is code which is executed before, after or completely replacing original specified by pointcuts
  • 15. AspectJ and Equinox Aspects ● Opinions are divided on AOP ● There are some compelling use cases – Logging, error handling – These cases are typically passive and observational ● Aspects can also actively modify behaviour, but – It's a gross violation of encapsulation – It can obscure the flow of execution ● Violating encapsulation is a bad thing ... – ... except when that's exactly what you need to do! – In which case AOP is an industrial strength tool
  • 16. AspectJ and Equinox Aspects ● A collection of aspects is effectively a patch ● AspectJ was used to retrofit the desired extensibility features to the JDT and expose them via public API ● The key modification: ● The JDT's CompilationUnit is the entry point to it's internal model, but it assumes Java source ● An aspect can turn its constructor into a factory method
  • 17. AspectJ and Equinox Aspects ● One more piece of the puzzle ● How to get these aspects applied to an Eclipse Installation? ● We can't require a custom Eclipse build or we're back to square one ● Enter Equinox Aspects ● Work of Martin Lippert ● An OSGi framework extension supporting the weaving of aspects into binaries at load time
  • 18. Who's Using This Approach? ● Unsurprisingly the AspectJ tooling for Eclipse (AJDT) was the first ● The Scala tooling followed soon after ● JavaFX is the most recent addition ● The Groovy Eclipse tooling is taking the patch approach ● There has been significant collaboration across these projects
  • 19. Retrospect and Prospects ● The results are a qualified success ● But the patch was premature, ● Experience has shown that although the initial round of JDT modifications removed the biggest hurdles, – There are still many scenarios where Java source assumptions are made – The retrofitted public API maps JVM language constructs to the JDT's model in a way which best fits Java extensions rather than new languages
  • 20. Retrospect and Prospects ● More cross-language collaboration needed ● We need to draw on the experiences of the various groups and factor out common API and functionality ● We need to encourage other languages to follow, esp. languages not so close to Java ● We need to work with the JDT team to roll these changes into Eclipse
  • 21. Demo
  • 22. Find Out More ● Scala's home at EPFL http://www.scala-lang.org ● See also the scala-user and scala-tools mailing lists ● Scala IDE installation http://www.scala-lang.org/node/94 ● Update site for 2.8.0 Beta 1 http://www.scala-lang.org/ scala-eclipse-plugin-beta-preview
  • 23. Scala Support in Eclipse Monkey-patching the JDT for fun and profit? Miles Sabin, Chuusai Ltd. http://www.chuusai.com/ http://uk.linkedin.com/in/milessabin http://twitter.com/milessabin