SlideShare a Scribd company logo
1 of 19
Download to read offline
Server-Side JavaScript
with Nashorn
Dan Woods
@danveloper
About Me
Author for InfoQ /danveloper
danielpwoods@gmail.com
Intro
My Experiences with PhotoZero!
!
• A client-side file encryption service
!
• Allowed clients to security unlock files/photos with
confidence
!
• Server never knew about the content or password
that a user was uploading, only its chunks in the
position
!
• Salted unlock keys were encrypted to double-down
on security
File
Intro
General PhotoZero Overview
Chunks
PZERO
Chunking
Engine
Chunk
Chunk
Chunk
Chunk
Server
Encryptor
Encryptor
Encryptor
Encryptor
DB
Backgrounding: https://github.com/danveloper/jquery-bqep-plugin
Intro
PhotoZero & How I came to Server-Side
JavaScript!
!
• Client entirely in HTML5 JavaScript
!
• Decorated with JQuery (some good, mostly bad)
!
• Server-side was implemented on the JVM (Grails)
!
• Non-common language between front-end and
back-end didn’t feel right
Intro
Rhino!
!
• Started by Netscape in 1997
!
• Originally designed as Netscape’s (ahem…)
Javagator
!
• Code generation, memory leaks, slow compilation
times
Intro
What is Nashorn?!
!
• The Better-than-Rhino JVM JavaScript Engine
!
• Comes out-of-the-box with Java 8 and above
!
• Replacement for Rhino
Intro
The Need for Nashorn!
!
• JVM is a polyglot platform
!
• Rhino is old
!
• Comparatively, Rhino is quite slow
!
• ECMAScript compliance
Intro
The How of Nashorn!
!
• Truly practical JavaScript on the JVM was not
possible until Java 7
!
• Java 7’s invokeDynamic gives static linking to
dynamic languages (incl. JavaScript)
!
• JVM dynamic languages have runtime support in
method dispatching, without runtime costs
Engine Features
Nashorn Features!
!
• 100% ECMAScript 5.1 compliance
!
• Support for a few extensions
• function expression closures - Mozilla 1.8,
• for-each expressions - Mozilla 1.6,
• Rhino constructor extensions
!
• Powerful CLI (jjs) for building command-line scripts!
Use Cases
Avatar.js and node.jar!
!
• Avatar is a web framework that brings Node-style
syntax and programming to the JVM
!
• Written by Oracle as a code-gen’d bridge to HTML5
apps
!
• Event-driven support for html web server, SSE
spec, websockets
Use Cases
Avatar.js and node.jar!
!
• Respects your Node modules paths, so you can
npm install in the same way
!
• Note: v8 and Nashorn have different ideas about
what the Error class does… I’ve built a “fix”
Use Cases
Java Interoperability!
!
• Java has a great modularity story, and its ability to
compose libraries is a huge value to JavaScript
!
• Java has a long history and has figured out
solutions to a lot of the problems of server-side
development
!
• Nashorn’s dynamic linking brings performance with
interoperability; JavaScript methods can be
seamlessly linked and vice-versa
Use Cases
What has Java Done Right?!
!
• For better or worse: databases and persistence
!
• Threads; we can’t just ignore these things! They’re
useful!
!
• Right Tool For The Job (tm) — JVM languages
!
• Embedded systems
!
• Build systems (Maven, Gradle, SBT, Ant, etc…)
Use Cases
Why Should I Care?!
!
• This platform of interop allows you to use best-of-
breed for the job
!
• Gives you an avenue to refactor existing code to
more sensible JavaScript
!
• Garner all the tooling and monitoring of JMX and
Java instrumentation
Use Cases
Server Side Scripting!
!
• Nashorn ships with a script runner (jjs)
!
• Allows server scripts to be written with JavaScript
!
• Special syntax for falling back to shell, and ability to
capture that output (very Perl-like)
Use Cases
Performance!
!
• Java 8 introduced practical JavaScript on the JVM
!
• Performance & Compliance is at the forefront, but
the former is still not quite there
!
• The near-term roadmap for the JVM brings
performance enhancements to Nashorn
Performance
Performance!
!
• Soon, JavaScript on the JVM will run at near-native
performance levels!
!
• This update will come as part of Java 8u40
The Future
The Future…!
!
• Nashorn will make the JVM a platform for
performant dynamic languages, targeting native-
like performance
!
• Java 8 will continue to improve upon JavaScript’s
server-side performance, and will offer other
languages the same performance

More Related Content

What's hot

9 anti-patterns for node.js teams
9 anti-patterns for node.js teams9 anti-patterns for node.js teams
9 anti-patterns for node.js teamsJeff Harrell
 
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
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJSHüseyin BABAL
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsRob O'Doherty
 
Node.js in a heterogeneous system
Node.js in a heterogeneous systemNode.js in a heterogeneous system
Node.js in a heterogeneous systemGeeksLab Odessa
 
Introduction to Node.js: What, why and how?
Introduction to Node.js: What, why and how?Introduction to Node.js: What, why and how?
Introduction to Node.js: What, why and how?Christian Joudrey
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaNurul Ferdous
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsGary Yeh
 
Webアプリケーションとメモリ
WebアプリケーションとメモリWebアプリケーションとメモリ
WebアプリケーションとメモリMasahiro Nagano
 
Server::Starter meets Java
Server::Starter meets JavaServer::Starter meets Java
Server::Starter meets JavaTokuhiro Matsuno
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
NodeJS ecosystem
NodeJS ecosystemNodeJS ecosystem
NodeJS ecosystemYukti Kaura
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAdler Hsieh
 
Running JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java WorldRunning JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java Worldirbull
 
Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013Oscar Renalias
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ TokopediaQasim Zaidi
 
Lagergren jvmls-2013-final
Lagergren jvmls-2013-finalLagergren jvmls-2013-final
Lagergren jvmls-2013-finalMarcus Lagergren
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Edureka!
 

What's hot (20)

Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
9 anti-patterns for node.js teams
9 anti-patterns for node.js teams9 anti-patterns for node.js teams
9 anti-patterns for node.js teams
 
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
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJS
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node.js in a heterogeneous system
Node.js in a heterogeneous systemNode.js in a heterogeneous system
Node.js in a heterogeneous system
 
Introduction to Node.js: What, why and how?
Introduction to Node.js: What, why and how?Introduction to Node.js: What, why and how?
Introduction to Node.js: What, why and how?
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 
Webアプリケーションとメモリ
WebアプリケーションとメモリWebアプリケーションとメモリ
Webアプリケーションとメモリ
 
Server::Starter meets Java
Server::Starter meets JavaServer::Starter meets Java
Server::Starter meets Java
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node.js for beginner
Node.js for beginnerNode.js for beginner
Node.js for beginner
 
NodeJS ecosystem
NodeJS ecosystemNodeJS ecosystem
NodeJS ecosystem
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
 
Running JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java WorldRunning JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java World
 
Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
 
Lagergren jvmls-2013-final
Lagergren jvmls-2013-finalLagergren jvmls-2013-final
Lagergren jvmls-2013-final
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
 

Viewers also liked

A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9Marcus Lagergren
 
Framtidens ehandel redan idag
Framtidens ehandel redan idagFramtidens ehandel redan idag
Framtidens ehandel redan idagUlrika Schreil
 
9no a 2da version
9no a 2da version9no a 2da version
9no a 2da versionAna María
 
Introducción a la CMNUCC
Introducción a la CMNUCCIntroducción a la CMNUCC
Introducción a la CMNUCCCO2.cr
 
Professional scepticism judgment uia 2
Professional scepticism judgment uia 2Professional scepticism judgment uia 2
Professional scepticism judgment uia 2Nik Hasyudeen
 
Convertible Leasing Guide
Convertible Leasing GuideConvertible Leasing Guide
Convertible Leasing GuideSwapaLease.com
 
Свято 8 Березня в середній групі "Ромашка" ДНЗ № 28 м. Мукачево
Свято 8 Березня в середній групі "Ромашка" ДНЗ № 28 м. МукачевоСвято 8 Березня в середній групі "Ромашка" ДНЗ № 28 м. Мукачево
Свято 8 Березня в середній групі "Ромашка" ДНЗ № 28 м. МукачевоНаталія Бабич
 
Evolucion de la informatica y su aplicacion
Evolucion de la informatica y su aplicacionEvolucion de la informatica y su aplicacion
Evolucion de la informatica y su aplicacionJessy Acosta
 
INTRODUCCIÓN A LA COMUNICACIÓN CIENTIFÍCA
INTRODUCCIÓN A LA COMUNICACIÓN CIENTIFÍCAINTRODUCCIÓN A LA COMUNICACIÓN CIENTIFÍCA
INTRODUCCIÓN A LA COMUNICACIÓN CIENTIFÍCAAdriana Amo
 
Introducción a la Biotecnología. Capítulo 2
Introducción a la Biotecnología. Capítulo 2Introducción a la Biotecnología. Capítulo 2
Introducción a la Biotecnología. Capítulo 2CiberGeneticaUNAM
 
Introducción a la cerámica popular canaria cuadernillo
Introducción a la cerámica popular canaria cuadernilloIntroducción a la cerámica popular canaria cuadernillo
Introducción a la cerámica popular canaria cuadernilloGustavo Rivero Vega
 
Worcester Food & Active Living Policy Council: An Introduction
Worcester Food & Active Living Policy Council: An IntroductionWorcester Food & Active Living Policy Council: An Introduction
Worcester Food & Active Living Policy Council: An Introductionesheehancastro
 
Introducción a la ciencia e ingeniería de los materiales william d. callist...
Introducción a la ciencia e ingeniería de los materiales   william d. callist...Introducción a la ciencia e ingeniería de los materiales   william d. callist...
Introducción a la ciencia e ingeniería de los materiales william d. callist...elkinn
 
8th pre alg -jan22
8th pre alg -jan228th pre alg -jan22
8th pre alg -jan22jdurst65
 
IntroduccióN A La ClíNica PsicolóGica Con NiñOs
IntroduccióN A La ClíNica PsicolóGica  Con  NiñOsIntroduccióN A La ClíNica PsicolóGica  Con  NiñOs
IntroduccióN A La ClíNica PsicolóGica Con NiñOsguesta14865ae
 

Viewers also liked (20)

A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9
 
진큐 오버뷰
진큐 오버뷰진큐 오버뷰
진큐 오버뷰
 
Framtidens ehandel redan idag
Framtidens ehandel redan idagFramtidens ehandel redan idag
Framtidens ehandel redan idag
 
9no a 2da version
9no a 2da version9no a 2da version
9no a 2da version
 
Weekly plannig52012
Weekly plannig52012Weekly plannig52012
Weekly plannig52012
 
Aнглийский сленг (U-Z)
Aнглийский сленг (U-Z)Aнглийский сленг (U-Z)
Aнглийский сленг (U-Z)
 
Introducción a la CMNUCC
Introducción a la CMNUCCIntroducción a la CMNUCC
Introducción a la CMNUCC
 
Professional scepticism judgment uia 2
Professional scepticism judgment uia 2Professional scepticism judgment uia 2
Professional scepticism judgment uia 2
 
Convertible Leasing Guide
Convertible Leasing GuideConvertible Leasing Guide
Convertible Leasing Guide
 
Свято 8 Березня в середній групі "Ромашка" ДНЗ № 28 м. Мукачево
Свято 8 Березня в середній групі "Ромашка" ДНЗ № 28 м. МукачевоСвято 8 Березня в середній групі "Ромашка" ДНЗ № 28 м. Мукачево
Свято 8 Березня в середній групі "Ромашка" ДНЗ № 28 м. Мукачево
 
Evolucion de la informatica y su aplicacion
Evolucion de la informatica y su aplicacionEvolucion de la informatica y su aplicacion
Evolucion de la informatica y su aplicacion
 
INTRODUCCIÓN A LA COMUNICACIÓN CIENTIFÍCA
INTRODUCCIÓN A LA COMUNICACIÓN CIENTIFÍCAINTRODUCCIÓN A LA COMUNICACIÓN CIENTIFÍCA
INTRODUCCIÓN A LA COMUNICACIÓN CIENTIFÍCA
 
Introducción a la Biotecnología. Capítulo 2
Introducción a la Biotecnología. Capítulo 2Introducción a la Biotecnología. Capítulo 2
Introducción a la Biotecnología. Capítulo 2
 
Introducción a la cerámica popular canaria cuadernillo
Introducción a la cerámica popular canaria cuadernilloIntroducción a la cerámica popular canaria cuadernillo
Introducción a la cerámica popular canaria cuadernillo
 
Worcester Food & Active Living Policy Council: An Introduction
Worcester Food & Active Living Policy Council: An IntroductionWorcester Food & Active Living Policy Council: An Introduction
Worcester Food & Active Living Policy Council: An Introduction
 
Guitar 5th grade
Guitar 5th gradeGuitar 5th grade
Guitar 5th grade
 
Introducción a la ciencia e ingeniería de los materiales william d. callist...
Introducción a la ciencia e ingeniería de los materiales   william d. callist...Introducción a la ciencia e ingeniería de los materiales   william d. callist...
Introducción a la ciencia e ingeniería de los materiales william d. callist...
 
8th pre alg -jan22
8th pre alg -jan228th pre alg -jan22
8th pre alg -jan22
 
IntroduccióN A La ClíNica PsicolóGica Con NiñOs
IntroduccióN A La ClíNica PsicolóGica  Con  NiñOsIntroduccióN A La ClíNica PsicolóGica  Con  NiñOs
IntroduccióN A La ClíNica PsicolóGica Con NiñOs
 
Innovation in digital schools Gess Dubai 2013
Innovation in digital schools Gess Dubai 2013Innovation in digital schools Gess Dubai 2013
Innovation in digital schools Gess Dubai 2013
 

Similar to Server-Side JavaScript with Nashorn

T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJSTim Sommer
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteChristian Heilmann
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matterTomas Doran
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)daylerees
 
The JavaScript Delusion
The JavaScript DelusionThe JavaScript Delusion
The JavaScript DelusionJUGBD
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptSpike Brehm
 
Usersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap
 
Continuous Delivery with NetflixOSS
Continuous Delivery with NetflixOSSContinuous Delivery with NetflixOSS
Continuous Delivery with NetflixOSSDaniel Woods
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)Barm Bannasan
 
JavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxJavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxGennady Feldman
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesAlfresco Software
 
Let’s learn how to use JavaScript responsibly and stay up-to-date.
Let’s learn how to use JavaScript responsibly and stay up-to-date. Let’s learn how to use JavaScript responsibly and stay up-to-date.
Let’s learn how to use JavaScript responsibly and stay up-to-date. Christian Heilmann
 

Similar to Server-Side JavaScript with Nashorn (20)

T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynote
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matter
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
 
The JavaScript Delusion
The JavaScript DelusionThe JavaScript Delusion
The JavaScript Delusion
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScript
 
Usersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJS
 
Continuous Delivery with NetflixOSS
Continuous Delivery with NetflixOSSContinuous Delivery with NetflixOSS
Continuous Delivery with NetflixOSS
 
Java (1)
Java (1)Java (1)
Java (1)
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)
 
JavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxJavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefox
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best Practices
 
Let’s learn how to use JavaScript responsibly and stay up-to-date.
Let’s learn how to use JavaScript responsibly and stay up-to-date. Let’s learn how to use JavaScript responsibly and stay up-to-date.
Let’s learn how to use JavaScript responsibly and stay up-to-date.
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
 
Core Java
Core JavaCore Java
Core Java
 
Curso de Programación Java Intermedio
Curso de Programación Java IntermedioCurso de Programación Java Intermedio
Curso de Programación Java Intermedio
 
java completed units.docx
java completed units.docxjava completed units.docx
java completed units.docx
 
java full 1.docx
java full 1.docxjava full 1.docx
java full 1.docx
 
java full.docx
java full.docxjava full.docx
java full.docx
 
Node.js primer
Node.js primerNode.js primer
Node.js primer
 

More from Daniel Woods

Continuous Delivery with Spinnaker and OpenStack
Continuous Delivery with Spinnaker and OpenStackContinuous Delivery with Spinnaker and OpenStack
Continuous Delivery with Spinnaker and OpenStackDaniel Woods
 
High Performance Microservices with Ratpack and Spring Boot
High Performance Microservices with Ratpack and Spring BootHigh Performance Microservices with Ratpack and Spring Boot
High Performance Microservices with Ratpack and Spring BootDaniel Woods
 
Groovy in the Cloud
Groovy in the CloudGroovy in the Cloud
Groovy in the CloudDaniel Woods
 
Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Daniel Woods
 
Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web FrameworkDaniel Woods
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right WayDaniel Woods
 
Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web FrameworkDaniel Woods
 
Facilitating Continuous Delivery at Scale
Facilitating Continuous Delivery at ScaleFacilitating Continuous Delivery at Scale
Facilitating Continuous Delivery at ScaleDaniel Woods
 
Groovy for System Administrators
Groovy for System AdministratorsGroovy for System Administrators
Groovy for System AdministratorsDaniel Woods
 
Message Driven Architecture in Grails
Message Driven Architecture in GrailsMessage Driven Architecture in Grails
Message Driven Architecture in GrailsDaniel Woods
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in RatpackDaniel Woods
 
Gainesville Web Developer Group, Sept 2012
Gainesville Web Developer Group, Sept 2012Gainesville Web Developer Group, Sept 2012
Gainesville Web Developer Group, Sept 2012Daniel Woods
 

More from Daniel Woods (13)

Continuous Delivery with Spinnaker and OpenStack
Continuous Delivery with Spinnaker and OpenStackContinuous Delivery with Spinnaker and OpenStack
Continuous Delivery with Spinnaker and OpenStack
 
High Performance Microservices with Ratpack and Spring Boot
High Performance Microservices with Ratpack and Spring BootHigh Performance Microservices with Ratpack and Spring Boot
High Performance Microservices with Ratpack and Spring Boot
 
Groovy in the Cloud
Groovy in the CloudGroovy in the Cloud
Groovy in the Cloud
 
Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015
 
Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web Framework
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right Way
 
Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web Framework
 
Facilitating Continuous Delivery at Scale
Facilitating Continuous Delivery at ScaleFacilitating Continuous Delivery at Scale
Facilitating Continuous Delivery at Scale
 
Future of Grails
Future of GrailsFuture of Grails
Future of Grails
 
Groovy for System Administrators
Groovy for System AdministratorsGroovy for System Administrators
Groovy for System Administrators
 
Message Driven Architecture in Grails
Message Driven Architecture in GrailsMessage Driven Architecture in Grails
Message Driven Architecture in Grails
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in Ratpack
 
Gainesville Web Developer Group, Sept 2012
Gainesville Web Developer Group, Sept 2012Gainesville Web Developer Group, Sept 2012
Gainesville Web Developer Group, Sept 2012
 

Recently uploaded

Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...sonatiwari757
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 

Recently uploaded (20)

Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 

Server-Side JavaScript with Nashorn

  • 2. About Me Author for InfoQ /danveloper danielpwoods@gmail.com
  • 3. Intro My Experiences with PhotoZero! ! • A client-side file encryption service ! • Allowed clients to security unlock files/photos with confidence ! • Server never knew about the content or password that a user was uploading, only its chunks in the position ! • Salted unlock keys were encrypted to double-down on security
  • 5. Intro PhotoZero & How I came to Server-Side JavaScript! ! • Client entirely in HTML5 JavaScript ! • Decorated with JQuery (some good, mostly bad) ! • Server-side was implemented on the JVM (Grails) ! • Non-common language between front-end and back-end didn’t feel right
  • 6. Intro Rhino! ! • Started by Netscape in 1997 ! • Originally designed as Netscape’s (ahem…) Javagator ! • Code generation, memory leaks, slow compilation times
  • 7. Intro What is Nashorn?! ! • The Better-than-Rhino JVM JavaScript Engine ! • Comes out-of-the-box with Java 8 and above ! • Replacement for Rhino
  • 8. Intro The Need for Nashorn! ! • JVM is a polyglot platform ! • Rhino is old ! • Comparatively, Rhino is quite slow ! • ECMAScript compliance
  • 9. Intro The How of Nashorn! ! • Truly practical JavaScript on the JVM was not possible until Java 7 ! • Java 7’s invokeDynamic gives static linking to dynamic languages (incl. JavaScript) ! • JVM dynamic languages have runtime support in method dispatching, without runtime costs
  • 10. Engine Features Nashorn Features! ! • 100% ECMAScript 5.1 compliance ! • Support for a few extensions • function expression closures - Mozilla 1.8, • for-each expressions - Mozilla 1.6, • Rhino constructor extensions ! • Powerful CLI (jjs) for building command-line scripts!
  • 11. Use Cases Avatar.js and node.jar! ! • Avatar is a web framework that brings Node-style syntax and programming to the JVM ! • Written by Oracle as a code-gen’d bridge to HTML5 apps ! • Event-driven support for html web server, SSE spec, websockets
  • 12. Use Cases Avatar.js and node.jar! ! • Respects your Node modules paths, so you can npm install in the same way ! • Note: v8 and Nashorn have different ideas about what the Error class does… I’ve built a “fix”
  • 13. Use Cases Java Interoperability! ! • Java has a great modularity story, and its ability to compose libraries is a huge value to JavaScript ! • Java has a long history and has figured out solutions to a lot of the problems of server-side development ! • Nashorn’s dynamic linking brings performance with interoperability; JavaScript methods can be seamlessly linked and vice-versa
  • 14. Use Cases What has Java Done Right?! ! • For better or worse: databases and persistence ! • Threads; we can’t just ignore these things! They’re useful! ! • Right Tool For The Job (tm) — JVM languages ! • Embedded systems ! • Build systems (Maven, Gradle, SBT, Ant, etc…)
  • 15. Use Cases Why Should I Care?! ! • This platform of interop allows you to use best-of- breed for the job ! • Gives you an avenue to refactor existing code to more sensible JavaScript ! • Garner all the tooling and monitoring of JMX and Java instrumentation
  • 16. Use Cases Server Side Scripting! ! • Nashorn ships with a script runner (jjs) ! • Allows server scripts to be written with JavaScript ! • Special syntax for falling back to shell, and ability to capture that output (very Perl-like)
  • 17. Use Cases Performance! ! • Java 8 introduced practical JavaScript on the JVM ! • Performance & Compliance is at the forefront, but the former is still not quite there ! • The near-term roadmap for the JVM brings performance enhancements to Nashorn
  • 18. Performance Performance! ! • Soon, JavaScript on the JVM will run at near-native performance levels! ! • This update will come as part of Java 8u40
  • 19. The Future The Future…! ! • Nashorn will make the JVM a platform for performant dynamic languages, targeting native- like performance ! • Java 8 will continue to improve upon JavaScript’s server-side performance, and will offer other languages the same performance