SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
Evolving the Java
    platform
          Ola Bini
   JRuby Core Developer
   ThoughtWorks Studios
About me
•   Ola Bini

•   From Stockholm, Sweden

•   JRuby Core Developer

•   ThoughtWorks Studios

•   Member of the JSR292 expert group

•   Programming language geek
Agenda
•   Other languages?

•   The Java Virtual Machine

•   New language features

•   The DaVinci machine

•   Java and Ruby

•   Q&A
The Java platform
The Java platform
Other languages
    Hecl         HotScheme        tuProlog      WLShell
     Jacl          webLISP           JLog      JudoScript
  Clojure              Jaja           LL          JRuby
Ync/Javascript     JScheme         javalog         Jickle
     JoyJ              Skij      SmallWorld       Rhino
 v-language          Kawa           Bistro      BeanShell
    CAL                uts         Talks2          Resin
 Aardappel           JBasic         Obol         Jython
   Funnel          Mapyrus         Groovy         Pnuts
     Mini         CONVERT           Nice          Janino
   PLAN            HotTEA           Scala       Join Java
     Sixx          COCOA            Anvil        JMatch
BDC Scheme         NetLogo          dSelf        iScript
   ABCL            StarLogo         Hojo           Yassl
      Lili          AJLogo        Correlate         Yoix
    Jatha        Turtle Tracks      MetaJ          W4F
   Bigloo            rLogo         Sather      PERCobol
    SISC              Yoyo        Quercus      Bex Script
     Lisp         TermWare         FScript    Demeter/Java
     PS3i          XProlog          Sleep      CKI Prolog
Other languages: Clojure
•   Lisp dialect (dynamic, code as data)

•   Designed for the JVM

•   Powerful macros

•   Good interoperability with Java

•   Functional programming language (mostly)
    •   Immutable data structures

•   Concurrency
    •   Shared transactional memory
    •   Actors
Other languages: Groovy
•   Dynamically, strongly typed

•   Object oriented

•   Designed for the JVM

•   Inspired by Python, Ruby and Smalltalk

•   Good integration with Java

•   Mostly precompiled
Other languages: Scala
•   Multiparadigm language
    •   Object orientedness
    •   Functional programming natural

•   Designed for the JVM

•   Concurrency: Actors

•   Includes many advanced language features
    •   Pattern matching, closures, parametric polymorphism
    •   Sequence comprehensions, mixins, infix or postfix statements
The Java Virtual Machine
•   Virtual machines are the norm

•   CPU cycles are cheap enough for JIT, GC, RTT, etc

•   The JVM is a great virtual machine
    •   Flexible online code loading (with safe bytecodes)
    •   GC & object structure
        •   Mature and provides lots of algorithms and tuning opportunities

    •   Reflective access to classes & objects
    •   Tools (JMM, JVMTI, dtrace)
    •   Good libraries & a nice language to write more
The Java Virtual Machine
•   Optimizing Just-In-Time compiler

•   Clever performance techniques
    •   Type inference
    •   Customization
    •   Profiling
    •   Deoptimizing
    •   Fast/slow paths
    •   etc.

•   The JVM is mature
Needs of higher level languages
•   High level languages often require:
    •   Very late binding (runtime linking, typing, code gen)
    •   Automatic storage management (GC)
    •   Environmental queries (reflection, stack walking)
    •   Exotic primitives (tailcalls, bignums, call/cc)
    •   Code management integrated with execution
    •   Robust handling of incorrect inputs
    •   Helpful runtime support libraries (regexps, math, ...)
    •   A compiler (JIT and/or AOT) that understands it all

•   The JVM has some of this, but not all
What’s missing?
•   Dynamic invocation

•   As always, higher performance
What’s missing?
•   Dynamic invocation

•   As always, higher performance

•   Lightweight method objects

•   Lightweight bytecode loading

•   Continuations and stack introspection

•   Tails calls and tail recursion

•   Tuples and value-oriented types

•   Immediate wrapper types

•   Symbolic freedom (non-Java names)
Dynamic invocation
•   Non-Java call site in the bytecodes

•   Language-specific handler
    •   Determines linking at runtime
    •   Works in a reflective style
    •   Installs direct (non-reflective) methods

•   Stateful: can be updated or revoked over time

•   Any dynamic language will benefit greatly
Lightweight method handles
•   Method handle = lightweight reference to a method

•   Like java.lang.reflect.Method, but much, much lighter

•   Caller invokes without knowing method’s name, etc

•   Call runs at nearly the speed of Java call

•   Required to glue together dynamic call sites

•   Requires VM and/or library support for common adaptation
    patterns (currying, receiver check, varargs, etc)
Lightweight bytecode loading
•   Anonymous classes

•   Faster and more reliable loading and unloading

•   Little interaction with system dictionary or class loaders
    •   “class names considered harmful”

•   Library-directed code customization

•   No more one-classloader-per-class
Continuations
•   Stack manipulation (call/cc)

•   Extremely powerful

•   Allows computations to be paused and resumed

•   Could be implemented using copyStack and resumeStack.
    (+ 1 (call/cc
              (lambda (k)
                  (+ 2 (k 3)))))     ; => 4
Tail calls
•   Allows iteration to be modeled as recursion
    •   Without the performance problems of this

•   Common pattern in many languages

•   Allow computations to be more closely modeled on
    mathematical formulas

•   Factorial in Scheme:

    (define (factorial n)
      (define (fac-times n acc)
        (if (= n 0)
            acc
            (fac-times (- n 1) (* acc n))))
      (fac-times n 1))
Tuples and value types
•   Quite common pattern in Java:
    return new Object[]{42, “something”};

•   Tuples are basically a named struct

•   Ordered pairs, etc

•   Other value objects: Lisp-style bignums?
Symbolic freedom
•   Allow any identifier as name

•   JVM identifiers originally based on the Java language

•   No real reason for this

•   Support for Ruby style names
    •   empty?
    •   value=
    •   clear!

•   Canonical name mangling
Interface injection
•   Give existing classes a new supertype

•   Either an interface

•   ... or an interface plus new method implementations

•   Or Mixins

•   There are several tactics to make this quite simple for the VM
Performance
•   Bytecode analysis
    •   Less-static bytecode shapes
    •   Class.isInstance, Arrays.copyOf

•   Faster reflection

•   Faster closure-type objects

•   Escape analysis to remove auto-boxing
What about Closures?
•   There are several closures proposals right now

•   All of them except CICE benefits from method handles

•   Interface injection would also be beneficial

•   But - closures doesn’t require any of this

•   The machinery is already there

•   It will just be simpler to implement with this available
The DaVinci Machine
•   Evolutionary adaptation of the present JVM

•   Open-ended experiment
    •   Wild ideas are considered, but most prove useful
    •   While incubating, features are disabled by default

•   Eventual convergence

•   Prototype JVM extensions to run non-Java languages
    efficiently

•   First class architectural support (no hack or side-cars)

•   New languages to co-exist gracefully with Java in the JVM
The DaVinci Machine
•   Most of the features mentioned above have or will be
    implemented here

•   Will eventually decide what makes it in Java 7

•   Why do this?
    •   Language implementers know what they want
        •   ...and how to simulate it at 100x slowdown

    •   VM implementors know what VMs can do
        •   ...and how to make their languages sing

    •   Let’s bring them together
Case study: Ruby on the JVM
•   JRuby

•   Java implementation of the Ruby language

•   Interpreter and Compiler

•   Interpreter: slow

•   Compiler: fast
    •   But cumbersome

•   Ruby is a complex language
JRuby Compiler pain
•   AOT pain
    •   Code bodies as Java methods need method handles
        •   Are generated as adapter methods right now

    •   Ruby is terse - compiled output extremely verbose
    •   Mapping symbols safely

•   JIT pain
    •   Method body must live on a class
        •   Class must live in separate ClassLoader to GC

        •   Class name must be unique within that classloader

        •   Gobs of memory used up working around all this
Compiler optimization pain
 •   Build-your-own dynamic invocation
     •   Naive approach doesn’t perform (hash lookup, reflection)

 •   B-y-o reflective method handle logic
     •   Handle-per-method means class+classloader per method

     •   Overloaded signatures means more handles

     •   Non-overloading languages introduce arg boxing cost

 •   B-y-o call site optimizations
     •   ... and must make sure they don’t interfere with JVM optz

 •   We shouldn’t have to worry about all this
DEMO
Compilation
  output
JSR 292
•   Supporting Dynamically Typed Languages

•   Main feature:
    •   invoke_dynamic
    •   Hotswapping

•   Representatives from JRuby, Groovy, Jython, among others

•   Focus on VM support
The JVM Languages group
•   Focus on library level support for languages running on the
    JVM

•   Discussions about current painpoints

•   Meta-object protocol

•   Java method overload resolution at runtime

•   Representatives from JRuby, Jython, Groovy, Pnuts, Nice, Ng,
    Scala, Clojure, and many more
Resources
•   http://openjdk.java.net/projects/mlvm

•   http://blogs.sun.com/jrose

•   http://groups.google.com/group/jvm-languages

•   http://lambda-the-ultimate.org

•   http://www.scala-lang.org

•   http://clojure.sourceforge.net

•   http://groovy.codehaus.org
Q&A

Más contenido relacionado

La actualidad más candente

Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applicationsRuslan Shevchenko
 
Challenges in Debugging Bootstraps of Reflective Kernels
Challenges in Debugging Bootstraps of Reflective KernelsChallenges in Debugging Bootstraps of Reflective Kernels
Challenges in Debugging Bootstraps of Reflective KernelsESUG
 
GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28Jorge Hidalgo
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programmingbusiness Corporate
 
Tail Call Elimination in Open Smalltalk
Tail Call Elimination in Open SmalltalkTail Call Elimination in Open Smalltalk
Tail Call Elimination in Open SmalltalkESUG
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updatesVinay H G
 
Java and Java platforms
Java and Java platformsJava and Java platforms
Java and Java platformsIlio Catallo
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devopsRob Kinyon
 
Java compilation
Java compilationJava compilation
Java compilationMike Kucera
 
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT CompilerGraal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT CompilerKoichi Sakata
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineChun-Yu Wang
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeOmar Bashir
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediZeroTurnaround
 
CS Lesson: Introduction to the Java virtual Machine
CS Lesson: Introduction to the Java virtual MachineCS Lesson: Introduction to the Java virtual Machine
CS Lesson: Introduction to the Java virtual MachineKatrin Becker
 

La actualidad más candente (18)

Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applications
 
Challenges in Debugging Bootstraps of Reflective Kernels
Challenges in Debugging Bootstraps of Reflective KernelsChallenges in Debugging Bootstraps of Reflective Kernels
Challenges in Debugging Bootstraps of Reflective Kernels
 
GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
 
Tail Call Elimination in Open Smalltalk
Tail Call Elimination in Open SmalltalkTail Call Elimination in Open Smalltalk
Tail Call Elimination in Open Smalltalk
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
Clojure presentation
Clojure presentationClojure presentation
Clojure presentation
 
Java and Java platforms
Java and Java platformsJava and Java platforms
Java and Java platforms
 
JVM++: The Graal VM
JVM++: The Graal VMJVM++: The Graal VM
JVM++: The Graal VM
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 
Java Basic PART I
Java Basic PART IJava Basic PART I
Java Basic PART I
 
Java compilation
Java compilationJava compilation
Java compilation
 
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT CompilerGraal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT Compiler
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machine
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and Runtime
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
 
ruby-cocoa
ruby-cocoaruby-cocoa
ruby-cocoa
 
CS Lesson: Introduction to the Java virtual Machine
CS Lesson: Introduction to the Java virtual MachineCS Lesson: Introduction to the Java virtual Machine
CS Lesson: Introduction to the Java virtual Machine
 

Destacado

Shashi Bellamkonda - Social Media at the DC Chamber of Commerce
Shashi Bellamkonda - Social Media  at the DC Chamber of CommerceShashi Bellamkonda - Social Media  at the DC Chamber of Commerce
Shashi Bellamkonda - Social Media at the DC Chamber of CommerceShashi Bellamkonda
 
What IA, UX and SEO Can Learn from Each Other
What IA, UX and SEO Can Learn from Each OtherWhat IA, UX and SEO Can Learn from Each Other
What IA, UX and SEO Can Learn from Each OtherIan Lurie
 
Connecting through Design: designer’s role bridging R&D and businesses
Connecting through Design: designer’s role bridging R&D and businessesConnecting through Design: designer’s role bridging R&D and businesses
Connecting through Design: designer’s role bridging R&D and businessesMarco Ferruzca
 
Socioeconomic Impact Assessment
Socioeconomic Impact AssessmentSocioeconomic Impact Assessment
Socioeconomic Impact AssessmentBedanga Bordoloi
 
Aslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec BddAslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec Bdddeimos
 
mulleres matemáticas 3
mulleres matemáticas 3mulleres matemáticas 3
mulleres matemáticas 3biblioxograr
 
Exercícios de Trigonometria Resolvidos
Exercícios de Trigonometria ResolvidosExercícios de Trigonometria Resolvidos
Exercícios de Trigonometria ResolvidosFlaber Bertochi
 
Penguin, SEO and the Apocalypse
Penguin, SEO and the ApocalypsePenguin, SEO and the Apocalypse
Penguin, SEO and the ApocalypseIan Lurie
 
Future of web development
Future of web developmentFuture of web development
Future of web developmenthedgehog lab
 
Realtime communication over a dual stack network
Realtime communication over a dual stack networkRealtime communication over a dual stack network
Realtime communication over a dual stack networkOlle E Johansson
 
Collaborating in the Clouds: selecting tools
Collaborating in the Clouds: selecting toolsCollaborating in the Clouds: selecting tools
Collaborating in the Clouds: selecting toolsBobbi Newman
 
The Universe Problem: Poll results, Facebook and the 2012 Presidential campaign
The Universe Problem: Poll results, Facebook and the 2012 Presidential campaignThe Universe Problem: Poll results, Facebook and the 2012 Presidential campaign
The Universe Problem: Poll results, Facebook and the 2012 Presidential campaignIan Lurie
 
Research 101 - Effective Research with Google
Research 101 - Effective Research with GoogleResearch 101 - Effective Research with Google
Research 101 - Effective Research with GoogleAndrew McCarthy
 

Destacado (20)

Shashi Bellamkonda - Social Media at the DC Chamber of Commerce
Shashi Bellamkonda - Social Media  at the DC Chamber of CommerceShashi Bellamkonda - Social Media  at the DC Chamber of Commerce
Shashi Bellamkonda - Social Media at the DC Chamber of Commerce
 
Mexican Design System
Mexican Design SystemMexican Design System
Mexican Design System
 
What IA, UX and SEO Can Learn from Each Other
What IA, UX and SEO Can Learn from Each OtherWhat IA, UX and SEO Can Learn from Each Other
What IA, UX and SEO Can Learn from Each Other
 
Connecting through Design: designer’s role bridging R&D and businesses
Connecting through Design: designer’s role bridging R&D and businessesConnecting through Design: designer’s role bridging R&D and businesses
Connecting through Design: designer’s role bridging R&D and businesses
 
Socioeconomic Impact Assessment
Socioeconomic Impact AssessmentSocioeconomic Impact Assessment
Socioeconomic Impact Assessment
 
Intervention
InterventionIntervention
Intervention
 
Aslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec BddAslak Hellesoy Executable User Stories R Spec Bdd
Aslak Hellesoy Executable User Stories R Spec Bdd
 
mulleres matemáticas 3
mulleres matemáticas 3mulleres matemáticas 3
mulleres matemáticas 3
 
CYBORGS (January 11, 2010)
CYBORGS (January 11, 2010)CYBORGS (January 11, 2010)
CYBORGS (January 11, 2010)
 
Exercícios de Trigonometria Resolvidos
Exercícios de Trigonometria ResolvidosExercícios de Trigonometria Resolvidos
Exercícios de Trigonometria Resolvidos
 
Penguin, SEO and the Apocalypse
Penguin, SEO and the ApocalypsePenguin, SEO and the Apocalypse
Penguin, SEO and the Apocalypse
 
Future of web development
Future of web developmentFuture of web development
Future of web development
 
What's A CMS?
What's A CMS?What's A CMS?
What's A CMS?
 
Realtime communication over a dual stack network
Realtime communication over a dual stack networkRealtime communication over a dual stack network
Realtime communication over a dual stack network
 
Noesmentira
NoesmentiraNoesmentira
Noesmentira
 
5 Things
5 Things5 Things
5 Things
 
Collaborating in the Clouds: selecting tools
Collaborating in the Clouds: selecting toolsCollaborating in the Clouds: selecting tools
Collaborating in the Clouds: selecting tools
 
Presentation Part III
Presentation Part IIIPresentation Part III
Presentation Part III
 
The Universe Problem: Poll results, Facebook and the 2012 Presidential campaign
The Universe Problem: Poll results, Facebook and the 2012 Presidential campaignThe Universe Problem: Poll results, Facebook and the 2012 Presidential campaign
The Universe Problem: Poll results, Facebook and the 2012 Presidential campaign
 
Research 101 - Effective Research with Google
Research 101 - Effective Research with GoogleResearch 101 - Effective Research with Google
Research 101 - Effective Research with Google
 

Similar a Ola Bini Evolving The Java Platform

J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The JvmQConLondon2008
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyAmit Solanki
 
javascript teach
javascript teachjavascript teach
javascript teachguest3732fa
 
JSBootcamp_White
JSBootcamp_WhiteJSBootcamp_White
JSBootcamp_Whiteguest3732fa
 
I Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java BytecodeI Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java BytecodeAlexander Shopov
 
Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM - Ben Summers (ONEIS)jaxLondonConference
 
JRuby - Enterprise 2.0
JRuby - Enterprise 2.0JRuby - Enterprise 2.0
JRuby - Enterprise 2.0Jan Sifra
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmSkills Matter
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYBnukeevry1
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SEdogangoko
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & javaEugene Bogaart
 
Why JVM will outlive java?
Why JVM will outlive java?Why JVM will outlive java?
Why JVM will outlive java?Ram Lakshmanan
 

Similar a Ola Bini Evolving The Java Platform (20)

J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Why Java
Why JavaWhy Java
Why Java
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
javascript teach
javascript teachjavascript teach
javascript teach
 
JSBootcamp_White
JSBootcamp_WhiteJSBootcamp_White
JSBootcamp_White
 
I Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java BytecodeI Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java Bytecode
 
Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)Real-world polyglot programming on the JVM  - Ben Summers (ONEIS)
Real-world polyglot programming on the JVM - Ben Summers (ONEIS)
 
JRuby - Enterprise 2.0
JRuby - Enterprise 2.0JRuby - Enterprise 2.0
JRuby - Enterprise 2.0
 
Workin On The Rails Road
Workin On The Rails RoadWorkin On The Rails Road
Workin On The Rails Road
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Intro to J Ruby
Intro to J RubyIntro to J Ruby
Intro to J Ruby
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
 
JAVA BYTE CODE
JAVA BYTE CODEJAVA BYTE CODE
JAVA BYTE CODE
 
Jax keynote
Jax keynoteJax keynote
Jax keynote
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYB
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SE
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
 
Why JVM will outlive java?
Why JVM will outlive java?Why JVM will outlive java?
Why JVM will outlive java?
 
Amoocon May 2009 Germany
Amoocon May 2009   GermanyAmoocon May 2009   Germany
Amoocon May 2009 Germany
 

Más de deimos

Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Rubydeimos
 
Randy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural PrinciplesRandy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural Principlesdeimos
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuerydeimos
 
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand DwrJoe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwrdeimos
 
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic LanguagesVenkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic Languagesdeimos
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfacesdeimos
 
Tim Mackinnon Agile And Beyond
Tim Mackinnon Agile And BeyondTim Mackinnon Agile And Beyond
Tim Mackinnon Agile And Beyonddeimos
 
Steve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And SerendipitySteve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And Serendipitydeimos
 
Stefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The WebStefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The Webdeimos
 
Stefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To RestStefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To Restdeimos
 
Rod Johnson Cathedral
Rod Johnson CathedralRod Johnson Cathedral
Rod Johnson Cathedraldeimos
 
Mike Stolz Dramatic Scalability
Mike Stolz Dramatic ScalabilityMike Stolz Dramatic Scalability
Mike Stolz Dramatic Scalabilitydeimos
 
Matt Youill Betfair
Matt Youill BetfairMatt Youill Betfair
Matt Youill Betfairdeimos
 
Pete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two SystemsPete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two Systemsdeimos
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registrydeimos
 
Neal Gafter Java Evolution
Neal Gafter Java EvolutionNeal Gafter Java Evolution
Neal Gafter Java Evolutiondeimos
 
Markus Voelter Textual DSLs
Markus Voelter Textual DSLsMarkus Voelter Textual DSLs
Markus Voelter Textual DSLsdeimos
 
Marc Evers People Vs Process Beyond Agile
Marc Evers People Vs Process Beyond AgileMarc Evers People Vs Process Beyond Agile
Marc Evers People Vs Process Beyond Agiledeimos
 
Magnus Christerson Henk Kolk Domain Expert DSLs
Magnus Christerson Henk Kolk Domain Expert DSLsMagnus Christerson Henk Kolk Domain Expert DSLs
Magnus Christerson Henk Kolk Domain Expert DSLsdeimos
 
Linda Rising Born To Cycle
Linda Rising Born To CycleLinda Rising Born To Cycle
Linda Rising Born To Cycledeimos
 

Más de deimos (20)

Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Ruby
 
Randy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural PrinciplesRandy Shoup eBays Architectural Principles
Randy Shoup eBays Architectural Principles
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuery
 
Joe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand DwrJoe Walker Interactivewebsites Cometand Dwr
Joe Walker Interactivewebsites Cometand Dwr
 
Venkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic LanguagesVenkat Subramaniam Blending Java With Dynamic Languages
Venkat Subramaniam Blending Java With Dynamic Languages
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfaces
 
Tim Mackinnon Agile And Beyond
Tim Mackinnon Agile And BeyondTim Mackinnon Agile And Beyond
Tim Mackinnon Agile And Beyond
 
Steve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And SerendipitySteve Vinoski Rest And Reuse And Serendipity
Steve Vinoski Rest And Reuse And Serendipity
 
Stefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The WebStefan Tilkov Soa Rest And The Web
Stefan Tilkov Soa Rest And The Web
 
Stefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To RestStefan Tilkov Pragmatic Intro To Rest
Stefan Tilkov Pragmatic Intro To Rest
 
Rod Johnson Cathedral
Rod Johnson CathedralRod Johnson Cathedral
Rod Johnson Cathedral
 
Mike Stolz Dramatic Scalability
Mike Stolz Dramatic ScalabilityMike Stolz Dramatic Scalability
Mike Stolz Dramatic Scalability
 
Matt Youill Betfair
Matt Youill BetfairMatt Youill Betfair
Matt Youill Betfair
 
Pete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two SystemsPete Goodliffe A Tale Of Two Systems
Pete Goodliffe A Tale Of Two Systems
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registry
 
Neal Gafter Java Evolution
Neal Gafter Java EvolutionNeal Gafter Java Evolution
Neal Gafter Java Evolution
 
Markus Voelter Textual DSLs
Markus Voelter Textual DSLsMarkus Voelter Textual DSLs
Markus Voelter Textual DSLs
 
Marc Evers People Vs Process Beyond Agile
Marc Evers People Vs Process Beyond AgileMarc Evers People Vs Process Beyond Agile
Marc Evers People Vs Process Beyond Agile
 
Magnus Christerson Henk Kolk Domain Expert DSLs
Magnus Christerson Henk Kolk Domain Expert DSLsMagnus Christerson Henk Kolk Domain Expert DSLs
Magnus Christerson Henk Kolk Domain Expert DSLs
 
Linda Rising Born To Cycle
Linda Rising Born To CycleLinda Rising Born To Cycle
Linda Rising Born To Cycle
 

Último

Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxWorkforce Group
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Centuryrwgiffor
 
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...Any kyc Account
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsMichael W. Hawkins
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876dlhescort
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMANIlamathiKannappan
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...amitlee9823
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayNZSG
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxAndy Lambert
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 

Último (20)

Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael Hawkins
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 

Ola Bini Evolving The Java Platform

  • 1. Evolving the Java platform Ola Bini JRuby Core Developer ThoughtWorks Studios
  • 2. About me • Ola Bini • From Stockholm, Sweden • JRuby Core Developer • ThoughtWorks Studios • Member of the JSR292 expert group • Programming language geek
  • 3. Agenda • Other languages? • The Java Virtual Machine • New language features • The DaVinci machine • Java and Ruby • Q&A
  • 6. Other languages Hecl HotScheme tuProlog WLShell Jacl webLISP JLog JudoScript Clojure Jaja LL JRuby Ync/Javascript JScheme javalog Jickle JoyJ Skij SmallWorld Rhino v-language Kawa Bistro BeanShell CAL uts Talks2 Resin Aardappel JBasic Obol Jython Funnel Mapyrus Groovy Pnuts Mini CONVERT Nice Janino PLAN HotTEA Scala Join Java Sixx COCOA Anvil JMatch BDC Scheme NetLogo dSelf iScript ABCL StarLogo Hojo Yassl Lili AJLogo Correlate Yoix Jatha Turtle Tracks MetaJ W4F Bigloo rLogo Sather PERCobol SISC Yoyo Quercus Bex Script Lisp TermWare FScript Demeter/Java PS3i XProlog Sleep CKI Prolog
  • 7. Other languages: Clojure • Lisp dialect (dynamic, code as data) • Designed for the JVM • Powerful macros • Good interoperability with Java • Functional programming language (mostly) • Immutable data structures • Concurrency • Shared transactional memory • Actors
  • 8. Other languages: Groovy • Dynamically, strongly typed • Object oriented • Designed for the JVM • Inspired by Python, Ruby and Smalltalk • Good integration with Java • Mostly precompiled
  • 9. Other languages: Scala • Multiparadigm language • Object orientedness • Functional programming natural • Designed for the JVM • Concurrency: Actors • Includes many advanced language features • Pattern matching, closures, parametric polymorphism • Sequence comprehensions, mixins, infix or postfix statements
  • 10. The Java Virtual Machine • Virtual machines are the norm • CPU cycles are cheap enough for JIT, GC, RTT, etc • The JVM is a great virtual machine • Flexible online code loading (with safe bytecodes) • GC & object structure • Mature and provides lots of algorithms and tuning opportunities • Reflective access to classes & objects • Tools (JMM, JVMTI, dtrace) • Good libraries & a nice language to write more
  • 11. The Java Virtual Machine • Optimizing Just-In-Time compiler • Clever performance techniques • Type inference • Customization • Profiling • Deoptimizing • Fast/slow paths • etc. • The JVM is mature
  • 12. Needs of higher level languages • High level languages often require: • Very late binding (runtime linking, typing, code gen) • Automatic storage management (GC) • Environmental queries (reflection, stack walking) • Exotic primitives (tailcalls, bignums, call/cc) • Code management integrated with execution • Robust handling of incorrect inputs • Helpful runtime support libraries (regexps, math, ...) • A compiler (JIT and/or AOT) that understands it all • The JVM has some of this, but not all
  • 13. What’s missing? • Dynamic invocation • As always, higher performance
  • 14. What’s missing? • Dynamic invocation • As always, higher performance • Lightweight method objects • Lightweight bytecode loading • Continuations and stack introspection • Tails calls and tail recursion • Tuples and value-oriented types • Immediate wrapper types • Symbolic freedom (non-Java names)
  • 15. Dynamic invocation • Non-Java call site in the bytecodes • Language-specific handler • Determines linking at runtime • Works in a reflective style • Installs direct (non-reflective) methods • Stateful: can be updated or revoked over time • Any dynamic language will benefit greatly
  • 16. Lightweight method handles • Method handle = lightweight reference to a method • Like java.lang.reflect.Method, but much, much lighter • Caller invokes without knowing method’s name, etc • Call runs at nearly the speed of Java call • Required to glue together dynamic call sites • Requires VM and/or library support for common adaptation patterns (currying, receiver check, varargs, etc)
  • 17. Lightweight bytecode loading • Anonymous classes • Faster and more reliable loading and unloading • Little interaction with system dictionary or class loaders • “class names considered harmful” • Library-directed code customization • No more one-classloader-per-class
  • 18. Continuations • Stack manipulation (call/cc) • Extremely powerful • Allows computations to be paused and resumed • Could be implemented using copyStack and resumeStack. (+ 1 (call/cc (lambda (k) (+ 2 (k 3))))) ; => 4
  • 19. Tail calls • Allows iteration to be modeled as recursion • Without the performance problems of this • Common pattern in many languages • Allow computations to be more closely modeled on mathematical formulas • Factorial in Scheme: (define (factorial n) (define (fac-times n acc) (if (= n 0) acc (fac-times (- n 1) (* acc n)))) (fac-times n 1))
  • 20. Tuples and value types • Quite common pattern in Java: return new Object[]{42, “something”}; • Tuples are basically a named struct • Ordered pairs, etc • Other value objects: Lisp-style bignums?
  • 21. Symbolic freedom • Allow any identifier as name • JVM identifiers originally based on the Java language • No real reason for this • Support for Ruby style names • empty? • value= • clear! • Canonical name mangling
  • 22. Interface injection • Give existing classes a new supertype • Either an interface • ... or an interface plus new method implementations • Or Mixins • There are several tactics to make this quite simple for the VM
  • 23. Performance • Bytecode analysis • Less-static bytecode shapes • Class.isInstance, Arrays.copyOf • Faster reflection • Faster closure-type objects • Escape analysis to remove auto-boxing
  • 24. What about Closures? • There are several closures proposals right now • All of them except CICE benefits from method handles • Interface injection would also be beneficial • But - closures doesn’t require any of this • The machinery is already there • It will just be simpler to implement with this available
  • 25. The DaVinci Machine • Evolutionary adaptation of the present JVM • Open-ended experiment • Wild ideas are considered, but most prove useful • While incubating, features are disabled by default • Eventual convergence • Prototype JVM extensions to run non-Java languages efficiently • First class architectural support (no hack or side-cars) • New languages to co-exist gracefully with Java in the JVM
  • 26. The DaVinci Machine • Most of the features mentioned above have or will be implemented here • Will eventually decide what makes it in Java 7 • Why do this? • Language implementers know what they want • ...and how to simulate it at 100x slowdown • VM implementors know what VMs can do • ...and how to make their languages sing • Let’s bring them together
  • 27. Case study: Ruby on the JVM • JRuby • Java implementation of the Ruby language • Interpreter and Compiler • Interpreter: slow • Compiler: fast • But cumbersome • Ruby is a complex language
  • 28. JRuby Compiler pain • AOT pain • Code bodies as Java methods need method handles • Are generated as adapter methods right now • Ruby is terse - compiled output extremely verbose • Mapping symbols safely • JIT pain • Method body must live on a class • Class must live in separate ClassLoader to GC • Class name must be unique within that classloader • Gobs of memory used up working around all this
  • 29. Compiler optimization pain • Build-your-own dynamic invocation • Naive approach doesn’t perform (hash lookup, reflection) • B-y-o reflective method handle logic • Handle-per-method means class+classloader per method • Overloaded signatures means more handles • Non-overloading languages introduce arg boxing cost • B-y-o call site optimizations • ... and must make sure they don’t interfere with JVM optz • We shouldn’t have to worry about all this
  • 31. JSR 292 • Supporting Dynamically Typed Languages • Main feature: • invoke_dynamic • Hotswapping • Representatives from JRuby, Groovy, Jython, among others • Focus on VM support
  • 32. The JVM Languages group • Focus on library level support for languages running on the JVM • Discussions about current painpoints • Meta-object protocol • Java method overload resolution at runtime • Representatives from JRuby, Jython, Groovy, Pnuts, Nice, Ng, Scala, Clojure, and many more
  • 33. Resources • http://openjdk.java.net/projects/mlvm • http://blogs.sun.com/jrose • http://groups.google.com/group/jvm-languages • http://lambda-the-ultimate.org • http://www.scala-lang.org • http://clojure.sourceforge.net • http://groovy.codehaus.org
  • 34. Q&A