際際滷

際際滷Share a Scribd company logo
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, sijeanj 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 koliina biblioteka, puno
platformi

 JVM  najbolji dio Jave
Rhino
 Rhino  Java implementacija JavaScripta
 1997  Netscape zapoeo 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 poetka
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, uitaj 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 oekuje na jesen. Za sada su brojke
obeavajue.

 to se dogaa 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

More Related Content

What's hot (20)

Nashorn
NashornNashorn
Nashorn
Rory Preddy
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
Jibanananda Sana
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
Chris Cowan
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
Tim Sommer
Node.js tutoria for beginner
Node.js tutoria for beginnerNode.js tutoria for beginner
Node.js tutoria for beginner
Maninder Singh
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
Nurul Ferdous
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Rob O'Doherty
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
irbull
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
Node.js: Whats the Big Deal? Presented and JS Meetup ChicagoNode.js: Whats the Big Deal? Presented and JS Meetup Chicago
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
Aziz Ali
Intro to nodejs
Intro to nodejsIntro to nodejs
Intro to nodejs
Abhinav Dhasmana
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
JITENDRA KUMAR PATEL
Migrate to JRuby
Migrate to JRubyMigrate to JRuby
Migrate to JRuby
Ian Yang
Running Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic BeanstalkRunning Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic Beanstalk
zupzup.org
NodeJS
NodeJSNodeJS
NodeJS
Predhin Sapru
Understanding the Single Thread Event Loop
Understanding the Single Thread Event LoopUnderstanding the Single Thread Event Loop
Understanding the Single Thread Event Loop
TorontoNodeJS
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Arun Kumar Arjunan
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!
Scripting with NodeJS
Scripting with NodeJSScripting with NodeJS
Scripting with NodeJS
Ben Pearson
Why JRuby?
Why JRuby?Why JRuby?
Why JRuby?
Fiona Tay
Nodejs
NodejsNodejs
Nodejs
Akhil Gopan
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
Jibanananda Sana
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
Chris Cowan
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
Tim Sommer
Node.js tutoria for beginner
Node.js tutoria for beginnerNode.js tutoria for beginner
Node.js tutoria for beginner
Maninder Singh
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
Nurul Ferdous
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Rob O'Doherty
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
irbull
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
Node.js: Whats the Big Deal? Presented and JS Meetup ChicagoNode.js: Whats the Big Deal? Presented and JS Meetup Chicago
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
Aziz Ali
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
JITENDRA KUMAR PATEL
Migrate to JRuby
Migrate to JRubyMigrate to JRuby
Migrate to JRuby
Ian Yang
Running Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic BeanstalkRunning Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic Beanstalk
zupzup.org
Understanding the Single Thread Event Loop
Understanding the Single Thread Event LoopUnderstanding the Single Thread Event Loop
Understanding the Single Thread Event Loop
TorontoNodeJS
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!
Scripting with NodeJS
Scripting with NodeJSScripting with NodeJS
Scripting with NodeJS
Ben Pearson
Why JRuby?
Why JRuby?Why JRuby?
Why JRuby?
Fiona Tay

Similar to Javantura 2014 - Java 8 JavaScript Nashorn (20)

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
Vitalij Zadneprovskij
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
Evgeny Rahman
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-final
Marcus Lagergren
GOTO Night with Charles Nutter 際際滷s
GOTO Night with Charles Nutter 際際滷sGOTO Night with Charles Nutter 際際滷s
GOTO Night with Charles Nutter 際際滷s
Alexandra Masterson
舒从亳从亳 仗亳仄亠仆亠仆亳 JRuby
舒从亳从亳 仗亳仄亠仆亠仆亳 JRuby舒从亳从亳 仗亳仄亠仆亠仆亳 JRuby
舒从亳从亳 仗亳仄亠仆亠仆亳 JRuby
.toster
Jax keynote
Jax keynoteJax keynote
Jax keynote
Marcus Lagergren
Java (1)
Java (1)Java (1)
Java (1)
Samraiz Tejani
JavaScript: Past, Present, Future
JavaScript: Past, Present, FutureJavaScript: Past, Present, Future
JavaScript: Past, Present, Future
Jungryul Choi
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript Programming
Yoshiki 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 Tour
q3boy
GraalVM
GraalVMGraalVM
GraalVM
Manfredi Giordano
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
async_io
Peru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVMPeru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVM
Domingo Suarez Torres
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
Thomas Hunter II
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
Jamie Coleman
Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013
Oscar Renalias
Node.js #digpen presentation
Node.js #digpen presentationNode.js #digpen presentation
Node.js #digpen presentation
GOSS Interactive
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin Programming
Atlassian
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
ajuckel
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
Vitalij Zadneprovskij
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
Evgeny Rahman
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-final
Marcus Lagergren
GOTO Night with Charles Nutter 際際滷s
GOTO Night with Charles Nutter 際際滷sGOTO Night with Charles Nutter 際際滷s
GOTO Night with Charles Nutter 際際滷s
Alexandra Masterson
舒从亳从亳 仗亳仄亠仆亠仆亳 JRuby
舒从亳从亳 仗亳仄亠仆亠仆亳 JRuby舒从亳从亳 仗亳仄亠仆亠仆亳 JRuby
舒从亳从亳 仗亳仄亠仆亠仆亳 JRuby
.toster
JavaScript: Past, Present, Future
JavaScript: Past, Present, FutureJavaScript: Past, Present, Future
JavaScript: Past, Present, Future
Jungryul Choi
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript Programming
Yoshiki 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 Tour
q3boy
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
async_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 JavaCro2019
Jamie Coleman
Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013
Oscar Renalias
Node.js #digpen presentation
Node.js #digpen presentationNode.js #digpen presentation
Node.js #digpen presentation
GOSS Interactive
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin Programming
Atlassian
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
ajuckel

Recently uploaded (20)

Transform Your Future with Front-End Development Training
Transform Your Future with Front-End Development TrainingTransform Your Future with Front-End Development Training
Transform Your Future with Front-End Development Training
Vtechlabs
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOTSMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
TanmaiArni
Unlock AI Creativity: Image Generation with DALL揃E
Unlock AI Creativity: Image Generation with DALL揃EUnlock AI Creativity: Image Generation with DALL揃E
Unlock AI Creativity: Image Generation with DALL揃E
Expeed Software
What Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI AgentsWhat Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI Agents
Zilliz
Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025
maharajput103
Fl studio crack version 12.9 Free Download
Fl studio crack version 12.9 Free DownloadFl studio crack version 12.9 Free Download
Fl studio crack version 12.9 Free Download
kherorpacca127
L01 Introduction to Nanoindentation - What is hardness
L01 Introduction to Nanoindentation - What is hardnessL01 Introduction to Nanoindentation - What is hardness
L01 Introduction to Nanoindentation - What is hardness
RostislavDaniel
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog GavraReplacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
ScyllaDB
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarterQ4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
MariaBarbaraPaglinaw
1.1. Evolution-and-Scope-of-Business-Analytics.pptx
1.1. Evolution-and-Scope-of-Business-Analytics.pptx1.1. Evolution-and-Scope-of-Business-Analytics.pptx
1.1. Evolution-and-Scope-of-Business-Analytics.pptx
Jitendra Tomar
A Framework for Model-Driven Digital Twin Engineering
A Framework for Model-Driven Digital Twin EngineeringA Framework for Model-Driven Digital Twin Engineering
A Framework for Model-Driven Digital Twin Engineering
Daniel Lehner
Wondershare Filmora Crack 14.3.2.11147 Latest
Wondershare Filmora Crack 14.3.2.11147 LatestWondershare Filmora Crack 14.3.2.11147 Latest
Wondershare Filmora Crack 14.3.2.11147 Latest
udkg888
World Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a CrossroadsWorld Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a Crossroads
Joshua Randall
Unlocking DevOps Secuirty :Vault & Keylock
Unlocking DevOps Secuirty :Vault & KeylockUnlocking DevOps Secuirty :Vault & Keylock
Unlocking DevOps Secuirty :Vault & Keylock
HusseinMalikMammadli
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
Gojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptxGojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptx
V3cube
Cloud of everything Tech of the 21 century in Aviation
Cloud of everything Tech of the 21 century in AviationCloud of everything Tech of the 21 century in Aviation
Cloud of everything Tech of the 21 century in Aviation
Assem mousa
Endpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore ItEndpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore It
MSP360
Future-Proof Your Career with AI Options
Future-Proof Your  Career with AI OptionsFuture-Proof Your  Career with AI Options
Future-Proof Your Career with AI Options
DianaGray10
Formal Methods: Whence and Whither? [Martin Fr辰nzle Festkolloquium, 2025]
Formal Methods: Whence and Whither? [Martin Fr辰nzle Festkolloquium, 2025]Formal Methods: Whence and Whither? [Martin Fr辰nzle Festkolloquium, 2025]
Formal Methods: Whence and Whither? [Martin Fr辰nzle Festkolloquium, 2025]
Jonathan Bowen
Transform Your Future with Front-End Development Training
Transform Your Future with Front-End Development TrainingTransform Your Future with Front-End Development Training
Transform Your Future with Front-End Development Training
Vtechlabs
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOTSMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
TanmaiArni
Unlock AI Creativity: Image Generation with DALL揃E
Unlock AI Creativity: Image Generation with DALL揃EUnlock AI Creativity: Image Generation with DALL揃E
Unlock AI Creativity: Image Generation with DALL揃E
Expeed Software
What Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI AgentsWhat Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI Agents
Zilliz
Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025
maharajput103
Fl studio crack version 12.9 Free Download
Fl studio crack version 12.9 Free DownloadFl studio crack version 12.9 Free Download
Fl studio crack version 12.9 Free Download
kherorpacca127
L01 Introduction to Nanoindentation - What is hardness
L01 Introduction to Nanoindentation - What is hardnessL01 Introduction to Nanoindentation - What is hardness
L01 Introduction to Nanoindentation - What is hardness
RostislavDaniel
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog GavraReplacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
ScyllaDB
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarterQ4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
MariaBarbaraPaglinaw
1.1. Evolution-and-Scope-of-Business-Analytics.pptx
1.1. Evolution-and-Scope-of-Business-Analytics.pptx1.1. Evolution-and-Scope-of-Business-Analytics.pptx
1.1. Evolution-and-Scope-of-Business-Analytics.pptx
Jitendra Tomar
A Framework for Model-Driven Digital Twin Engineering
A Framework for Model-Driven Digital Twin EngineeringA Framework for Model-Driven Digital Twin Engineering
A Framework for Model-Driven Digital Twin Engineering
Daniel Lehner
Wondershare Filmora Crack 14.3.2.11147 Latest
Wondershare Filmora Crack 14.3.2.11147 LatestWondershare Filmora Crack 14.3.2.11147 Latest
Wondershare Filmora Crack 14.3.2.11147 Latest
udkg888
World Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a CrossroadsWorld Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a Crossroads
Joshua Randall
Unlocking DevOps Secuirty :Vault & Keylock
Unlocking DevOps Secuirty :Vault & KeylockUnlocking DevOps Secuirty :Vault & Keylock
Unlocking DevOps Secuirty :Vault & Keylock
HusseinMalikMammadli
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
Gojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptxGojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptx
V3cube
Cloud of everything Tech of the 21 century in Aviation
Cloud of everything Tech of the 21 century in AviationCloud of everything Tech of the 21 century in Aviation
Cloud of everything Tech of the 21 century in Aviation
Assem mousa
Endpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore ItEndpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore It
MSP360
Future-Proof Your Career with AI Options
Future-Proof Your  Career with AI OptionsFuture-Proof Your  Career with AI Options
Future-Proof Your Career with AI Options
DianaGray10
Formal Methods: Whence and Whither? [Martin Fr辰nzle Festkolloquium, 2025]
Formal Methods: Whence and Whither? [Martin Fr辰nzle Festkolloquium, 2025]Formal Methods: Whence and Whither? [Martin Fr辰nzle Festkolloquium, 2025]
Formal Methods: Whence and Whither? [Martin Fr辰nzle Festkolloquium, 2025]
Jonathan Bowen

Javantura 2014 - Java 8 JavaScript Nashorn

  • 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, sijeanj 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 koliina biblioteka, puno platformi JVM najbolji dio Jave
  • 5. Rhino Rhino Java implementacija JavaScripta 1997 Netscape zapoeo 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 poetka
  • 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, uitaj 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 oekuje na jesen. Za sada su brojke obeavajue. to se dogaa 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