JavaScript as a Platform
What you know about  JavaScript language         restrictions?           Five Monkeys ExperimentA rule, a regulation, or a...
Why peopleuse JavaScript?                Dan, 18 years. My girl is love in JS!      My name is Mark,     I use JavaScript ...
Why youreally shoulduse it?         I use JS,                just because                it works                everywhere!
JavaScriptlanguage design
JavaScript
Created forJavaScript      Web              Designers
Created forJavaScript                 Weakly                Web                           typed              Designers
Created for             C-like syntax, makes itJavaScript                 Weakly                Web                 appear...
Created for             C-like syntax, makes itJavaScript                  Weakly                 Web                 appe...
Created for             C-like syntax, makes itJavaScript                  Weakly                 Web                 appe...
Created for               C-like syntax, makes itJavaScript                    Weakly                 Web                 ...
Created for                  C-like syntax, makes itJavaScript                     Weakly                 Web             ...
Created for                     C-like syntax, makes itJavaScript                     Weakly                 Web          ...
Created for                     C-like syntax, makes itJavaScript                     Weakly                 Web          ...
Created for                     C-like syntax, makes itJavaScript                     Weakly                 Web          ...
Created for                     C-like syntax, makes itJavaScript                     Weakly                 Web          ...
JavaScript                          is very mutable, it’s very flexible.                                   You can rename ...
1995                  Brendan Eich joined Netscape ,                  to create a programming language for browser        ...
≈265 standards             Ecma International              private   non-profit            a standards organization       ...
ECMAScript Language Specification                     ECMA-262 ISO/IEC 16262   MAJOR RELEASE     1.0   1997 Compromise bet...
JavaScript   Domain-Specific Language               Hidden low-level operationsFrameworks     Open Source                 ...
Static code analysisIdentify potential problemsPossible bugs        Overcomplicated expressionsSecurity issues      Subopt...
Automaticcode correctionsMakes JavaScript download and run faster.It is a true compiler for JavaScript.It compiles from Ja...
Languages                  Improvements on syntax levelcompiled                   Compiled JS will work on any JavaScript ...
Classiclanguagescompilation into JSStrongly-Typed JavaScript (STJS)Is an open source JavaScript code generator from a Java...
Emscriptenis an LLVMto JavaScriptcompilerIt takes LLVM bitcode (which can be generated from C/C++ using Clang, or any othe...
V8JavaScript EngineV8 is Googles open source JavaScript engine.V8 is written in C++ and is used in Google Chrome.V8 compil...
JavaScript runseverything
C programs compiled to asm.jsAsm.js   Its just a subset of JavaScript.         Mozilla is working on a first implementatio...
Emulatorson JavaScript    Matt Westcott          Ben Firshman      Kevin ODwyer    Emulated ZX Spectrum   Emulated Dandy  ...
Linux           PC emulator is written in JavaScript.                  32 bit x86 compatible CPU 2.6.20           No FPU/M...
demo
Thank you                    Vlad Mysla                  vlad@pearl.com       Technical Lead at LLC Pearl.com
Upcoming SlideShare
Loading in...5
×

Javascript as a Platform

8,024

Published on

A story about JavaScript History and its future. I'm talking about language design, ECMA standards, JavaScript code generation, and Virtual Machines made on JS.

Published in: Technology
0 Comments
30 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
8,024
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
84
Comments
0
Likes
30
Embeds 0
No embeds

No notes for slide

Javascript as a Platform

  1. 1. JavaScript as a Platform
  2. 2. What you know about JavaScript language restrictions? Five Monkeys ExperimentA rule, a regulation, or a procedure, is introduced for a reason. However, after a while, the reason for it is forgotten, but the rule stays. Harry Harlow American psychologist
  3. 3. Why peopleuse JavaScript? Dan, 18 years. My girl is love in JS! My name is Mark, I use JavaScript to hide buttons. I’m Mario, JavaScript is all that I learned in my life!
  4. 4. Why youreally shoulduse it? I use JS, just because it works everywhere!
  5. 5. JavaScriptlanguage design
  6. 6. JavaScript
  7. 7. Created forJavaScript Web Designers
  8. 8. Created forJavaScript Weakly Web typed Designers
  9. 9. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language
  10. 10. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language Has more in commonwith functional languages like Lisp or Scheme than with C or Java
  11. 11. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language Has more in commonwith functional languages like Lisp or Scheme than with C or Java Arraysinstead of Lists
  12. 12. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language Has more in commonwith functional languages like Lisp or Scheme than with C or Java Arrays Objectsinstead of instead of Lists Property Lists
  13. 13. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language Has more in commonwith functional languages Lambda like Lisp or Scheme functions than with C or Java Arrays Objectsinstead of instead of Lists Property Lists
  14. 14. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language Has more in commonwith functional languages Lambda like Lisp or Scheme functions than with C or Java Arrays Objects Functions areinstead of instead of First Class Lists Property Lists
  15. 15. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language Has more in commonwith functional languages Lambda Prototypal like Lisp or Scheme functions inheritance than with C or Java Arrays Objects Functions areinstead of instead of First Class Lists Property Lists
  16. 16. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language Has more in commonwith functional languages Lambda Prototypal Closures like Lisp or Scheme functions inheritance than with C or Java Arrays Objects Functions areinstead of instead of First Class Lists Property Lists
  17. 17. Created for C-like syntax, makes itJavaScript Weakly Web appear like an ordinary typed Designers procedural language Has more in commonwith functional languages Lambda Prototypal Closures like Lisp or Scheme functions inheritance than with C or Java Arrays Objects Functions are Run-timeinstead of instead of First Class evaluation Lists Property Lists
  18. 18. JavaScript is very mutable, it’s very flexible. You can rename things. Brendan Eich Author of JavaScriptDouglas Crockford It Is The Worlds Most MisunderstoodComputer Programmer Programming Language
  19. 19. 1995 Brendan Eich joined Netscape , to create a programming language for browser and base it on Scheme (a Lisp dialect) 2008 Google released V8 engine +10 JavaScript engine prototype (Mocha) 1997 LiveConnect 2 released 1996 Released NN2 with JS support 1998 Rhino engine ECMA Standardization by Norris Boyd released LiveConnect released1994 1998 2010 Founded Netscape company Mozilla inherited and created one of the first browsers Netscape’s code-base JavaScript is a trademark of and official JavaScript Oracle Corporation management rights
  20. 20. ≈265 standards Ecma International private non-profit a standards organization of information and communication systems funded in 1961 to standardize computer systems in Europe
  21. 21. ECMAScript Language Specification ECMA-262 ISO/IEC 16262 MAJOR RELEASE 1.0 1997 Compromise between Netscape and MicrosoftEDITORIAL CHANGES 2.0 1998 Align with ISO/IEC 16262 international standard MAJOR RELEASE 3.0 1999 Added regular expressions, try/catch exceptionCOMMUNITY RELEASE 3.1 Yahoo, Microsoft and Google formed group to update of ECMAScript 3 ABANDONED 4.0 Abandoned, due to political differences concerning language complexity MAJOR RELEASE 5.0 2009 Library support for JSON, and more complete reflection EDITORIAL CHANGES 5.1 2011 Align with 3rd version of ISO/IEC 16262:2011 MAJOR RELEASE 6.0 Support classes, semantic and syntactic innovations 72% of functionality is supported by browsers 28% have issues (IE8, FF3.5, OP10.5, Konq 4)
  22. 22. JavaScript Domain-Specific Language Hidden low-level operationsFrameworks Open Source John Resig JS Method Overloading
  23. 23. Static code analysisIdentify potential problemsPossible bugs Overcomplicated expressionsSecurity issues Suboptimal codeDead code Language standard violationDuplicate code Code-style disregardJSLint is a good example of such tool
  24. 24. Automaticcode correctionsMakes JavaScript download and run faster.It is a true compiler for JavaScript.It compiles from JavaScript to better JavaScript.Implemented on JavaSpeed is very impressive,given that it’s a pure-JavaScript implementation.Implemented on Node.js
  25. 25. Languages Improvements on syntax levelcompiled Compiled JS will work on any JavaScript runtime Repeating execution speed improvementsinto JavaScript CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way. The golden rule of CoffeeScript is: "Its just JavaScript". TypeScript is for application-scale JavaScript development. Language is a typed superset of JavaScript that compiles to plain JavaScript. Any browser. Any host. Any OS. Open Source. The goal of Dart is: ultimately to replace JavaScript as the lingua franca of web development on the open web platform.
  26. 26. Classiclanguagescompilation into JSStrongly-Typed JavaScript (STJS)Is an open source JavaScript code generator from a Java source.It is built as a Maven plugin that can be executed after the compilation.GWTThese allow you to write AJAX applications in Java and then compile the sourceto highly optimized JavaScript that runs across all browsers,including mobile browsers for Android and the iPhone.QuicklightThe Saltarelle C# to Javascript compiler allows a developer to write C# code and thencompile it to Javascript which can be run in any web browser.
  27. 27. Emscriptenis an LLVMto JavaScriptcompilerIt takes LLVM bitcode (which can be generated from C/C++ using Clang, or any otherlanguage that can be converted into LLVM bitcode) and compiles that into JavaScript,which can be run on the web (or anywhere else JavaScript can run).Using Emscripten, you can:- Compile C and C++ code into JavaScript™ and run that on the web- Run code in languages like Python as well, by compiling CPython from C to JavaScript
  28. 28. V8JavaScript EngineV8 is Googles open source JavaScript engine.V8 is written in C++ and is used in Google Chrome.V8 compiles JavaScript to native machine code (IA-32, x86-64, ARM, or MIPS CPUs)The V8 assembler is based on the Strongtalk assembler3 key areas to V8s performance: Fast Property Access Dynamic Machine Code Generation Efficient Garbage CollectionCompilation into JSoptimized for Browser
  29. 29. JavaScript runseverything
  30. 30. C programs compiled to asm.jsAsm.js Its just a subset of JavaScript. Mozilla is working on a first implementation for SpiderMonkey.
  31. 31. Emulatorson JavaScript Matt Westcott Ben Firshman Kevin ODwyer Emulated ZX Spectrum Emulated Dandy Emulated MS DOS JSSpeccy JSNES JSDosBox ZX Spectrum Dandy DOS
  32. 32. Linux PC emulator is written in JavaScript. 32 bit x86 compatible CPU 2.6.20 No FPU/MMX/SSEFabrice Bellard Yauhen YakimovichEmulated Linux Author of JSModem
  33. 33. demo
  34. 34. Thank you Vlad Mysla vlad@pearl.com Technical Lead at LLC Pearl.com

×