SlideShare a Scribd company logo
JavaScript
                   por debaixo dos panos
                         ecossistema e linguagem na perspectiva da JVM




                                                              @qmx
                                                http://blog.qmx.me/
Saturday, May 14, 2011
www.gonow.com.br




                         www.caelum.com.br
                             Text




                            gitshelf.com



Saturday, May 14, 2011
quê?
Saturday, May 14, 2011
O Desenvolvedor
Saturday, May 14, 2011
O Cliente
Saturday, May 14, 2011
O processo de deploy
Saturday, May 14, 2011
Homologação
Saturday, May 14, 2011
Sem pacote RPM?
Saturday, May 14, 2011
Pacotes fáceis de Fazer



Saturday, May 14, 2011
Deploy Simples



Saturday, May 14, 2011
Um Zipão
Saturday, May 14, 2011
à prova de
         sobrinho




Saturday, May 14, 2011
Java!
Saturday, May 14, 2011
Java?
Saturday, May 14, 2011
porquê?
Saturday, May 14, 2011
não é node.js
Saturday, May 14, 2011
node.js

Saturday, May 14, 2011
Saturday, May 14, 2011
node.js tem
                          potencial

Saturday, May 14, 2011
MAS



Saturday, May 14, 2011
node.js não é
                         bala de prata


Saturday, May 14, 2011
100% async não é pra
                             qualquer um


Saturday, May 14, 2011
“mais de um
            jeito de fazer”


                         Consultor Sênior



Saturday, May 14, 2011
ringojs
Saturday, May 14, 2011
10 anos de idade!
Saturday, May 14, 2011
“Ringo takes a pragmatical
                 and non-dogmatic stance on
                  things like I/O paradigms.”



Saturday, May 14, 2011
DTSTTCPW
                         Faça a coisa mais simples
                         possível com potencial de
                                  funcionar

Saturday, May 14, 2011
(QUASE) NADA



Saturday, May 14, 2011
como?
Saturday, May 14, 2011
reutilizando a roda
Saturday, May 14, 2011
➜   rhino1_7R3   java -jar js.jar

                         Rhino 1.7 release 3 2011 05 10

                         js> date = new java.util.Date();

                         Thu May 12 11:12:24 BRT 2011




Saturday, May 14, 2011
Qualquer biblioteca
                          java já existente


Saturday, May 14, 2011
in-process cache?
                         distributed cache?
                              roll your own?




Saturday, May 14, 2011
EHCACHE

Saturday, May 14, 2011
Agendamento de
                             Tarefas?


Saturday, May 14, 2011
Quartz
Saturday, May 14, 2011
Busca textual?



Saturday, May 14, 2011
Lucene / Solr
Saturday, May 14, 2011
E muito mais!



Saturday, May 14, 2011
um problema



Saturday, May 14, 2011
Rhino é lento



Saturday, May 14, 2011
porquê?



Saturday, May 14, 2011
Saturday, May 14, 2011
Saturday, May 14, 2011
Não é V8
Saturday, May 14, 2011
meh
Saturday, May 14, 2011
VM



Saturday, May 14, 2011
Vantagens
                              e
                         Desvantagens


Saturday, May 14, 2011
poor’s man computer?



Saturday, May 14, 2011
KISS



Saturday, May 14, 2011
e o JavaScript?



Saturday, May 14, 2011
como otimizar?



Saturday, May 14, 2011
1       function Carro(nome, cor) {
                 2           this.nome = nome;
                 3           this.cor = cor;
                 4           this.anda = function(){
                 5               print("andando");
                 6           }
                 7       }
                 8
                 9       var x = new Carro("trovão azul", "azul (duh)");
                10       x.anda();




Saturday, May 14, 2011
1       function Carro(nome, cor) {
                 2           this.nome = nome;
                 3           this.cor = cor;
                 4           this.anda = function(){
                 5               print("andando");
                 6           }
                 7       }
                 8
                 9       var x = new Carro("trovão azul", "azul (duh)");
                10       x.anda();




Saturday, May 14, 2011
1 function MotorV8(){
                    2     this.liga = function(){
                    3         print("ligando...");
                    4     }
                    5 }




Saturday, May 14, 2011
7 function Carro(nome, cor) {
                 8     this.nome = nome;
                 9     this.cor = cor;
                10     this.motor = new MotorV8();
                11     this.anda = function(){
                12         print("andando");
                13     }
                14     this.liga = function(){
                15         this.motor.liga();
                16     }
                17 }



Saturday, May 14, 2011
19 var x = new Carro("trovão azul", "azul (duh)");
                20
                21 for(var i = 0; i< 10000; i++){
                22     x.liga();
                23 }




Saturday, May 14, 2011
19 var x = new Carro("trovão azul", "azul (duh)");
                20
                21 for(var i = 0; i< 10000; i++){
                22     x.liga();
                23 }




Saturday, May 14, 2011
inline de métodos



Saturday, May 14, 2011
19 var x = new Carro("trovão azul", "azul (duh)");
                20
                21 for(var i = 0; i< 10000; i++){
                22       print(“ligando...”);
                23 }




Saturday, May 14, 2011
Replay



Saturday, May 14, 2011
1 function MotorV8(){
                    2      this.liga = function(){
                    3          print("ligando...");
                    4      }
                    5 }




Saturday, May 14, 2011
7 function Carro(nome, cor) {
                 8           this.nome = nome;
                 9           this.cor = cor;
                10           this.motor = new MotorV8();
                11           this.anda = function(){
                12               print("andando");
                13           }
                14           this.liga = function(){
                15               this.motor.liga();
                16           }
                17       }



Saturday, May 14, 2011
19 var x = new Carro("trovão azul", "azul (duh)");
                20
                21 for(var i = 0; i< 10000; i++){
                22       print(“ligando...”);
                23 }




Saturday, May 14, 2011
problemas?



Saturday, May 14, 2011
#fail



Saturday, May 14, 2011
JVM



Saturday, May 14, 2011
feita pensando em uma
                           linguagem
                        (começa com J)


Saturday, May 14, 2011
precisa de classes



Saturday, May 14, 2011
function Carro
                               ===
                           class Carro


Saturday, May 14, 2011
JVM
                         no máximo 256 opcodes




Saturday, May 14, 2011
simples



Saturday, May 14, 2011
Saturday, May 14, 2011
ldc




Saturday, May 14, 2011
ldc   #9




Saturday, May 14, 2011
ldc   #9   // “Hello World”




Saturday, May 14, 2011
ldc         #9   // “Hello World”

                         getstatic




Saturday, May 14, 2011
ldc         #9    // “Hello World”

                         getstatic   #15




Saturday, May 14, 2011
ldc         #9   // “Hello World”

                         getstatic   #15 // System.out




Saturday, May 14, 2011
ldc         #9   // “Hello World”

                         getstatic   #15 // System.out

                         swap




Saturday, May 14, 2011
ldc             #9   // “Hello World”

                         getstatic       #15 // System.out

                         swap

                         invokevirtual




Saturday, May 14, 2011
ldc             #9    // “Hello World”

                         getstatic       #15 // System.out

                         swap

                         invokevirtual   #21




Saturday, May 14, 2011
ldc             #9    // “Hello World”

                         getstatic       #15 // System.out

                         swap

                         invokevirtual   #21 // PrintWriter.println()




Saturday, May 14, 2011
ldc             #9    // “Hello World”

                         getstatic       #15 // System.out

                         swap

                         invokevirtual   #21 // PrintWriter.println()

                         return


Saturday, May 14, 2011
ZOMG



Saturday, May 14, 2011
Estrutura de Invocação
                         invokestatic




Saturday, May 14, 2011
Estrutura de Invocação
                         invokestatic

                         A




Saturday, May 14, 2011
Estrutura de Invocação
                         invokestatic

                         A




Saturday, May 14, 2011
Estrutura de Invocação
                         invokestatic

                         A       B




Saturday, May 14, 2011
Estrutura de Invocação
                        invokevirtual




Saturday, May 14, 2011
Estrutura de Invocação
                        invokevirtual

                         A




Saturday, May 14, 2011
Estrutura de Invocação
                        invokevirtual

                         A




Saturday, May 14, 2011
Estrutura de Invocação
                        invokevirtual

                         A       B




Saturday, May 14, 2011
Estrutura de Invocação
                        invokevirtual

                         A       B
                                 C



Saturday, May 14, 2011
Estrutura de Invocação
                        invokevirtual

                         A       B
                                 C



Saturday, May 14, 2011
Estrutura de Invocação
                       invokeinterface




Saturday, May 14, 2011
Estrutura de Invocação
                       invokeinterface

                         A




Saturday, May 14, 2011
Estrutura de Invocação
                       invokeinterface

                         A




Saturday, May 14, 2011
Estrutura de Invocação
                       invokeinterface

                         A
                             I swear I am B



Saturday, May 14, 2011
Estrutura de Invocação
                       invokeinterface

                         A
                             I swear I am B

                                  C

Saturday, May 14, 2011
Estrutura de Invocação
                       invokeinterface

                         A
                             I swear I am B

                                  C

Saturday, May 14, 2011
Estrutura de Invocação
                       invokeinterface

                         A
                             I swear I am B

                                  C

Saturday, May 14, 2011
Estrutura de Invocação
                       invokeinterface

                           A
                                   I swear I am B

                         He is D
                         (LIAR)
                                        C

Saturday, May 14, 2011
e o JavaScript?



Saturday, May 14, 2011
Saturday, May 14, 2011
function




Saturday, May 14, 2011
function



                         identifier




Saturday, May 14, 2011
function



                               identifier



                         formal parameter list




Saturday, May 14, 2011
function



                               identifier



                         formal parameter list



                            function body




Saturday, May 14, 2011
formal parameter list



                            function body




Saturday, May 14, 2011
Saturday, May 14, 2011
n body                   function body   functio

n body                   function body   functio

n body                   function body   functio

n body                   function body   functio

n body                   function body   functio
Saturday, May 14, 2011
JavaScript
                                ===
                         um monte de blocos
                            executáveis



Saturday, May 14, 2011
perfeito para
                          otimização


Saturday, May 14, 2011
como resolver?



Saturday, May 14, 2011
JDK7
                         (prevista pra 7/7)


Saturday, May 14, 2011
invokedynamic



Saturday, May 14, 2011
invokedynamic




Saturday, May 14, 2011
invokedynamic

                         A




Saturday, May 14, 2011
invokedynamic

                         A
                                             C



Saturday, May 14, 2011
invokedynamic

                         A
                                             D
                                                 C



Saturday, May 14, 2011
invokedynamic

                         A
                                             D
                                                 C



Saturday, May 14, 2011
invokedynamic

                         A
                                             D
                                                 C



Saturday, May 14, 2011
invokedynamic

                         A
                                             D
                                                 C



Saturday, May 14, 2011
invokedynamic

                         A
                                             D
                                                 C

                                   ?
Saturday, May 14, 2011
invokedynamic

                         A
                                             D
                                                 C

                                   ?
Saturday, May 14, 2011
invokedynamic

                         A
                                             D
                                                 C

                                   ?
Saturday, May 14, 2011
invokedynamic

                         A
                                             D
                                                 C

                                   ?
Saturday, May 14, 2011
mega-alpha



Saturday, May 14, 2011
dyn.js
                         100% invokedynamic js impl




Saturday, May 14, 2011
em breve



Saturday, May 14, 2011
“Anyway, I know only one
                programming language worse
                than C and that is JavaScript”
                           Robert Caillau




Saturday, May 14, 2011
Saturday, May 14, 2011
?
Saturday, May 14, 2011
Obrigado!



Saturday, May 14, 2011

More Related Content

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Ransomware Mallox [EN].pdf
Ransomware         Mallox       [EN].pdfRansomware         Mallox       [EN].pdf
Ransomware Mallox [EN].pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

JavaScript por debaixo dos panos