Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except...

18
Mozilla Rhino Attila Szegedi @asz Thursday, October 13, 11

Transcript of Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except...

Page 1: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

History

bull One of the oldest non-Java language runtimes on the JVM

bull Originally part of Mozillarsquos all-Java browser project from 1997

bull Has its own bytecode generator engine from day one

Thursday October 13 11

What is it

bull Itrsquos just JavaScript

bull you can run any JavaScript program on top of it

bull Itrsquos more than JavaScript

bull it integrates with the JVM You can use Java objects and libraries

Thursday October 13 11

Compatibilitybull Most of ECMAScript 5

bull Everything except strict mode

bull Full JS17 (and earlier) support

bull Partial JS 18 support

bull expression closures destructuring assignment

bull no generator expressions

bull ECMAScript for XML (E4X)

bull JSON parserstringifier

Thursday October 13 11

What it isnrsquot

bull It isnrsquot a browser JavaScript runtime

bull Doesnrsquot come with HTML DOM out of the box

bull HtmlUnit project can be used if thatrsquos needed

Thursday October 13 11

Optimization settings

bull Three optimization levels

bull -1 pure interpreter

bull 0 bytecode compiler no optimizations

bull 9 bytecode compiler with optimizations

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)function time(f) t1 = javalangSystemcurrentTimeMillis() f() t2 = javalangSystemcurrentTimeMillis() print(t2 - t1)

function fib(n) return n lt 2 n fib(n-1) + fib(n-2)

time(function() fib(30) )

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)

bull Interpreted took 14 seconds

bull Opt 0 took 09 seconds

bull Opt 9 took 03 seconds

Thursday October 13 11

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 2: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

History

bull One of the oldest non-Java language runtimes on the JVM

bull Originally part of Mozillarsquos all-Java browser project from 1997

bull Has its own bytecode generator engine from day one

Thursday October 13 11

What is it

bull Itrsquos just JavaScript

bull you can run any JavaScript program on top of it

bull Itrsquos more than JavaScript

bull it integrates with the JVM You can use Java objects and libraries

Thursday October 13 11

Compatibilitybull Most of ECMAScript 5

bull Everything except strict mode

bull Full JS17 (and earlier) support

bull Partial JS 18 support

bull expression closures destructuring assignment

bull no generator expressions

bull ECMAScript for XML (E4X)

bull JSON parserstringifier

Thursday October 13 11

What it isnrsquot

bull It isnrsquot a browser JavaScript runtime

bull Doesnrsquot come with HTML DOM out of the box

bull HtmlUnit project can be used if thatrsquos needed

Thursday October 13 11

Optimization settings

bull Three optimization levels

bull -1 pure interpreter

bull 0 bytecode compiler no optimizations

bull 9 bytecode compiler with optimizations

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)function time(f) t1 = javalangSystemcurrentTimeMillis() f() t2 = javalangSystemcurrentTimeMillis() print(t2 - t1)

function fib(n) return n lt 2 n fib(n-1) + fib(n-2)

time(function() fib(30) )

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)

bull Interpreted took 14 seconds

bull Opt 0 took 09 seconds

bull Opt 9 took 03 seconds

Thursday October 13 11

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 3: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

What is it

bull Itrsquos just JavaScript

bull you can run any JavaScript program on top of it

bull Itrsquos more than JavaScript

bull it integrates with the JVM You can use Java objects and libraries

Thursday October 13 11

Compatibilitybull Most of ECMAScript 5

bull Everything except strict mode

bull Full JS17 (and earlier) support

bull Partial JS 18 support

bull expression closures destructuring assignment

bull no generator expressions

bull ECMAScript for XML (E4X)

bull JSON parserstringifier

Thursday October 13 11

What it isnrsquot

bull It isnrsquot a browser JavaScript runtime

bull Doesnrsquot come with HTML DOM out of the box

bull HtmlUnit project can be used if thatrsquos needed

Thursday October 13 11

Optimization settings

bull Three optimization levels

bull -1 pure interpreter

bull 0 bytecode compiler no optimizations

bull 9 bytecode compiler with optimizations

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)function time(f) t1 = javalangSystemcurrentTimeMillis() f() t2 = javalangSystemcurrentTimeMillis() print(t2 - t1)

function fib(n) return n lt 2 n fib(n-1) + fib(n-2)

time(function() fib(30) )

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)

bull Interpreted took 14 seconds

bull Opt 0 took 09 seconds

bull Opt 9 took 03 seconds

Thursday October 13 11

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 4: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Compatibilitybull Most of ECMAScript 5

bull Everything except strict mode

bull Full JS17 (and earlier) support

bull Partial JS 18 support

bull expression closures destructuring assignment

bull no generator expressions

bull ECMAScript for XML (E4X)

bull JSON parserstringifier

Thursday October 13 11

What it isnrsquot

bull It isnrsquot a browser JavaScript runtime

bull Doesnrsquot come with HTML DOM out of the box

bull HtmlUnit project can be used if thatrsquos needed

Thursday October 13 11

Optimization settings

bull Three optimization levels

bull -1 pure interpreter

bull 0 bytecode compiler no optimizations

bull 9 bytecode compiler with optimizations

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)function time(f) t1 = javalangSystemcurrentTimeMillis() f() t2 = javalangSystemcurrentTimeMillis() print(t2 - t1)

function fib(n) return n lt 2 n fib(n-1) + fib(n-2)

time(function() fib(30) )

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)

bull Interpreted took 14 seconds

bull Opt 0 took 09 seconds

bull Opt 9 took 03 seconds

Thursday October 13 11

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 5: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

What it isnrsquot

bull It isnrsquot a browser JavaScript runtime

bull Doesnrsquot come with HTML DOM out of the box

bull HtmlUnit project can be used if thatrsquos needed

Thursday October 13 11

Optimization settings

bull Three optimization levels

bull -1 pure interpreter

bull 0 bytecode compiler no optimizations

bull 9 bytecode compiler with optimizations

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)function time(f) t1 = javalangSystemcurrentTimeMillis() f() t2 = javalangSystemcurrentTimeMillis() print(t2 - t1)

function fib(n) return n lt 2 n fib(n-1) + fib(n-2)

time(function() fib(30) )

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)

bull Interpreted took 14 seconds

bull Opt 0 took 09 seconds

bull Opt 9 took 03 seconds

Thursday October 13 11

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 6: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Optimization settings

bull Three optimization levels

bull -1 pure interpreter

bull 0 bytecode compiler no optimizations

bull 9 bytecode compiler with optimizations

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)function time(f) t1 = javalangSystemcurrentTimeMillis() f() t2 = javalangSystemcurrentTimeMillis() print(t2 - t1)

function fib(n) return n lt 2 n fib(n-1) + fib(n-2)

time(function() fib(30) )

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)

bull Interpreted took 14 seconds

bull Opt 0 took 09 seconds

bull Opt 9 took 03 seconds

Thursday October 13 11

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 7: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Optimization settings

bull Letrsquos compare them using fib(30)function time(f) t1 = javalangSystemcurrentTimeMillis() f() t2 = javalangSystemcurrentTimeMillis() print(t2 - t1)

function fib(n) return n lt 2 n fib(n-1) + fib(n-2)

time(function() fib(30) )

Thursday October 13 11

Optimization settings

bull Letrsquos compare them using fib(30)

bull Interpreted took 14 seconds

bull Opt 0 took 09 seconds

bull Opt 9 took 03 seconds

Thursday October 13 11

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 8: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Optimization settings

bull Letrsquos compare them using fib(30)

bull Interpreted took 14 seconds

bull Opt 0 took 09 seconds

bull Opt 9 took 03 seconds

Thursday October 13 11

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 9: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

When to use which

bull Opt 9 in most cases

bull Opt 0 - donrsquot really have a modern use case for it

bull Opt -1 constrained devices environments that donrsquot allow you to load generated bytecode at runtime or when you need continuations

Thursday October 13 11

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 10: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

CommonJS

bull Since Rhino 17R3 we have CommonJS Modules support

bull Code loading mechanism originally for non-browser JS engines

Thursday October 13 11

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 11: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Integrating with Java

bull Packages ldquocomrdquo ldquoorgrdquo ldquonetrdquo ldquojavardquo ldquojavaxrdquo exposed as top-level objects

bull Just do ldquonew javaxswingJFramerdquo or such

bull Other packages available as ldquoPackagesrdquo

Thursday October 13 11

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 12: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Bundled Rhino

bull Rhino is also shipping as standard part of the JRE since Java 6

Thursday October 13 11

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 13: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Continuations

bull Think of them as an object representing the stack at the point of execution

bull Can store them away and resume them any number of times

bull In a web app can cure the lame ldquodonrsquot click the back buttonrdquo syndrome

Thursday October 13 11

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 14: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Future direction

bull Invokedynamic (preferrably via Dynalink)

bull Performance improvements

bull Recent change in string concatenation sped up SunSpider performance 3x

bull

Thursday October 13 11

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 15: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Where to get it

bull Stable releases are athttpmozillaorgrhino

bull Source code repository used to be in Mozilla CVS

bull Now migrated tohttpsgithubcommozillarhino

bull Fork it

Thursday October 13 11

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 16: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Other contenders

bull Nashorn Oraclersquos new invokedynamic based JS runtime

bull dynjs another invokedynamic based JS runtime at httpgithuborgdynjsdynjs

Thursday October 13 11

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 17: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Questions

Thursday October 13 11

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11

Page 18: Mozilla Rhino - GOTO Conference · Compatibility • Most of ECMAScript 5 • Everything except strict mode • Full JS1.7 (and earlier) support • Partial JS 1.8 support • expression

Mozilla RhinoAttila Szegedi

asz

Thursday October 13 11