SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Java 8 JavaScript Nashorn
@MiroslavResetar, Javantura, 22.2.2014.
JavaScript na Javanturi?
•

Alfresco
•

•

CMIS API implementiran u JavaScriptu

Neo4J
•

„people love to use Neo4j from Node.js and the browser”

•

Sencha Touch, Ext.Js, D3.js,

•

JavaFX
•

•

Dart
•

•

„writing JavaFX scripts in Nashorn is very easy”

transkompajlira se u JavaScript!

Vert.x
•

JavaScript API
Popularnost JavaScripta?
• Redmonk, siječanj 2014.
• Github repozitoriji vs Stack Overflow

1.

JavaScript (+1)

2. Java (-1)
3. PHP
4. C# (+2)
5. Python (-1)
JVM polyglot programming
• Clojure, Scala, JRuby, Jython, Rhino (JavaScript)
• Zašto JVM?
• Jer je zakon
• GC, Threads, Java API, ogromna količina biblioteka, puno
platformi

• JVM – najbolji dio Jave 
Rhino
• Rhino – Java implementacija JavaScripta
• 1997 – Netscape započeo rad na Rhino-u

• 1998 – Rhino je predan Mozilli i open source-an
• 2006 – Java 6 pakira Rhino kao standardnu
implementaciju skriptnog jezika
Problemi sa Rhino-om
• Rhino je veoma spor u usporedbi sa ostalim JavaScript
engine-ima (browserima)
• Velika potrošnja memorije
• Veoma stari codebase (iz Java 1.1 vremena)
• Kako bi se „popravio” bio je potreban veliki rewrite,
odluka je bila krenuti iz početka
Nashorn
• Potpuno nova implementacija JavaScripta
• Kompajlirani kod a ne interpreter

• Dolazi standardno sa JDK-om 8
• 5 x manji footprint
• 20 x bolje performanse (otprilike )
Rhino vs Nashorn
Nashorn vs Groovy
InvokeDynamic
• A First Taste of InvokeDynamic
• „... static nature of Java is in the language itself (and not the
JVM)”
• „Every invocation has to be called against a known type.”
• „we must generate hundreds of tiny methods into tiny
classes with everything neatly tied up in a bow so the JVM
will pretty please perform that invocation for us as quickly
as possible”
•

„java.lang.OutOfMemoryError:

PermGen space”

• „InvokeDynamic ... the ability to make a dynamic call that
the JVM not only recognizes, but also optimizes in the same
way it optimizes plain old static-typed calls.”
•

MethodHandle happyTimeHandle = MethodHandles.findVirtual(Happy.class,
"happyTime", void.class, String.class);
Kako do Nashorn-a?
• JSR 223 – javax.script (Java 6, 12/2006)
Nashorn smoke test
QUnit
• „QUnit is a powerful, easy-to-use JavaScript unit testing

framework.”

• Dohvati engine, učitaj QUnit, setupiraj ga, pokreni test
{{Mustache}}
• „Mustache is a logic-less template syntax. It can be used for HTML,

config files, source code - anything. It works by expanding tags in a
template using values provided in a hash or object.”
Shell scripting: JJS
• Curl -> Regex -> Curl -> Play Audio
Što Nashor nije
• Nije DOM/CSS okruženje
• Ne podržava korištenje biblioteka kao što su JQuery, Dojo,
Ext. (out-of-the-box)

• Nema browser plugin API
• Nije embeddable u browser

• Ne podržava ne standardizirane feature JavaScripta
• Nije multithreaded safe
• generalno nije problem ukoliko se izbjegava globalni scope
• loadWithNewGlobal creates a fresh global before loading
the script
„Meet the team”
Jim Laskey odgovara
• Postoji li debugger za Nashorn?
• Debuger je integriran u Netbeans 8 (beta).
• Eclipse još nema debugger za Nashorn.

• Da li radite još na poboljšanju performansi?
• Da. Veliki trud se ulaže kako bi performanse bile još bolje sa
verzijom 8u20. Verzija se očekuje na jesen. Za sada su brojke
obećavajuće.

• Što se događa sa Node.jar projektom?
• Preimenovan u Avatar.js. StrongLoop ulažu ogroman trud ne
bi li podržali projekt. Trenutne performanse su bolje od
Node.js. Bit će još bolje sa verzijom 8u20.
Project Avatar i Avatar.js
• „Avatar.js is a project to bring the node programming model,
APIs and module ecosystem to the Java platform.”
• „Avatar.js applications are both asynchronous and singlethreaded (exactly as in Node.js).”
• „Avatar - JavaScript services layer...rich client side framework
that assumes very minor JavaScript knowledge.”
Želite znati više?
• Jim Laskey - Nashorn, JavaScript for the JVM
• http://www.youtube.com/watch?v=I6eo2KPsk7U

• Attila Szegedi - The Curious Case of JavaScript on the JVM
(http://vimeo.com/78890890)
• Oracle Java Magazine Jan/Feb 2014 – Oracle Nashorn
• http://julien.ponge.org/blog/nashorn-article-in-oraclejavamagazine-jan-feb-2014/
Pitanja?
Reference
• Kod - https://github.com/mresetar/javantura-nashorn
• JUnit benchmarks - http://labs.carrotsearch.com/junitbenchmarks-tutorial.html
• Nashorn JavaFx debugger https://github.com/wickund/nashornexamples/

• Spring boot sample project
• Rhino QUnit setup
• VoiceRSS service

Weitere ähnliche Inhalte

Was ist angesagt?

CubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyCubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyPatrick Steele-Idem
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Arun Gupta
 
Bringing Interactivity to Your Drupal Site with Node.js Integration
Bringing Interactivity to Your Drupal Site with Node.js IntegrationBringing Interactivity to Your Drupal Site with Node.js Integration
Bringing Interactivity to Your Drupal Site with Node.js IntegrationAcquia
 
Javantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornJavantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornMiroslav Resetar
 
Glass fish performance tuning tips from the field
Glass fish performance tuning tips from the fieldGlass fish performance tuning tips from the field
Glass fish performance tuning tips from the fieldPayara
 
Scaling down CouchDB - Meet TouchDB
Scaling down CouchDB - Meet TouchDBScaling down CouchDB - Meet TouchDB
Scaling down CouchDB - Meet TouchDBStefan Baggström
 
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
 
Node.js Performance Case Study
Node.js Performance Case StudyNode.js Performance Case Study
Node.js Performance Case StudyFabian Frank
 
CQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and DeploymentCQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and Deploymentklcodanr
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business HeadsYash Mody
 
Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3Nuxeo
 
미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기jbugkorea
 
Javascript fatigue, 자바스크립트 피로
Javascript fatigue, 자바스크립트 피로Javascript fatigue, 자바스크립트 피로
Javascript fatigue, 자바스크립트 피로Rhio Kim
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!_Dewy_
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Ganesh Kondal
 
Eureka Moment UKLUG
Eureka Moment UKLUGEureka Moment UKLUG
Eureka Moment UKLUGPaul Withers
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"IT Event
 

Was ist angesagt? (20)

CubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyCubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption Journey
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 
Node.js architecture (EN)
Node.js architecture (EN)Node.js architecture (EN)
Node.js architecture (EN)
 
Bringing Interactivity to Your Drupal Site with Node.js Integration
Bringing Interactivity to Your Drupal Site with Node.js IntegrationBringing Interactivity to Your Drupal Site with Node.js Integration
Bringing Interactivity to Your Drupal Site with Node.js Integration
 
Javantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornJavantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript Nashorn
 
Glass fish performance tuning tips from the field
Glass fish performance tuning tips from the fieldGlass fish performance tuning tips from the field
Glass fish performance tuning tips from the field
 
Scaling down CouchDB - Meet TouchDB
Scaling down CouchDB - Meet TouchDBScaling down CouchDB - Meet TouchDB
Scaling down CouchDB - Meet TouchDB
 
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
 
Node.js Performance Case Study
Node.js Performance Case StudyNode.js Performance Case Study
Node.js Performance Case Study
 
CQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and DeploymentCQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and Deployment
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business Heads
 
Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3
 
미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기
 
Javascript fatigue, 자바스크립트 피로
Javascript fatigue, 자바스크립트 피로Javascript fatigue, 자바스크립트 피로
Javascript fatigue, 자바스크립트 피로
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
Eureka Moment UKLUG
Eureka Moment UKLUGEureka Moment UKLUG
Eureka Moment UKLUG
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Let's server your Data
Let's server your DataLet's server your Data
Let's server your Data
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
 

Andere mochten auch

Nemanja Čedomirović - PHP Srbija
Nemanja Čedomirović - PHP SrbijaNemanja Čedomirović - PHP Srbija
Nemanja Čedomirović - PHP SrbijaWebDan
 

Andere mochten auch (10)

Javantura Zagreb 2014 - Sencha Touch - Denis Jajčević
Javantura Zagreb 2014 - Sencha Touch - Denis JajčevićJavantura Zagreb 2014 - Sencha Touch - Denis Jajčević
Javantura Zagreb 2014 - Sencha Touch - Denis Jajčević
 
Javantura Zagreb 2014 - Alfresco-Neo4j integracija - Damir Murat
Javantura Zagreb 2014 - Alfresco-Neo4j integracija - Damir MuratJavantura Zagreb 2014 - Alfresco-Neo4j integracija - Damir Murat
Javantura Zagreb 2014 - Alfresco-Neo4j integracija - Damir Murat
 
Javantura Zagreb 2014 - WildFly 8 - Tomaž Cerar
Javantura Zagreb 2014 - WildFly 8 - Tomaž CerarJavantura Zagreb 2014 - WildFly 8 - Tomaž Cerar
Javantura Zagreb 2014 - WildFly 8 - Tomaž Cerar
 
Javantura Zagreb 2014 - universAAL - Andrej Grgurić
Javantura Zagreb 2014 - universAAL - Andrej GrgurićJavantura Zagreb 2014 - universAAL - Andrej Grgurić
Javantura Zagreb 2014 - universAAL - Andrej Grgurić
 
Javantura Zagreb 2014 - Groovy-SQL - Dinko Srkoč
Javantura Zagreb 2014 - Groovy-SQL - Dinko SrkočJavantura Zagreb 2014 - Groovy-SQL - Dinko Srkoč
Javantura Zagreb 2014 - Groovy-SQL - Dinko Srkoč
 
Javantura Zagreb 2014 - Vert.x 1.3 - Mihovil Rister
Javantura Zagreb 2014 - Vert.x 1.3 - Mihovil RisterJavantura Zagreb 2014 - Vert.x 1.3 - Mihovil Rister
Javantura Zagreb 2014 - Vert.x 1.3 - Mihovil Rister
 
HUJAK skupština 2014
HUJAK skupština 2014HUJAK skupština 2014
HUJAK skupština 2014
 
Javantura Zagreb 2014 - Google Dart - Željko Kunica
Javantura Zagreb 2014 - Google Dart - Željko KunicaJavantura Zagreb 2014 - Google Dart - Željko Kunica
Javantura Zagreb 2014 - Google Dart - Željko Kunica
 
Javantura Zagreb 2014 - Java na klijenstskoj strani - Ivan Vučak
Javantura Zagreb 2014 - Java na klijenstskoj strani - Ivan VučakJavantura Zagreb 2014 - Java na klijenstskoj strani - Ivan Vučak
Javantura Zagreb 2014 - Java na klijenstskoj strani - Ivan Vučak
 
Nemanja Čedomirović - PHP Srbija
Nemanja Čedomirović - PHP SrbijaNemanja Čedomirović - PHP Srbija
Nemanja Čedomirović - PHP Srbija
 

Ähnlich wie Javantura Zagreb 2014 - Nashorn - Miroslav Rešetar

Introduction to Napa.js
Introduction to Napa.jsIntroduction to Napa.js
Introduction to Napa.jsDaiyi Peng
 
Java 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
Java 8: Nashorn & avatar.js di Enrico Risa al JUG RomaJava 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
Java 8: Nashorn & avatar.js di Enrico Risa al JUG RomaVitalij Zadneprovskij
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJSTim Sommer
 
JRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyJRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyEvgeny Rahman
 
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
 
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-finalMarcus Lagergren
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesAlexandra Masterson
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby.toster
 
JavaScript: Past, Present, Future
JavaScript: Past, Present, FutureJavaScript: Past, Present, Future
JavaScript: Past, Present, FutureJungryul Choi
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript ProgrammingYoshiki Shibukawa
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tourq3boy
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentationasync_io
 
Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019Jamie Coleman
 

Ähnlich wie Javantura Zagreb 2014 - Nashorn - Miroslav Rešetar (20)

Introduction to Napa.js
Introduction to Napa.jsIntroduction to Napa.js
Introduction to Napa.js
 
Java 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
Java 8: Nashorn & avatar.js di Enrico Risa al JUG RomaJava 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
Java 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
 
JRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyJRuby - The Best of Java and Ruby
JRuby - The Best of Java and Ruby
 
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
 
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-final
 
Nashorn
NashornNashorn
Nashorn
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby
 
Jax keynote
Jax keynoteJax keynote
Jax keynote
 
Java (1)
Java (1)Java (1)
Java (1)
 
JavaScript: Past, Present, Future
JavaScript: Past, Present, FutureJavaScript: Past, Present, Future
JavaScript: Past, Present, Future
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript Programming
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
GraalVM
GraalVMGraalVM
GraalVM
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
 
Peru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVMPeru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVM
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019
 

Mehr von HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association

Mehr von HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association (20)

Java cro'21 the best tools for java developers in 2021 - hujak
Java cro'21   the best tools for java developers in 2021 - hujakJava cro'21   the best tools for java developers in 2021 - hujak
Java cro'21 the best tools for java developers in 2021 - hujak
 
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
JavaCro'21 - Java is Here To Stay - HUJAK KeynoteJavaCro'21 - Java is Here To Stay - HUJAK Keynote
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
 
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan LozićJavantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
 
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
 
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
 
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
 
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander RadovanJavantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
 
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
 
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
 
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
 
Javantura v6 - When remote work really works - the secrets behind successful ...
Javantura v6 - When remote work really works - the secrets behind successful ...Javantura v6 - When remote work really works - the secrets behind successful ...
Javantura v6 - When remote work really works - the secrets behind successful ...
 
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
Javantura v6 - Kotlin-Java Interop - Matej VidakovićJavantura v6 - Kotlin-Java Interop - Matej Vidaković
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
 
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
 
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
 
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
 
Javantura v6 - How can you improve the quality of your application - Ioannis ...
Javantura v6 - How can you improve the quality of your application - Ioannis ...Javantura v6 - How can you improve the quality of your application - Ioannis ...
Javantura v6 - How can you improve the quality of your application - Ioannis ...
 
Javantura v6 - Just say it v2 - Pavao Varela Petrac
Javantura v6 - Just say it v2 - Pavao Varela PetracJavantura v6 - Just say it v2 - Pavao Varela Petrac
Javantura v6 - Just say it v2 - Pavao Varela Petrac
 
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
Javantura v6 - Automation of web apps testing - Hrvoje RuhekJavantura v6 - Automation of web apps testing - Hrvoje Ruhek
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
 
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
 
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
Javantura v6 - Building IoT Middleware with Microservices - Mario KusekJavantura v6 - Building IoT Middleware with Microservices - Mario Kusek
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
 

Kürzlich hochgeladen

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Javantura Zagreb 2014 - Nashorn - Miroslav Rešetar

  • 1. Java 8 JavaScript Nashorn @MiroslavResetar, Javantura, 22.2.2014.
  • 2. JavaScript na Javanturi? • Alfresco • • CMIS API implementiran u JavaScriptu Neo4J • „people love to use Neo4j from Node.js and the browser” • Sencha Touch, Ext.Js, D3.js, • JavaFX • • Dart • • „writing JavaFX scripts in Nashorn is very easy” transkompajlira se u JavaScript! Vert.x • JavaScript API
  • 3. Popularnost JavaScripta? • Redmonk, siječanj 2014. • Github repozitoriji vs Stack Overflow 1. JavaScript (+1) 2. Java (-1) 3. PHP 4. C# (+2) 5. Python (-1)
  • 4. JVM polyglot programming • Clojure, Scala, JRuby, Jython, Rhino (JavaScript) • Zašto JVM? • Jer je zakon • GC, Threads, Java API, ogromna količina biblioteka, puno platformi • JVM – najbolji dio Jave 
  • 5. Rhino • Rhino – Java implementacija JavaScripta • 1997 – Netscape započeo rad na Rhino-u • 1998 – Rhino je predan Mozilli i open source-an • 2006 – Java 6 pakira Rhino kao standardnu implementaciju skriptnog jezika
  • 6. Problemi sa Rhino-om • Rhino je veoma spor u usporedbi sa ostalim JavaScript engine-ima (browserima) • Velika potrošnja memorije • Veoma stari codebase (iz Java 1.1 vremena) • Kako bi se „popravio” bio je potreban veliki rewrite, odluka je bila krenuti iz početka
  • 7. Nashorn • Potpuno nova implementacija JavaScripta • Kompajlirani kod a ne interpreter • Dolazi standardno sa JDK-om 8 • 5 x manji footprint • 20 x bolje performanse (otprilike )
  • 10. InvokeDynamic • A First Taste of InvokeDynamic • „... static nature of Java is in the language itself (and not the JVM)” • „Every invocation has to be called against a known type.” • „we must generate hundreds of tiny methods into tiny classes with everything neatly tied up in a bow so the JVM will pretty please perform that invocation for us as quickly as possible” • „java.lang.OutOfMemoryError: PermGen space” • „InvokeDynamic ... the ability to make a dynamic call that the JVM not only recognizes, but also optimizes in the same way it optimizes plain old static-typed calls.” • MethodHandle happyTimeHandle = MethodHandles.findVirtual(Happy.class, "happyTime", void.class, String.class);
  • 11. Kako do Nashorn-a? • JSR 223 – javax.script (Java 6, 12/2006)
  • 13. QUnit • „QUnit is a powerful, easy-to-use JavaScript unit testing framework.” • Dohvati engine, učitaj QUnit, setupiraj ga, pokreni test
  • 14. {{Mustache}} • „Mustache is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object.”
  • 15. Shell scripting: JJS • Curl -> Regex -> Curl -> Play Audio
  • 16. Što Nashor nije • Nije DOM/CSS okruženje • Ne podržava korištenje biblioteka kao što su JQuery, Dojo, Ext. (out-of-the-box) • Nema browser plugin API • Nije embeddable u browser • Ne podržava ne standardizirane feature JavaScripta • Nije multithreaded safe • generalno nije problem ukoliko se izbjegava globalni scope • loadWithNewGlobal creates a fresh global before loading the script
  • 18. Jim Laskey odgovara • Postoji li debugger za Nashorn? • Debuger je integriran u Netbeans 8 (beta). • Eclipse još nema debugger za Nashorn. • Da li radite još na poboljšanju performansi? • Da. Veliki trud se ulaže kako bi performanse bile još bolje sa verzijom 8u20. Verzija se očekuje na jesen. Za sada su brojke obećavajuće. • Što se događa sa Node.jar projektom? • Preimenovan u Avatar.js. StrongLoop ulažu ogroman trud ne bi li podržali projekt. Trenutne performanse su bolje od Node.js. Bit će još bolje sa verzijom 8u20.
  • 19. Project Avatar i Avatar.js • „Avatar.js is a project to bring the node programming model, APIs and module ecosystem to the Java platform.” • „Avatar.js applications are both asynchronous and singlethreaded (exactly as in Node.js).” • „Avatar - JavaScript services layer...rich client side framework that assumes very minor JavaScript knowledge.”
  • 20. Želite znati više? • Jim Laskey - Nashorn, JavaScript for the JVM • http://www.youtube.com/watch?v=I6eo2KPsk7U • Attila Szegedi - The Curious Case of JavaScript on the JVM (http://vimeo.com/78890890) • Oracle Java Magazine Jan/Feb 2014 – Oracle Nashorn • http://julien.ponge.org/blog/nashorn-article-in-oraclejavamagazine-jan-feb-2014/
  • 22. Reference • Kod - https://github.com/mresetar/javantura-nashorn • JUnit benchmarks - http://labs.carrotsearch.com/junitbenchmarks-tutorial.html • Nashorn JavaFx debugger https://github.com/wickund/nashornexamples/ • Spring boot sample project • Rhino QUnit setup • VoiceRSS service