SlideShare une entreprise Scribd logo
1  sur  135
Télécharger pour lire hors ligne
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

Contenu connexe

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

En vedette

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)
 

En vedette (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