1.23k likes | 1.41k Views
The JVM is dead! Long live the Polyglot VM!. Marcus Lagergren Oracle. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract.
E N D
The JVM is dead!Long live the Polyglot VM! Marcus Lagergren Oracle
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Who am I? @lagergren
Program Agenda • Introduction • History of VM languages and runtimes • Emerging languages and language design on top of the JVM • Invokedynamic • The Nashorn project • The Da Vinci Machine Project (MLVM)
I am here to talk about… The Java Runtime: The JVM
I am here to talk about… The Universal Meta-Execution Environment
I am here to talk about… The Universal Meta-Execution Environment
I am here to talk about… The JVM as a multi language runtime
I am here to talk about… The JVM as a multi language runtime (especially in the context of dynamic languages)
History (what is a runtime anyway?)
LISP 1950s – First compiler in 1962
LISP 1950s – First compiler in 1962 Just-in-time compilation
LISP FIRST JIT EVER! 1950s – First compiler in 1962 Just-in-time compilation
LISP 1950s – First compiler in 1962 Just-in-time compilation GC – Reference Counting
LISP FIRST MODERN ADAPTIVE RUNTIME! 1950s – First compiler in 1962 Just-in-time compilation GC – Reference Counting
Smalltalk First class library
Smalltalk First class library First visual GUI driven IDE
Smalltalk First class library First visual GUI driven IDE BYTECODE!
Smalltalk NOTHING NEW UNDER THE SUN SINCE? First class library First visual GUI driven IDE BYTECODE!
Dynamic Languages ActionScript Adenine APL BASIC BeanShellClojure ColdFusion Dart Dylan Groovy E Fancy JavaScript Julia Lua MATLAB Objective-C Perl PHP Powershell Python Qore R REBOL REXX Ruby Scheme Smalltalk Snit Tcl VBScript Yoixetcetcetc etc…
Dynamic Languages ActionScript Adenine APL BASIC BeanShellClojureColdFusion Dart Dylan Groovy E Fancy JavaScript Julia Lua MATLAB Objective-C Perl PHPPowershellPythonQore R REBOL REXX Ruby Scheme Smalltalk Snit Tcl VBScript Yoixetcetcetc etc…
Dynamic Languages • Dynamic Languages are hot today because • They are easy to use • They have no explicit compile stage • They have good code readability • Allow short development time for small projects • Performance is good enough
Trendy Dynamic Languages Already on top of the JVM
Trendy Dynamic Languages Already on top of the JVM
… and of course V8, Futhark, Carakan, SpiderMonkey, JägerMonkey, *Monkey, Nitro, Rhino, Nashorn, etcetc
Dynamic Languages – Implementation • Native Runtimes • Ruby, Perl, Python, v8, *monkey etc
Dynamic Languages – Implementation • Native Runtimes • Ruby, Perl, Python, v8, *monkey etc • Metacircular • PyPy, Steel Banks Common LISP, Rubinius (well partly), Smalltalk
Dynamic Languages – Implementation • Native Runtimes • Ruby, Perl, Python, v8, *monkey etc • Metacircular • PyPy, Steel Banks Common LISP, Rubinius (well partly), Smalltalk • On top of a (J)VM • Clojure, Jython, JRuby, Rhino, Nashorn • DLR/CLR
Dynamic Languages – Implementation • Native Runtimes • Ruby, Perl, Python, v8, *monkey etc • Metacircular • PyPy, Steel Banks Common LISP, Rubinius (well partly), Smalltalk • On top of a (J)VM • Clojure, Jython, JRuby, Rhino, Nashorn • DLR/CLR
Dynamic Languages – Characteristics • Most emerging JVM languages today are dynamic • As opposed to “non-dynamic” I guess… • What is a dynamic language? • Is there a formal definition?
Dynamic Languages – Characteristics • Loosely typed • Dynamic binding • Resolve functions/members/calls at runtime rather than compile time
Dynamic Languages – Characteristics • Liberal redefinition policy • Redefine/modify a class • Redefine/modify a function
Dynamic Languages – Characteristics • Liberal redefinition policy • Redefine/modify a class • Redefine/modify a function • Redefine a builtin even • Oh, go to hell, JavaScript! Math.sin = function(x){ return 17; }
Dynamic Languages – Characteristics • Code equals data • eval/ REPL • Automatic memory management
Dynamic Languages – Characteristics • But you can extend Java at runtime too, can’t you? • Maybe a “non dynamic” language is more like C? • I don’t think the “dynamic” prefix matters much • Things change at runtime – handle it
Why? • You get so much for free • Automatic memory management • State of the art JIT optimizations • Native threading capability • Hybridization (JSR-223) • Man decades of high tech