SlideShare a Scribd company logo
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

More Related Content

What's hot (20)

Reactjs
Reactjs Reactjs
Reactjs
Neha Sharma
 
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
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
Apaichon Punopas
 
Express node js
Express node jsExpress node js
Express node js
Yashprit Singh
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Knoldus Inc.
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
Arnold Asllani
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
 JavaScript - Chapter 9 - TypeConversion and Regular Expressions  JavaScript - Chapter 9 - TypeConversion and Regular Expressions
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
Visual Engineering
 
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
Hùng Nguyễn Huy
 
jQuery
jQueryjQuery
jQuery
Jay Poojara
 
Express JS
Express JSExpress JS
Express JS
Alok Guha
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
Collections in Java Notes
Collections in Java NotesCollections in Java Notes
Collections in Java Notes
Shalabh Chaudhary
 
Important React Hooks
Important React HooksImportant React Hooks
Important React Hooks
Knoldus Inc.
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
 
Fragment
Fragment Fragment
Fragment
nationalmobileapps
 
Expressjs
ExpressjsExpressjs
Expressjs
Yauheni Nikanovich
 
React hooks
React hooksReact hooks
React hooks
Ramy ElBasyouni
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
Daiwei Lu
 
reactJS
reactJSreactJS
reactJS
Syam Santhosh
 

Similar to 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
Marie Weaver
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparison
Devathon
 
JSX Optimizer
JSX OptimizerJSX Optimizer
JSX Optimizer
Kazuho Oku
 
Jsx language-notes
Jsx language-notesJsx language-notes
Jsx language-notes
Goro Fuji
 
Complete Dojo
Complete DojoComplete Dojo
Complete Dojo
Girish Srivastava
 
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 Bangalore
Sunil 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 PrimeFaces
Mert Ç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 2013
Andy Hall
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languages
actanimation
 
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
Martin Fousek
 
Introduction to Eqela development
Introduction to Eqela developmentIntroduction to Eqela development
Introduction to Eqela development
jobandesther
 
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
OPITZ CONSULTING Deutschland
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
sunil 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_.pdf
MoonTechnolabsPvtLtd
 
PHP and Zend Framework on Windows
PHP and Zend Framework on WindowsPHP and Zend Framework on Windows
PHP and Zend Framework on Windows
Shahar Evron
 
Java ide comparision
Java ide comparisionJava ide comparision
Java ide comparision
Raj
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdf
Sonia Simi
 
Aras PLM's Browser Neutral Client
Aras PLM's Browser Neutral ClientAras PLM's Browser Neutral Client
Aras PLM's Browser Neutral Client
Aras
 
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
cjolif
 
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
Marie Weaver
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparison
Devathon
 
Jsx language-notes
Jsx language-notesJsx language-notes
Jsx language-notes
Goro 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 Bangalore
Sunil 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 PrimeFaces
Mert Ç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 2013
Andy Hall
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languages
actanimation
 
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
Martin Fousek
 
Introduction to Eqela development
Introduction to Eqela developmentIntroduction to Eqela development
Introduction to Eqela development
jobandesther
 
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
OPITZ CONSULTING Deutschland
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
sunil 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_.pdf
MoonTechnolabsPvtLtd
 
PHP and Zend Framework on Windows
PHP and Zend Framework on WindowsPHP and Zend Framework on Windows
PHP and Zend Framework on Windows
Shahar Evron
 
Java ide comparision
Java ide comparisionJava ide comparision
Java ide comparision
Raj
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdf
Sonia Simi
 
Aras PLM's Browser Neutral Client
Aras PLM's Browser Neutral ClientAras PLM's Browser Neutral Client
Aras PLM's Browser Neutral Client
Aras
 
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
cjolif
 

More from Kazuho Oku (20)

HTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときHTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないとき
Kazuho Oku
 
QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7
Kazuho 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 Beyond
Kazuho 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 ruby
Kazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 server
Kazuho Oku
 
TLS & LURK @ IETF 95
TLS & LURK @ IETF 95TLS & LURK @ IETF 95
TLS & LURK @ IETF 95
Kazuho 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.5
Kazuho 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 faster
Kazuho Oku
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP better
Kazuho Oku
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
Kazuho 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 Learned
Kazuho 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 2013
Kazuho Oku
 
HTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときHTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないとき
Kazuho Oku
 
QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7
Kazuho 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 Beyond
Kazuho 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 ruby
Kazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 server
Kazuho Oku
 
TLS & LURK @ IETF 95
TLS & LURK @ IETF 95TLS & LURK @ IETF 95
TLS & LURK @ IETF 95
Kazuho 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.5
Kazuho 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 faster
Kazuho Oku
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP better
Kazuho Oku
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
Kazuho 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 Learned
Kazuho 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 2013
Kazuho Oku
 

Recently uploaded (20)

Kickstart Your QA: An Introduction to Automated Regression Testing Tools
Kickstart Your QA: An Introduction to Automated Regression Testing ToolsKickstart Your QA: An Introduction to Automated Regression Testing Tools
Kickstart Your QA: An Introduction to Automated Regression Testing Tools
Shubham Joshi
 
"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta Hlushak
"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta Hlushak"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta Hlushak
"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta Hlushak
Fwdays
 
What is FinTech A Complete Guide to Financial Technology.pdf
What is FinTech A Complete Guide to Financial Technology.pdfWhat is FinTech A Complete Guide to Financial Technology.pdf
What is FinTech A Complete Guide to Financial Technology.pdf
Yodaplus Technologies Private Limited
 
Webinar: LF Energy GEISA: Addressing edge interoperability at the meter
Webinar: LF Energy GEISA: Addressing edge interoperability at the meterWebinar: LF Energy GEISA: Addressing edge interoperability at the meter
Webinar: LF Energy GEISA: Addressing edge interoperability at the meter
DanBrown980551
 
TrustArc Webinar: State of State Privacy Laws
TrustArc Webinar: State of State Privacy LawsTrustArc Webinar: State of State Privacy Laws
TrustArc Webinar: State of State Privacy Laws
TrustArc
 
Caching for Performance Masterclass: The In-Memory Datastore
Caching for Performance Masterclass: The In-Memory DatastoreCaching for Performance Masterclass: The In-Memory Datastore
Caching for Performance Masterclass: The In-Memory Datastore
ScyllaDB
 
Dev Dives: Unlock the future of automation with UiPath Agent Builder
Dev Dives: Unlock the future of automation with UiPath Agent BuilderDev Dives: Unlock the future of automation with UiPath Agent Builder
Dev Dives: Unlock the future of automation with UiPath Agent Builder
UiPathCommunity
 
"DevOps culture and digital transformation process of Temabit Fozzy Group", O...
"DevOps culture and digital transformation process of Temabit Fozzy Group", O..."DevOps culture and digital transformation process of Temabit Fozzy Group", O...
"DevOps culture and digital transformation process of Temabit Fozzy Group", O...
Fwdays
 
Taiwan's Digital Security Pillars: Cyber Infrastructure
Taiwan's Digital Security Pillars: Cyber InfrastructureTaiwan's Digital Security Pillars: Cyber Infrastructure
Taiwan's Digital Security Pillars: Cyber Infrastructure
Charles Mok
 
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Earley Information Science
 
Big Data Analytics Quick Research Guide by Arthur Morgan (PREVIEW)
Big Data Analytics Quick Research Guide by Arthur Morgan (PREVIEW)Big Data Analytics Quick Research Guide by Arthur Morgan (PREVIEW)
Big Data Analytics Quick Research Guide by Arthur Morgan (PREVIEW)
Arthur Morgan
 
NSFW AI Chatbot Development Costs: What You Need to Know
NSFW AI Chatbot Development Costs: What You Need to KnowNSFW AI Chatbot Development Costs: What You Need to Know
NSFW AI Chatbot Development Costs: What You Need to Know
Soulmaite
 
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V..."Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...
Fwdays
 
Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...
Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...
Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...
Chris Wahl
 
Benchmark Testing Demystified: Your Roadmap to Peak Performance
Benchmark Testing Demystified: Your Roadmap to Peak PerformanceBenchmark Testing Demystified: Your Roadmap to Peak Performance
Benchmark Testing Demystified: Your Roadmap to Peak Performance
Shubham Joshi
 
Cryptography Overview Presentation circa 2005
Cryptography Overview Presentation circa 2005Cryptography Overview Presentation circa 2005
Cryptography Overview Presentation circa 2005
Dan Houser
 
Use of Nanotechnology in agriculture with examples
Use of Nanotechnology in agriculture with examplesUse of Nanotechnology in agriculture with examples
Use of Nanotechnology in agriculture with examples
Shri Durga ji P G College
 
Leadership u automatizaciji: RPA priče iz prakse!
Leadership u automatizaciji: RPA priče iz prakse!Leadership u automatizaciji: RPA priče iz prakse!
Leadership u automatizaciji: RPA priče iz prakse!
UiPathCommunity
 
ISOIEC 42001 AI Management System Slides
ISOIEC 42001 AI Management System SlidesISOIEC 42001 AI Management System Slides
ISOIEC 42001 AI Management System Slides
GilangRamadhan884333
 
AI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
AI Trends and Fun Demos – Sotheby’s Rehoboth PresentationAI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
AI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
Ethan Holland
 
Kickstart Your QA: An Introduction to Automated Regression Testing Tools
Kickstart Your QA: An Introduction to Automated Regression Testing ToolsKickstart Your QA: An Introduction to Automated Regression Testing Tools
Kickstart Your QA: An Introduction to Automated Regression Testing Tools
Shubham Joshi
 
"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta Hlushak
"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta Hlushak"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta Hlushak
"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta Hlushak
Fwdays
 
Webinar: LF Energy GEISA: Addressing edge interoperability at the meter
Webinar: LF Energy GEISA: Addressing edge interoperability at the meterWebinar: LF Energy GEISA: Addressing edge interoperability at the meter
Webinar: LF Energy GEISA: Addressing edge interoperability at the meter
DanBrown980551
 
TrustArc Webinar: State of State Privacy Laws
TrustArc Webinar: State of State Privacy LawsTrustArc Webinar: State of State Privacy Laws
TrustArc Webinar: State of State Privacy Laws
TrustArc
 
Caching for Performance Masterclass: The In-Memory Datastore
Caching for Performance Masterclass: The In-Memory DatastoreCaching for Performance Masterclass: The In-Memory Datastore
Caching for Performance Masterclass: The In-Memory Datastore
ScyllaDB
 
Dev Dives: Unlock the future of automation with UiPath Agent Builder
Dev Dives: Unlock the future of automation with UiPath Agent BuilderDev Dives: Unlock the future of automation with UiPath Agent Builder
Dev Dives: Unlock the future of automation with UiPath Agent Builder
UiPathCommunity
 
"DevOps culture and digital transformation process of Temabit Fozzy Group", O...
"DevOps culture and digital transformation process of Temabit Fozzy Group", O..."DevOps culture and digital transformation process of Temabit Fozzy Group", O...
"DevOps culture and digital transformation process of Temabit Fozzy Group", O...
Fwdays
 
Taiwan's Digital Security Pillars: Cyber Infrastructure
Taiwan's Digital Security Pillars: Cyber InfrastructureTaiwan's Digital Security Pillars: Cyber Infrastructure
Taiwan's Digital Security Pillars: Cyber Infrastructure
Charles Mok
 
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Earley Information Science
 
Big Data Analytics Quick Research Guide by Arthur Morgan (PREVIEW)
Big Data Analytics Quick Research Guide by Arthur Morgan (PREVIEW)Big Data Analytics Quick Research Guide by Arthur Morgan (PREVIEW)
Big Data Analytics Quick Research Guide by Arthur Morgan (PREVIEW)
Arthur Morgan
 
NSFW AI Chatbot Development Costs: What You Need to Know
NSFW AI Chatbot Development Costs: What You Need to KnowNSFW AI Chatbot Development Costs: What You Need to Know
NSFW AI Chatbot Development Costs: What You Need to Know
Soulmaite
 
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V..."Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...
Fwdays
 
Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...
Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...
Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...
Chris Wahl
 
Benchmark Testing Demystified: Your Roadmap to Peak Performance
Benchmark Testing Demystified: Your Roadmap to Peak PerformanceBenchmark Testing Demystified: Your Roadmap to Peak Performance
Benchmark Testing Demystified: Your Roadmap to Peak Performance
Shubham Joshi
 
Cryptography Overview Presentation circa 2005
Cryptography Overview Presentation circa 2005Cryptography Overview Presentation circa 2005
Cryptography Overview Presentation circa 2005
Dan Houser
 
Use of Nanotechnology in agriculture with examples
Use of Nanotechnology in agriculture with examplesUse of Nanotechnology in agriculture with examples
Use of Nanotechnology in agriculture with examples
Shri Durga ji P G College
 
Leadership u automatizaciji: RPA priče iz prakse!
Leadership u automatizaciji: RPA priče iz prakse!Leadership u automatizaciji: RPA priče iz prakse!
Leadership u automatizaciji: RPA priče iz prakse!
UiPathCommunity
 
ISOIEC 42001 AI Management System Slides
ISOIEC 42001 AI Management System SlidesISOIEC 42001 AI Management System Slides
ISOIEC 42001 AI Management System Slides
GilangRamadhan884333
 
AI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
AI Trends and Fun Demos – Sotheby’s Rehoboth PresentationAI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
AI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
Ethan Holland
 

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