SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Andres Almiray | Canoo Engineering AG


Polyglot Programming
in the JVM	

 Or how I Learned to Stop Worrying and Love
                   the JVM
About the speaker	

    Java developer since the beginning
    True believer in open source
    Groovy committer since 2007
    Project lead of the Griffon framework
    Currently working for
Some facts about Java	

    Previous name was Oak. Bonus points for
     knowing its real name before that
    Made its public appearance in 1995
    C/C++ were king at the time
    Networking, multithreading were baked
     right into the language
    Developers came for the applets and stayed
     for the components (JEE and all that jazz)
However...	

    It is already in its teens
    It has not seen a major feature upgrade
     since JDK5 was released back in 2004 ->
     generics (and we do know how that turned
     out to be, don’t we?)
    JDK7 has been delayed again (late 2010).
     Some features might or might not make
     the cut (the closures debacle)
More so...	

    It is rather verbose when compared to how
     other languages do the same task
    Its threading features are no longer
     enough. Concurrent programs desperately
     cry for immutability these days
Truth or myth?	

    Is Java oftenly referred as overengineered?
    Can you build a Java based web application
     (for arguments sake a basic Twitter clone)
     in less than a day‘s work WITHOUT an IDE?
    Did James Gosling ever say he was
     threatened with bodily harm should
     operator overloading find its way into Java?
The JVM is a great place to
work however Java makes it
   painful sometimes...
What can we do about it?!
Disclaimer
                       	

(this is not a bash-the-other-languages talk)
Reduced Verbosity
Standard Beans	

public class Bean {
  private String name;

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }
}
Standard Beans	

public class Bean {
  private String name;

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }
}
Standard Beans	



class Bean {
  String name
}
Standard Beans	



class Bean(var name:String)


class Bean {
  @scala.reflect.BeanProperty
  var name: String
}
Standard Beans	



(defstruct Bean :name)
Closures (or Functions)	

public interface Adder {
    int add(int a, int b);
}

public class MyAdder implements Adder {
  public int add(int a, int b) {
    return a + b;
    }
}
Closures (or Functions)	



def adder = { a , b -> a + b }
Closures (or Functions)	



def adder(a: Int, b: Int) = a + b
Closures (or Functions)	



(defn adder [a b] (+ a b))
Enhanced switch	

char letterGrade(int grade) {
  if(grade >= 0 && grade <= 60) return ‘F‘;
  if(grade > 60 && grade <= 70) return ‘D‘;
  if(grade > 70 && grade <= 80) return ‘C‘;
  if(grade > 80 && grade <= 90) return ‘B‘;
  if(grade > 90 && grade <= 100) return ‘A‘;
  throw new IllegalArgumentException(‘invalid
grade ‘+grade);
}
Enhanced Switch	

def letterGrade(grade) {
  switch(grade) {
     case 90..100: return ‘A‘
     case 80..<90: return ‘B‘
     case 70..<80: return ‘C‘
     case 60..<70: return ‘D‘
     case 0..<60: return ‘F‘
     case ~"[ABCDFabcdf]":
          return grade.toUpperCase()
  }
  throw new IllegalArgumentException
(‘invalid grade ‘+grade)
}
Enhanced Switch	



val VALID_GRADES = Set("A", "B", "C", "D", "F")
def letterGrade(value: Any):String = value match
{
  case x:Int if (90 to 100).contains(x) => "A"
  case x:Int if (80 to 90).contains(x) => "B"
  case x:Int if (70 to 80).contains(x) => "C"
  case x:Int if (60 to 70).contains(x) => "D"
  case x:Int if (0 to 60).contains(x) => "F"
  case x:String if VALID_GRADES(x.toUpperCase) =>
x.toUpperCase()
}
Enhanced Switch	


(defn letter-grade [grade]
  (cond
   (in grade 90 100) "A"
   (in grade 80 90) "B"
   (in grade 70 80) "C"
   (in grade 60 70) "D"
   (in grade 0 60) "F"
   (re-find #"[ABCDFabcdf]" grade)
(.toUpperCase grade)))
Java Interoperability
All of these are true	

    Java can call Groovy, Scala and Clojure
     classes as if they were Java classes
    Groovy, Scala and Clojure can call Java code
     without breaking a sweat


    In other words, interoperability with Java is
     a given. No need for complicated bridges
     between languages (i.e. JSR 223)
Ok, so...	

What else can these
  languages do?
All of them 	

    Native syntax for collection classes
    Everything is an object
    Closures!
    Regular expressions as first class citizens
    Operator overloading
Groovy	

    Metaprogramming (HOT!) both at buildtime
     and runtime
    Builders
    Healthy ecosystem: Grails, Griffon, Gant,
     Gradle, Spock, Gaelyk, Gpars, CodeNarc,
     etc...


    Not an exhaustive list of features!
Scala	

    Richer type system
    Type inference
    Pattern matching (case classes)
    Actor model




    Not an exhaustive list of features!
Clojure	

    Data as code and viceversa
    Immutable structures
    STM




    Not an exhaustive list of features!
Demo
Other places where you‘ll
find Polyglot Programming
Web app development	

    XML
    SQL
    JavaScript
    JSON
    CSS
    Flash/Flex/ActionScript
Next-Gen datastores (NoSQL)	

    FleetDB -> Clojure


    FlockDB -> Scala


    CouchDB, Riak -> Erlang



    btw watch out for Polyglot Persistence ;-)
Build systems	

    Gradle, Gant -> Groovy


    Rake -> Ruby/JRuby


    Maven3 -> XML, Groovy, Ruby
Parting thoughts	

    Java (the language) may have reached its
     maturity feature wise
    Other JVM languages evolved faster
    Polyglot Programming is not a new concept
    Download and play with each of the
     demoed languages, maybe one of them
     strikes your fancy
Resources

Más contenido relacionado

La actualidad más candente

Kotlin for Android Developers - 1
Kotlin for Android Developers - 1Kotlin for Android Developers - 1
Kotlin for Android Developers - 1Mohamed Nabil, MSc.
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To GrailsEric Berry
 
Discovering functional treasure in idiomatic Groovy
Discovering functional treasure in idiomatic GroovyDiscovering functional treasure in idiomatic Groovy
Discovering functional treasure in idiomatic GroovyNaresha K
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin PresentationAndrzej Sitek
 
Kotlin, smarter development for the jvm
Kotlin, smarter development for the jvmKotlin, smarter development for the jvm
Kotlin, smarter development for the jvmArnaud Giuliani
 
Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Mohamed Nabil, MSc.
 
Scala - the good, the bad and the very ugly
Scala - the good, the bad and the very uglyScala - the good, the bad and the very ugly
Scala - the good, the bad and the very uglyBozhidar Bozhanov
 
Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I Atif AbbAsi
 
Kotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language designKotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language designAndrey Breslav
 
A quick and fast intro to Kotlin
A quick and fast intro to Kotlin A quick and fast intro to Kotlin
A quick and fast intro to Kotlin XPeppers
 
Introduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platformIntroduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platformEastBanc Tachnologies
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmerselliando dias
 
10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About ScalaMeir Maor
 
Java Intro
Java IntroJava Intro
Java Introbackdoor
 

La actualidad más candente (20)

Kotlin for Android Developers - 1
Kotlin for Android Developers - 1Kotlin for Android Developers - 1
Kotlin for Android Developers - 1
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
 
Discovering functional treasure in idiomatic Groovy
Discovering functional treasure in idiomatic GroovyDiscovering functional treasure in idiomatic Groovy
Discovering functional treasure in idiomatic Groovy
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin Presentation
 
Android antipatterns
Android antipatternsAndroid antipatterns
Android antipatterns
 
Kotlin, smarter development for the jvm
Kotlin, smarter development for the jvmKotlin, smarter development for the jvm
Kotlin, smarter development for the jvm
 
Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Kotlin for Android Developers - 3
Kotlin for Android Developers - 3
 
Scala - the good, the bad and the very ugly
Scala - the good, the bad and the very uglyScala - the good, the bad and the very ugly
Scala - the good, the bad and the very ugly
 
Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I Introduction to Koltin for Android Part I
Introduction to Koltin for Android Part I
 
Kotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language designKotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language design
 
Kotlin L → ∞
Kotlin L → ∞Kotlin L → ∞
Kotlin L → ∞
 
Java for the Beginners
Java for the BeginnersJava for the Beginners
Java for the Beginners
 
A quick and fast intro to Kotlin
A quick and fast intro to Kotlin A quick and fast intro to Kotlin
A quick and fast intro to Kotlin
 
DSLs in JavaScript
DSLs in JavaScriptDSLs in JavaScript
DSLs in JavaScript
 
Introduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platformIntroduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platform
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
 
Kotlin
KotlinKotlin
Kotlin
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmers
 
10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About Scala
 
Java Intro
Java IntroJava Intro
Java Intro
 

Destacado

Linda Kelleher's Presentation
Linda Kelleher's PresentationLinda Kelleher's Presentation
Linda Kelleher's Presentationjoanna.deming
 
Believe It
Believe ItBelieve It
Believe Itnatureab
 
Jfokus - Rocket Propelled Java
Jfokus - Rocket Propelled JavaJfokus - Rocket Propelled Java
Jfokus - Rocket Propelled JavaAndres Almiray
 
香港六合彩
香港六合彩香港六合彩
香港六合彩zzneyi
 
Awards presentation 10 28-2010 draft
Awards presentation 10 28-2010 draftAwards presentation 10 28-2010 draft
Awards presentation 10 28-2010 draftjoanna.deming
 
The Life of Pie (slides only)
The Life of Pie (slides only)The Life of Pie (slides only)
The Life of Pie (slides only)Miko Coffey
 
香港六合彩
香港六合彩香港六合彩
香港六合彩zzneyi
 

Destacado (8)

Linda Kelleher's Presentation
Linda Kelleher's PresentationLinda Kelleher's Presentation
Linda Kelleher's Presentation
 
Believe It
Believe ItBelieve It
Believe It
 
Jfokus - Rocket Propelled Java
Jfokus - Rocket Propelled JavaJfokus - Rocket Propelled Java
Jfokus - Rocket Propelled Java
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
Awards presentation 10 28-2010 draft
Awards presentation 10 28-2010 draftAwards presentation 10 28-2010 draft
Awards presentation 10 28-2010 draft
 
The Life of Pie (slides only)
The Life of Pie (slides only)The Life of Pie (slides only)
The Life of Pie (slides only)
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
Catch The Riptide
Catch The RiptideCatch The Riptide
Catch The Riptide
 

Similar a Polyglot Programming @ Jax.de 2010

Polyglot Programming in the JVM
Polyglot Programming in the JVMPolyglot Programming in the JVM
Polyglot Programming in the JVMAndres Almiray
 
Polyglot Programming in the JVM - Øredev
Polyglot Programming in the JVM - ØredevPolyglot Programming in the JVM - Øredev
Polyglot Programming in the JVM - ØredevAndres Almiray
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Guillaume Laforge
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Wsloffenauer
 
Introduction to Oracle Groovy
Introduction to Oracle GroovyIntroduction to Oracle Groovy
Introduction to Oracle GroovyDeepak Bhagat
 
Groovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsGroovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsIndicThreads
 
GTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyGTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyAndres Almiray
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyJames Williams
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingAndres Almiray
 
Intro to scala
Intro to scalaIntro to scala
Intro to scalaJoe Zulli
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingGarth Gilmour
 
Evolving The Java Language
Evolving The Java LanguageEvolving The Java Language
Evolving The Java LanguageQConLondon2008
 
Polyglot Programming @ CONFESS
Polyglot Programming @ CONFESSPolyglot Programming @ CONFESS
Polyglot Programming @ CONFESSAndres Almiray
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Jonathan Felch
 
Kotlin Language Features - A Java comparison
Kotlin Language Features - A Java comparisonKotlin Language Features - A Java comparison
Kotlin Language Features - A Java comparisonEd Austin
 

Similar a Polyglot Programming @ Jax.de 2010 (20)

Polyglot Programming in the JVM
Polyglot Programming in the JVMPolyglot Programming in the JVM
Polyglot Programming in the JVM
 
Polyglot Programming in the JVM - Øredev
Polyglot Programming in the JVM - ØredevPolyglot Programming in the JVM - Øredev
Polyglot Programming in the JVM - Øredev
 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
Svcc Groovy Testing
Svcc Groovy TestingSvcc Groovy Testing
Svcc Groovy Testing
 
Introduction to Oracle Groovy
Introduction to Oracle GroovyIntroduction to Oracle Groovy
Introduction to Oracle Groovy
 
Groovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsGroovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applications
 
GTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyGTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with Groovy
 
Jet presentation
Jet presentationJet presentation
Jet presentation
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with Groovy
 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 Groovytesting
 
Intro to scala
Intro to scalaIntro to scala
Intro to scala
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional Programming
 
Evolving The Java Language
Evolving The Java LanguageEvolving The Java Language
Evolving The Java Language
 
Polyglot Programming @ CONFESS
Polyglot Programming @ CONFESSPolyglot Programming @ CONFESS
Polyglot Programming @ CONFESS
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Kotlin Language Features - A Java comparison
Kotlin Language Features - A Java comparisonKotlin Language Features - A Java comparison
Kotlin Language Features - A Java comparison
 

Más de Andres Almiray

Creando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoCreando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoAndres Almiray
 
Liberando a produccion con confianza
Liberando a produccion con confianzaLiberando a produccion con confianza
Liberando a produccion con confianzaAndres Almiray
 
Liberando a produccion con confidencia
Liberando a produccion con confidenciaLiberando a produccion con confidencia
Liberando a produccion con confidenciaAndres Almiray
 
OracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersOracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersAndres Almiray
 
Softcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersSoftcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersAndres Almiray
 
Oracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersOracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersAndres Almiray
 
JReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightJReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightAndres Almiray
 
Building modular applications with the Java Platform Module System and Layrry
Building modular applications with the Java Platform Module System and LayrryBuilding modular applications with the Java Platform Module System and Layrry
Building modular applications with the Java Platform Module System and LayrryAndres Almiray
 
Going Reactive with g rpc
Going Reactive with g rpcGoing Reactive with g rpc
Going Reactive with g rpcAndres Almiray
 
Building modular applications with JPMS and Layrry
Building modular applications with JPMS and LayrryBuilding modular applications with JPMS and Layrry
Building modular applications with JPMS and LayrryAndres Almiray
 
Taking Micronaut out for a spin
Taking Micronaut out for a spinTaking Micronaut out for a spin
Taking Micronaut out for a spinAndres Almiray
 
Apache Groovy's Metaprogramming Options and You
Apache Groovy's Metaprogramming Options and YouApache Groovy's Metaprogramming Options and You
Apache Groovy's Metaprogramming Options and YouAndres Almiray
 
What I wish I knew about Maven years ago
What I wish I knew about Maven years agoWhat I wish I knew about Maven years ago
What I wish I knew about Maven years agoAndres Almiray
 
What I wish I knew about maven years ago
What I wish I knew about maven years agoWhat I wish I knew about maven years ago
What I wish I knew about maven years agoAndres Almiray
 
The impact of sci fi in tech
The impact of sci fi in techThe impact of sci fi in tech
The impact of sci fi in techAndres Almiray
 
Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Andres Almiray
 
Creating Better Builds with Gradle
Creating Better Builds with GradleCreating Better Builds with Gradle
Creating Better Builds with GradleAndres Almiray
 
Interacting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleInteracting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleAndres Almiray
 

Más de Andres Almiray (20)

Creando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoCreando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abierto
 
Liberando a produccion con confianza
Liberando a produccion con confianzaLiberando a produccion con confianza
Liberando a produccion con confianza
 
Liberando a produccion con confidencia
Liberando a produccion con confidenciaLiberando a produccion con confidencia
Liberando a produccion con confidencia
 
OracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersOracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java Developers
 
Softcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersSoftcon.ph - Maven Puzzlers
Softcon.ph - Maven Puzzlers
 
Maven Puzzlers
Maven PuzzlersMaven Puzzlers
Maven Puzzlers
 
Oracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersOracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java Developers
 
JReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightJReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of light
 
Building modular applications with the Java Platform Module System and Layrry
Building modular applications with the Java Platform Module System and LayrryBuilding modular applications with the Java Platform Module System and Layrry
Building modular applications with the Java Platform Module System and Layrry
 
Going Reactive with g rpc
Going Reactive with g rpcGoing Reactive with g rpc
Going Reactive with g rpc
 
Building modular applications with JPMS and Layrry
Building modular applications with JPMS and LayrryBuilding modular applications with JPMS and Layrry
Building modular applications with JPMS and Layrry
 
Taking Micronaut out for a spin
Taking Micronaut out for a spinTaking Micronaut out for a spin
Taking Micronaut out for a spin
 
Apache Groovy's Metaprogramming Options and You
Apache Groovy's Metaprogramming Options and YouApache Groovy's Metaprogramming Options and You
Apache Groovy's Metaprogramming Options and You
 
What I wish I knew about Maven years ago
What I wish I knew about Maven years agoWhat I wish I knew about Maven years ago
What I wish I knew about Maven years ago
 
What I wish I knew about maven years ago
What I wish I knew about maven years agoWhat I wish I knew about maven years ago
What I wish I knew about maven years ago
 
The impact of sci fi in tech
The impact of sci fi in techThe impact of sci fi in tech
The impact of sci fi in tech
 
Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019
 
Creating Better Builds with Gradle
Creating Better Builds with GradleCreating Better Builds with Gradle
Creating Better Builds with Gradle
 
Interacting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleInteracting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with Gradle
 
Gradle ex-machina
Gradle ex-machinaGradle ex-machina
Gradle ex-machina
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Polyglot Programming @ Jax.de 2010

  • 1. Andres Almiray | Canoo Engineering AG Polyglot Programming in the JVM Or how I Learned to Stop Worrying and Love the JVM
  • 2. About the speaker   Java developer since the beginning   True believer in open source   Groovy committer since 2007   Project lead of the Griffon framework   Currently working for
  • 3. Some facts about Java   Previous name was Oak. Bonus points for knowing its real name before that   Made its public appearance in 1995   C/C++ were king at the time   Networking, multithreading were baked right into the language   Developers came for the applets and stayed for the components (JEE and all that jazz)
  • 4. However...   It is already in its teens   It has not seen a major feature upgrade since JDK5 was released back in 2004 -> generics (and we do know how that turned out to be, don’t we?)   JDK7 has been delayed again (late 2010). Some features might or might not make the cut (the closures debacle)
  • 5. More so...   It is rather verbose when compared to how other languages do the same task   Its threading features are no longer enough. Concurrent programs desperately cry for immutability these days
  • 6. Truth or myth?   Is Java oftenly referred as overengineered?   Can you build a Java based web application (for arguments sake a basic Twitter clone) in less than a day‘s work WITHOUT an IDE?   Did James Gosling ever say he was threatened with bodily harm should operator overloading find its way into Java?
  • 7. The JVM is a great place to work however Java makes it painful sometimes...
  • 8. What can we do about it?!
  • 9.
  • 10. Disclaimer (this is not a bash-the-other-languages talk)
  • 12. Standard Beans public class Bean { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }
  • 13. Standard Beans public class Bean { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }
  • 14. Standard Beans class Bean { String name }
  • 15. Standard Beans class Bean(var name:String) class Bean { @scala.reflect.BeanProperty var name: String }
  • 17. Closures (or Functions) public interface Adder { int add(int a, int b); } public class MyAdder implements Adder { public int add(int a, int b) { return a + b; } }
  • 18. Closures (or Functions) def adder = { a , b -> a + b }
  • 19. Closures (or Functions) def adder(a: Int, b: Int) = a + b
  • 20. Closures (or Functions) (defn adder [a b] (+ a b))
  • 21. Enhanced switch char letterGrade(int grade) { if(grade >= 0 && grade <= 60) return ‘F‘; if(grade > 60 && grade <= 70) return ‘D‘; if(grade > 70 && grade <= 80) return ‘C‘; if(grade > 80 && grade <= 90) return ‘B‘; if(grade > 90 && grade <= 100) return ‘A‘; throw new IllegalArgumentException(‘invalid grade ‘+grade); }
  • 22. Enhanced Switch def letterGrade(grade) { switch(grade) { case 90..100: return ‘A‘ case 80..<90: return ‘B‘ case 70..<80: return ‘C‘ case 60..<70: return ‘D‘ case 0..<60: return ‘F‘ case ~"[ABCDFabcdf]": return grade.toUpperCase() } throw new IllegalArgumentException (‘invalid grade ‘+grade) }
  • 23. Enhanced Switch val VALID_GRADES = Set("A", "B", "C", "D", "F") def letterGrade(value: Any):String = value match { case x:Int if (90 to 100).contains(x) => "A" case x:Int if (80 to 90).contains(x) => "B" case x:Int if (70 to 80).contains(x) => "C" case x:Int if (60 to 70).contains(x) => "D" case x:Int if (0 to 60).contains(x) => "F" case x:String if VALID_GRADES(x.toUpperCase) => x.toUpperCase() }
  • 24. Enhanced Switch (defn letter-grade [grade] (cond (in grade 90 100) "A" (in grade 80 90) "B" (in grade 70 80) "C" (in grade 60 70) "D" (in grade 0 60) "F" (re-find #"[ABCDFabcdf]" grade) (.toUpperCase grade)))
  • 26. All of these are true   Java can call Groovy, Scala and Clojure classes as if they were Java classes   Groovy, Scala and Clojure can call Java code without breaking a sweat   In other words, interoperability with Java is a given. No need for complicated bridges between languages (i.e. JSR 223)
  • 27. Ok, so... What else can these languages do?
  • 28. All of them   Native syntax for collection classes   Everything is an object   Closures!   Regular expressions as first class citizens   Operator overloading
  • 29. Groovy   Metaprogramming (HOT!) both at buildtime and runtime   Builders   Healthy ecosystem: Grails, Griffon, Gant, Gradle, Spock, Gaelyk, Gpars, CodeNarc, etc...
   Not an exhaustive list of features!
  • 30. Scala   Richer type system   Type inference   Pattern matching (case classes)   Actor model
   Not an exhaustive list of features!
  • 31. Clojure   Data as code and viceversa   Immutable structures   STM
   Not an exhaustive list of features!
  • 32. Demo
  • 33. Other places where you‘ll find Polyglot Programming
  • 34. Web app development   XML   SQL   JavaScript   JSON   CSS   Flash/Flex/ActionScript
  • 35. Next-Gen datastores (NoSQL)   FleetDB -> Clojure
   FlockDB -> Scala
   CouchDB, Riak -> Erlang   btw watch out for Polyglot Persistence ;-)
  • 36. Build systems   Gradle, Gant -> Groovy
   Rake -> Ruby/JRuby
   Maven3 -> XML, Groovy, Ruby
  • 37. Parting thoughts   Java (the language) may have reached its maturity feature wise   Other JVM languages evolved faster   Polyglot Programming is not a new concept   Download and play with each of the demoed languages, maybe one of them strikes your fancy