SlideShare uma empresa Scribd logo
1 de 16
JSX
DeNA Co., Ltd.
 Kazuho Oku
What is JSX?




Apr 5 2012   Copyright © 2012 DeNA Co., Ltd., All rights reserved   2
kind of a skunk-works project I have been
         doing for the last week or two…
                (together with gfx)



Apr 5 2012     Copyright © 2012 DeNA Co., Ltd., All rights reserved   3
Existing problems with JavaScript

   low productivity
        requires skills to write fast and maintainable code
        esp. in medium to large-scale development
   slow
        esp. on iOS (without JIT)
   memory-consuming
        esp. on JavaScript runtimes with JIT support



Apr 5 2012          Copyright © 2012 DeNA Co., Ltd., All rights reserved   4
JSX is…

   a strictly-typed OO language
   convertible to JavaScript
        and runs faster than JavaScript on web browsers




Apr 5 2012         Copyright © 2012 DeNA Co., Ltd., All rights reserved   5
JSX as a programming language

   strictly-typed OO programming language
   syntax:
        class / function definition like Java
        function body is JavaScript
   strict types lead to higher productivity /
    better quality than JavaScript
        higher productivity / better quality than C / C++
         (JSX has GC, no pointers)

Apr 5 2012           Copyright © 2012 DeNA Co., Ltd., All rights reserved   6
JSX to JavaScript compiler

   generated code runs faster than JS
        by optimizing the generated code using type-info
        JSX is designed so that there would be no
         overhead when compiled to JavaScript
   interoperable with JavaScript
   generates source-map for debugging
        source-map is a technology that supports
         debugging of client-side code on web browsers
         written in languages other than JavaScript
Apr 5 2012         Copyright © 2012 DeNA Co., Ltd., All rights reserved   7
The goal of JSX

   run faster than JavaScript on browsers
   higher productivity than JavaScript
   applications developed using JSX will
    have higher quality than when using
    JavaScript




Apr 5 2012       Copyright © 2012 DeNA Co., Ltd., All rights reserved   8
Comparison: Google Web Toolkit

   write in Java / translate to JavaScript
   differences bet. Java and JS leads to…
        different behaviors between when run on Java
         and on JavaScript makes debugging is difficult
        the translation introduces speed / size overhead
        hard to use in conjunction with JS libraries
             cannot use existing Java code as well

   JSX has none of the problems listed
    above
Apr 5 2012             Copyright © 2012 DeNA Co., Ltd., All rights reserved   9
Comparison: Google Closure Compiler

   a JavaScript minifier
        can use type-annotations to optimize JS
        problem: type-annotations are fragile
             hard to write, impossible to maintain

   JSX does not have the problem
        strict types promise higher productivity and
         performance: all optimizations possible by Closure
         Compiler can be applied
             initial versions of JSX will generate fully type-annotated
              code and pass it to Closure Compiler 
Apr 5 2012              Copyright © 2012 DeNA Co., Ltd., All rights reserved   10
Comparison: Dart

   promoted by Google as an replacement
    of JavaScript
        optionally-typed OO language
   Problems:
        slower than JavaScript when converted to JS
        unlikely to be supported by web browsers other
         than Chrome (as a native language)
        unlikely to run at native performance
             optionally-typed languages usually require JIT support
              to run fast
Apr 5 2012             Copyright © 2012 DeNA Co., Ltd., All rights reserved   11
Comparison: ActionScript 3

   an extension of JavaScript with classes
    and optional types
   Problem:
        cannot be translated to JavaScript without big
         performance penalty
        unlikely to run at native performance
             optionally-typed languages usually require JIT support
              to run fast



Apr 5 2012             Copyright © 2012 DeNA Co., Ltd., All rights reserved   12
Sample code
   import "./foo"; // import foo.jsx to current scope
   import "./bar" into Bar; // refer to the classes as Bar.clazz

   class Fib {
     static function fib(n : number) : number {
       if (n < 2)
         return 1;
       else
         return fib(n - 1) + fib(n - 2);
     }
   }




Apr 5 2012                  Copyright © 2012 DeNA Co., Ltd., All rights reserved   13
Sample code (cont'd)
   class FizzBuzz {
     static function main(args : String[]) : number {
       for (var i = 0; i < 100; i++) {
         if (i % 15 == 0)
           log "FizzBuzz";
         else if (i % 3 == 0)
           log "Fizz";
         else if (i % 5 == 0)
           log "Buzz";
         else
           log i;
       }
     }
   }


Apr 5 2012                  Copyright © 2012 DeNA Co., Ltd., All rights reserved   14
Design notes on JSX

    no global namespace
         namespaces exist for each source file
         classes in imported source files will be expanded the top-level namespace (or
          to the specified namespace)
    primitive types: void, null, boolean, int, number, String
         int: introduced for future usage
              on JS, additional overhead only for div and mod operations (by "| 0", etc.), which are rarely used

    functions and member functions:
         can be overloaded (internally uses name mangling)
              accessing the arguments object is slow in JS
         function references and member function references are first-class objects




Apr 5 2012                        Copyright © 2012 DeNA Co., Ltd., All rights reserved                              15
Design notes on JSX (cont'd)

    built-in log and assert statements
         no code will be emitted for release builds
    support for typed arrays
         will fallback to normal array if not supported by the platform
         primary target: to support games on HTML 5

    compiler is written in JavaScript
         so that it could be run on the web browser
              for faster development cycle
         will be ported to JSX once self-hosting becomes possible
              will be a good test code
              may use a preprocessor so that the compiler could be interpreted as both JS and JSX




Apr 5 2012                     Copyright © 2012 DeNA Co., Ltd., All rights reserved                  16

Mais conteúdo relacionado

Mais procurados

Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooksSamundra khatri
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners Varun Raj
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Previewvaluebound
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React NativeEric Deng
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentationThanh Tuong
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.jsPagepro
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.jsDoug Neiner
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#Aditya Kumar Rajan
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooksMaulik Shah
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.jsTechMagic
 
Lessons-Learned-SwiftUI.pptx
Lessons-Learned-SwiftUI.pptxLessons-Learned-SwiftUI.pptx
Lessons-Learned-SwiftUI.pptxMohammad Azam
 
React web development
React web developmentReact web development
React web developmentRully Ramanda
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.jsEmanuele DelBono
 

Mais procurados (20)

Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
VueJS: The Simple Revolution
VueJS: The Simple RevolutionVueJS: The Simple Revolution
VueJS: The Simple Revolution
 
React/Redux
React/ReduxReact/Redux
React/Redux
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
React Hooks
React HooksReact Hooks
React Hooks
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.js
 
React and redux
React and reduxReact and redux
React and redux
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#
 
React JS part 1
React JS part 1React JS part 1
React JS part 1
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
 
Lessons-Learned-SwiftUI.pptx
Lessons-Learned-SwiftUI.pptxLessons-Learned-SwiftUI.pptx
Lessons-Learned-SwiftUI.pptx
 
React web development
React web developmentReact web development
React web development
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
React js
React jsReact js
React js
 

Semelhante a JSX

Top 7 Node JS IDEs for App Development in 2022.pdf
Top 7 Node JS IDEs for App Development in 2022.pdfTop 7 Node JS IDEs for App Development in 2022.pdf
Top 7 Node JS IDEs for App Development in 2022.pdfMarie Weaver
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonDevathon
 
Jsx language-notes
Jsx language-notesJsx language-notes
Jsx language-notesGoro Fuji
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi Shlomo Vanunu
 
Rcs project Training Bangalore
Rcs project Training BangaloreRcs project Training Bangalore
Rcs project Training BangaloreSunil Kumar
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesMert Çalışkan
 
Node.js and Photoshop Generator - JSConf Asia 2013
Node.js and Photoshop Generator - JSConf Asia 2013Node.js and Photoshop Generator - JSConf Asia 2013
Node.js and Photoshop Generator - JSConf Asia 2013Andy Hall
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languagesactanimation
 
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013Martin Fousek
 
Introduction to Eqela development
Introduction to Eqela developmentIntroduction to Eqela development
Introduction to Eqela developmentjobandesther
 
BootsFaces, AngularFaces und ein Blck unter die Motorhaube
BootsFaces, AngularFaces und ein Blck unter die MotorhaubeBootsFaces, AngularFaces und ein Blck unter die Motorhaube
BootsFaces, AngularFaces und ein Blck unter die MotorhaubeOPITZ CONSULTING Deutschland
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRainingsunil kumar
 
Node.js vs PHP_ Which is a good choice for your project_.pdf
Node.js vs PHP_ Which is a good choice for your project_.pdfNode.js vs PHP_ Which is a good choice for your project_.pdf
Node.js vs PHP_ Which is a good choice for your project_.pdfMoonTechnolabsPvtLtd
 
PHP and Zend Framework on Windows
PHP and Zend Framework on WindowsPHP and Zend Framework on Windows
PHP and Zend Framework on WindowsShahar Evron
 
Java ide comparision
Java ide comparisionJava ide comparision
Java ide comparisionRaj
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdfSonia Simi
 
Aras PLM's Browser Neutral Client
Aras PLM's Browser Neutral ClientAras PLM's Browser Neutral Client
Aras PLM's Browser Neutral ClientAras
 
Dojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspectiveDojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspectivecjolif
 

Semelhante a JSX (20)

Top 7 Node JS IDEs for App Development in 2022.pdf
Top 7 Node JS IDEs for App Development in 2022.pdfTop 7 Node JS IDEs for App Development in 2022.pdf
Top 7 Node JS IDEs for App Development in 2022.pdf
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparison
 
JSX Optimizer
JSX OptimizerJSX Optimizer
JSX Optimizer
 
Jsx language-notes
Jsx language-notesJsx language-notes
Jsx language-notes
 
Complete Dojo
Complete DojoComplete Dojo
Complete Dojo
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi
 
Rcs project Training Bangalore
Rcs project Training BangaloreRcs project Training Bangalore
Rcs project Training Bangalore
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
 
Node.js and Photoshop Generator - JSConf Asia 2013
Node.js and Photoshop Generator - JSConf Asia 2013Node.js and Photoshop Generator - JSConf Asia 2013
Node.js and Photoshop Generator - JSConf Asia 2013
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languages
 
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
 
Introduction to Eqela development
Introduction to Eqela developmentIntroduction to Eqela development
Introduction to Eqela development
 
BootsFaces, AngularFaces und ein Blck unter die Motorhaube
BootsFaces, AngularFaces und ein Blck unter die MotorhaubeBootsFaces, AngularFaces und ein Blck unter die Motorhaube
BootsFaces, AngularFaces und ein Blck unter die Motorhaube
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
 
Node.js vs PHP_ Which is a good choice for your project_.pdf
Node.js vs PHP_ Which is a good choice for your project_.pdfNode.js vs PHP_ Which is a good choice for your project_.pdf
Node.js vs PHP_ Which is a good choice for your project_.pdf
 
PHP and Zend Framework on Windows
PHP and Zend Framework on WindowsPHP and Zend Framework on Windows
PHP and Zend Framework on Windows
 
Java ide comparision
Java ide comparisionJava ide comparision
Java ide comparision
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdf
 
Aras PLM's Browser Neutral Client
Aras PLM's Browser Neutral ClientAras PLM's Browser Neutral Client
Aras PLM's Browser Neutral Client
 
Dojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspectiveDojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspective
 

Mais de Kazuho Oku

HTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときHTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときKazuho Oku
 
QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7Kazuho Oku
 
HTTP/2の課題と将来
HTTP/2の課題と将来HTTP/2の課題と将来
HTTP/2の課題と将来Kazuho Oku
 
TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話Kazuho Oku
 
Reorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondReorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondKazuho Oku
 
Recent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyRecent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyKazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsivenessKazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsivenessKazuho Oku
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 serverKazuho Oku
 
TLS & LURK @ IETF 95
TLS & LURK @ IETF 95TLS & LURK @ IETF 95
TLS & LURK @ IETF 95Kazuho Oku
 
HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向Kazuho Oku
 
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先Kazuho Oku
 
Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Kazuho Oku
 
HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計Kazuho Oku
 
H2O - making the Web faster
H2O - making the Web fasterH2O - making the Web faster
H2O - making the Web fasterKazuho Oku
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP betterKazuho Oku
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP serverKazuho Oku
 
JSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedJSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedKazuho Oku
 
JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法Kazuho Oku
 
JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013Kazuho Oku
 

Mais de Kazuho Oku (20)

HTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときHTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないとき
 
QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7
 
HTTP/2の課題と将来
HTTP/2の課題と将来HTTP/2の課題と将来
HTTP/2の課題と将来
 
TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話
 
Reorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondReorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and Beyond
 
Recent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyRecent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using ruby
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 server
 
TLS & LURK @ IETF 95
TLS & LURK @ IETF 95TLS & LURK @ IETF 95
TLS & LURK @ IETF 95
 
HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向
 
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
 
Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5
 
HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計
 
H2O - making the Web faster
H2O - making the Web fasterH2O - making the Web faster
H2O - making the Web faster
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP better
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
 
JSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedJSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons Learned
 
JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法
 
JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

JSX

  • 1. JSX DeNA Co., Ltd. Kazuho Oku
  • 2. What is JSX? Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 2
  • 3. kind of a skunk-works project I have been doing for the last week or two… (together with gfx) Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 3
  • 4. Existing problems with JavaScript low productivity requires skills to write fast and maintainable code esp. in medium to large-scale development slow esp. on iOS (without JIT) memory-consuming esp. on JavaScript runtimes with JIT support Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 4
  • 5. JSX is… a strictly-typed OO language convertible to JavaScript and runs faster than JavaScript on web browsers Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 5
  • 6. JSX as a programming language strictly-typed OO programming language syntax: class / function definition like Java function body is JavaScript strict types lead to higher productivity / better quality than JavaScript higher productivity / better quality than C / C++ (JSX has GC, no pointers) Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 6
  • 7. JSX to JavaScript compiler generated code runs faster than JS by optimizing the generated code using type-info JSX is designed so that there would be no overhead when compiled to JavaScript interoperable with JavaScript generates source-map for debugging source-map is a technology that supports debugging of client-side code on web browsers written in languages other than JavaScript Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 7
  • 8. The goal of JSX run faster than JavaScript on browsers higher productivity than JavaScript applications developed using JSX will have higher quality than when using JavaScript Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 8
  • 9. Comparison: Google Web Toolkit write in Java / translate to JavaScript differences bet. Java and JS leads to… different behaviors between when run on Java and on JavaScript makes debugging is difficult the translation introduces speed / size overhead hard to use in conjunction with JS libraries cannot use existing Java code as well JSX has none of the problems listed above Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 9
  • 10. Comparison: Google Closure Compiler a JavaScript minifier can use type-annotations to optimize JS problem: type-annotations are fragile hard to write, impossible to maintain JSX does not have the problem strict types promise higher productivity and performance: all optimizations possible by Closure Compiler can be applied initial versions of JSX will generate fully type-annotated code and pass it to Closure Compiler  Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 10
  • 11. Comparison: Dart promoted by Google as an replacement of JavaScript optionally-typed OO language Problems: slower than JavaScript when converted to JS unlikely to be supported by web browsers other than Chrome (as a native language) unlikely to run at native performance optionally-typed languages usually require JIT support to run fast Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 11
  • 12. Comparison: ActionScript 3 an extension of JavaScript with classes and optional types Problem: cannot be translated to JavaScript without big performance penalty unlikely to run at native performance optionally-typed languages usually require JIT support to run fast Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 12
  • 13. Sample code import "./foo"; // import foo.jsx to current scope import "./bar" into Bar; // refer to the classes as Bar.clazz class Fib { static function fib(n : number) : number { if (n < 2) return 1; else return fib(n - 1) + fib(n - 2); } } Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 13
  • 14. Sample code (cont'd) class FizzBuzz { static function main(args : String[]) : number { for (var i = 0; i < 100; i++) { if (i % 15 == 0) log "FizzBuzz"; else if (i % 3 == 0) log "Fizz"; else if (i % 5 == 0) log "Buzz"; else log i; } } } Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 14
  • 15. Design notes on JSX  no global namespace  namespaces exist for each source file  classes in imported source files will be expanded the top-level namespace (or to the specified namespace)  primitive types: void, null, boolean, int, number, String  int: introduced for future usage  on JS, additional overhead only for div and mod operations (by "| 0", etc.), which are rarely used  functions and member functions:  can be overloaded (internally uses name mangling)  accessing the arguments object is slow in JS  function references and member function references are first-class objects Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 15
  • 16. Design notes on JSX (cont'd)  built-in log and assert statements  no code will be emitted for release builds  support for typed arrays  will fallback to normal array if not supported by the platform  primary target: to support games on HTML 5  compiler is written in JavaScript  so that it could be run on the web browser  for faster development cycle  will be ported to JSX once self-hosting becomes possible  will be a good test code  may use a preprocessor so that the compiler could be interpreted as both JS and JSX Apr 5 2012 Copyright © 2012 DeNA Co., Ltd., All rights reserved 16