State of the art - server side JavaScript - web-5 2012
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

State of the art - server side JavaScript - web-5 2012

on

  • 4,019 views

 

Statistics

Views

Total Views
4,019
Views on SlideShare
3,857
Embed Views
162

Actions

Likes
4
Downloads
48
Comments
2

7 Embeds 162

http://lanyrd.com 75
http://jslive.fr 69
http://news.humancoders.com 8
https://twitter.com 6
http://www.linkedin.com 2
http://localhost 1
https://www.linkedin.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

CC Attribution-NoDerivs LicenseCC Attribution-NoDerivs License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • When we started to define the Wakanda project, we did a lot of research and tests before concluding what would be the best language for it on the server and with which engine. We then decided to share with the others what we knew and what we learned. And here come this presentation.\n
  • \n
  • \n
  • Brendan Eich creates JavaScript for NetScape.\n1 year after, he puts it on the server.\nEach time Microsoft followed just one year after.\nThe Server-Side JavaScript is 15 years old.\nBackend developers were not much convinced and mostly choose to ignore it.\n
  • \n
  • JavaScript long growing maturity.\nMozilla Rhino and Microsoft IIS were the only ones running JavaScript/JScript on the server.\nJavaScript finally had respected standards, development tools, libraries, frameworks, richer APIs\n\n
  • Aptana was well respected for its support of JavaScript and JS frameworks in its Studio.\nWhen they tried to launch their Cloud solution with JS on the server via Jaxer, lot of JS experts were enthusiastic. John Resig immediately shared its own experiences on its blog.\nIn 2008, first presentation of Wakanda at The Ajax Experience ;-)\nA group called ServerJS were created from the Mozilla Developper Tools community with Kevin Dangoor.\nIt became more independent and choose to be renamed CommonJS to create standard server-side & client-side JS APIs.\nNode.js proposed an Async Event-Loop model on the server via the Google V8 JS engine. V8 had good reputation, and the concept looked quite revolutionary to JS developers.\nThe Long time running Helma choose to rename Helma NG for a new brand: RingoJS\n
  • Aptana was well respected for its support of JavaScript and JS frameworks in its Studio.\nWhen they tried to launch their Cloud solution with JS on the server via Jaxer, lot of JS experts were enthusiastic. John Resig immediately shared its own experiences on its blog.\nIn 2008, first presentation of Wakanda at The Ajax Experience ;-)\nA group called ServerJS were created from the Mozilla Developper Tools community with Kevin Dangoor.\nIt became more independent and choose to be renamed CommonJS to create standard server-side & client-side JS APIs.\nNode.js proposed an Async Event-Loop model on the server via the Google V8 JS engine. V8 had good reputation, and the concept looked quite revolutionary to JS developers.\nThe Long time running Helma choose to rename Helma NG for a new brand: RingoJS\n
  • Aptana was well respected for its support of JavaScript and JS frameworks in its Studio.\nWhen they tried to launch their Cloud solution with JS on the server via Jaxer, lot of JS experts were enthusiastic. John Resig immediately shared its own experiences on its blog.\nIn 2008, first presentation of Wakanda at The Ajax Experience ;-)\nA group called ServerJS were created from the Mozilla Developper Tools community with Kevin Dangoor.\nIt became more independent and choose to be renamed CommonJS to create standard server-side & client-side JS APIs.\nNode.js proposed an Async Event-Loop model on the server via the Google V8 JS engine. V8 had good reputation, and the concept looked quite revolutionary to JS developers.\nThe Long time running Helma choose to rename Helma NG for a new brand: RingoJS\n
  • Aptana was well respected for its support of JavaScript and JS frameworks in its Studio.\nWhen they tried to launch their Cloud solution with JS on the server via Jaxer, lot of JS experts were enthusiastic. John Resig immediately shared its own experiences on its blog.\nIn 2008, first presentation of Wakanda at The Ajax Experience ;-)\nA group called ServerJS were created from the Mozilla Developper Tools community with Kevin Dangoor.\nIt became more independent and choose to be renamed CommonJS to create standard server-side & client-side JS APIs.\nNode.js proposed an Async Event-Loop model on the server via the Google V8 JS engine. V8 had good reputation, and the concept looked quite revolutionary to JS developers.\nThe Long time running Helma choose to rename Helma NG for a new brand: RingoJS\n
  • \n
  • \n
  • Many User groups, Many Conferences, Many Blogs & books, Large documentation, Language also used by developers from other communities\n
  • Most popular language on GitHub\nMany libraries and Frameworks with sometime big Companies behind (Yahoo!, Microsoft, Google, IBM, ...)\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Spidermonkey now looks more C++ now but its API are still in C\nComplex Webkit naming\nTrident: Windows only\n
  • \n
  • SpiderMonkey: Narwhal, CouchDB, MongoDB, JSDB, APE, GPSEE, SpiderNode, ...\nJavaScriptCore: Narwhal, Wakanda\nV8: Narwhal, v8cgi, Akshell, Node.js\nRhino: Narwhal, Helma / RingoJS, AppJet, Persevere, Phobos, RhinodeII, ...\nTrident / Chackra: ASP, WSH, .NET, IronJS, Node.NET\n
  • \n
  • The growth of WebApps with Ajax Frameworks requires more powerful engines \n-> Browsers War II.\n
  • Ici, on compare JS avec d’autres technologies : Persevere et son js faisaient plus de req/s que php par exemple\n
  • \n
  • \n
  • The core engines running on the server have finally reach acceptable performances, with quite comparable results.\nThey all actively continue their own performance enhancement.\nECMAScript 5 in strict mode also help to provide better internal optimizations.\n \n
  • \n
  • Juste en travaillant sur le moteur lui même a fait d’énormes gains jusque la 185, puis en ajoutant leur JIT, hop, ils divisent les temps d’exéc. par 4.\n\n“les autres ont fait pareil dans le même temps etc...” (next slide)\n
  • \n
  • These solutions were mostly the ones which made JavaScript survive on the server\nAll missing stuff were covered by the environment in which they are running.\nIt’s then easy to make it’s application platform dependent which often what front-end JavaScript developers want to prevent.\n-> so then came the work on standards for the “missing stuff” ;-)\n
  • “JavaScript” is available in all modern mobile phones, tablets, Internet box, and even some remote control and TVs.\n- It is quite everywhere, but, back on the server, the JS engines only provide the Core of the language, mostly as defined by ECMAScript with ongoing features. \n- Ajax, Web 2.0, & HTML5 provided a very large & active open source community (first community on Github)\n- At least 4 important Working Groups are doing their best to make it better and better.\n- Common JavaScript oriented implementations want to enhance interoperability between each of them, hopefully more quickly than how it came on client-side.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \nNPM: Author ?\nCPM: by Kris Zyp\nPINF: by Christoph Dorn\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

State of the art - server side JavaScript - web-5 2012 Presentation Transcript

  • 1. STATE OF THE ARTSERVER-SIDE JAVASCRIPT Web-5 2012-04-05
  • 2. PRESENTATION Alexandre Morgaut Web Architect / Community Manager Creator of @NantesJS @amorgaut
  • 3. HISTORY
  • 4. BIRTH• 1995 Brendan Eich Mocha > LiveScript > JavaScript (NS2) JavaScript creator• 1996 Microsoft JScript (IE4) NetScape Enterprise Server 2 aka LiveWire/iPlanet• 1997 ECMAScript 1 “DHTML” Windows IIS 3
  • 5. The “JavaScript” name is trademarked by Oracle (via Sun)
  • 6. MATURITY• 1998 - HTML/XML DOM, Sun/Mozilla Rhino• 1999 - ECMAScript 3, XMLHttpRequest, HTML 4• 2000 - ActionScript, Helma Hop• 2001 - JSON, Apple JavaScript OSA• 2002 - JSLint, Mozilla “Phoenix” > Firefox• 2003 - JavaScript Adobe Press, JScript .NET• 2004 - E4X , “Web 2.0”, JSDB• 2005 - Prototype.js, “Ajax”• 2006 - Firebug, jQuery, “Comet”, APE, “HTML5”• 2007 - SitePoint Persevere, Rhino on Rails
  • 7. SSJS: THE COME BACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack ServerJS > CommonJS Node.js v8cgi, GPSEE ECMAScript 5• 2010 Helma NG > RingoJS Sun Phobos• 2011 Wakanda CoffeeScript ECMAScript 5.1
  • 8. SSJS: THE COME BACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack ServerJS > CommonJS Node.js v8cgi, GPSEE ECMAScript 5• 2010 Helma NG > RingoJS Sun Phobos• 2011 Wakanda CoffeeScript ECMAScript 5.1
  • 9. SSJS: THE COME BACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack ServerJS > CommonJS Node.js v8cgi, GPSEE ECMAScript 5• 2010 Helma NG > RingoJS Sun Phobos• 2011 Wakanda CoffeeScript ECMAScript 5.1
  • 10. SSJS: THE COME BACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack ServerJS > CommonJS Node.js v8cgi, GPSEE ECMAScript 5• 2010 Helma NG > RingoJS Sun Phobos• 2011 Wakanda CoffeeScript ECMAScript 5.1
  • 11. SSJS: THE COME BACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack ServerJS > CommonJS Node.js v8cgi, GPSEE ECMAScript 5• 2010 Helma NG > RingoJS Sun Phobos• 2011 Wakanda CoffeeScript ECMAScript 5.1
  • 12. 60+ EXISTING SOLUTIONShttp://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions
  • 13. ECOSYSTEM
  • 14. COMMUNITYhttp://www.communityjs.org/
  • 15. LIBRAIRIES & FRAMEWORKShttps://github.com/languages/JavaScript http://javascriptlibraries.com/
  • 16. DEVELOPMENT ENVIRONMENTS• Visual Studio• XCode• Eclipse• NetBeans • Wakanda Studio • Cloud9
  • 17. DEBUGGERSClient-side • Firebug * • Web Inspector * • DragonflyServer-Side • Wakanda Debugger * • Cloud9 Debugger * * via standard protocols, some debugger can debug JS code running anywhere (server, desktop, mobile, ...)
  • 18. ECMASCRIPT 5 & NEXT• ES5.1 • ES.Next • Mode strict • Typed Array • Object freeze • Modules • Read only properties • Destructuring • Getter / setter • String templates • More native methods • ...
  • 19. TOOLS & STANDARDS• JSLint / JSHint / JavaScriptLint• JSON / JSON-Schema / JSONQuery / JSON-RPC• JSDoc / ScriptDoc• JSON View• JSMin / Packer / YUI Compressor / Dojo Shrinksafe• YUI Test / QUnit / Jasmine / Mocha / Selenium• NPM / CPM• RequireJS (r.js)• PhantomJS
  • 20. JAVASCRIPT EVERYWHERE
  • 21. ENGINES
  • 22. C+ C + SpiderMonkey webkit JavaScriptCore: JSC 3 JIT Compilers: SquirrelFish Extreme: SFX aka Nitro TraceMonkey, (JIT Compiler inside) JägerMonkey, IonMonkey Jav C+ a + Rhino V8 Interpreted or Compiled execution JIT Compiler: CrankShaftNashorn? ? Trident: MSHTML Chakra -> Classic JScript, Managed JScript, & JScript.NET C+ ? + Tamarin Carakan JIT Compiler: NanoJIT -> ActionScript / “ECMAScript 4” Previously: Linear A, Linear B, Futhark
  • 23. CLIENT-SIDESpiderMonkey JavaScriptCore Rhino V8 Tamarin Trident / Chakra Carakan / Futhark
  • 24. SERVER-SIDESpiderMonkey JavaScriptCore Rhino V8 Trident / Chakra
  • 25. BENCHMARKS and what they worth....
  • 26. BROWSERS WAR II (MAY 2009)http://www.maximumpc.com/article/features/browser_brouhaha_your_maximum_guide_browsers_today_and_tomorrow?page=0,6
  • 27. PERSEVERE & JAVASCRIPTDB (APRIL 2009) http://www.sitepen.com/blog/2009/04/20/javascriptdb-perseveres-new-high-performance-storage-engine/
  • 28. NODE VS THIN VS NARWHAL (SEPTEMBER 2009) 300 concurrent clients completed requests: thin 36045 node 35668 narwhal 2921 > summary(node300$ttime) Min. 1st Qu. Median Mean 3rd Qu. Max. 12.0 66.0 112.0 239.4 157.0 12200.0 > summary(thin300$ttime) Min. 1st Qu. Median Mean 3rd Qu. Max. 71.0 84.0 87.0 208.7 107.0 23950.0 > summary(narwhal300$ttime) Min. 1st Qu. Median Mean 3rd Qu. Max. 928 2837 2935 2921 3018 8759 http://four.livejournal.com/1019177.html
  • 29. RINGOJS VS NODEJS (SEPTEMBER 2010) http://hns.github.com/2010/09/21/benchmark.html
  • 30. SUNSPIDER 0.9.1 (AUGUST 2011) 7 8 6 5 4 3 2 1http://expansive-derivation.ossreleasefeed.com/2011/08/javascript-performance-test-results-with-sunspider/
  • 31. EMSCRIPTEN TESTS (OCTOBER 2011)!"#$%&($)(*+,$-."/0 +((,--#+..(./(012&.(+03)4&1*0.%5$12,23 $ ! 677,84#$4#$4#$4#$4#$4#$4#$4#$4#$4#$4 ! 91:13$4#$4#$4#$4#$4#$4#$5#$5#$5#$6#$6 ! ;$1213$4#$4#$4#$5#$5#$5#$5#$5#$5#$7#$8 ! <1#=)223$4#$4#$5#$5#$5#$5#$6#$9#$: ! 6>3$4#$4#$5#$5#$5#$5#$6#$6#$7#$;#$45 ! << ! 91:1;$%&(3$5#$5#$6#$9#$9#$;$$$$$$$$=">?$12,2#$*",$(&"",">,@ ! << ! ?@(+.*3$4#$6#$:#$6:#$75#$7A#$A4#$:4#$;7#$44B ! A/4@3$7#$:#$;#$54#$5:#$9B#$:A#$;4#$44B#$54A !"#$%&()* http://syntensity.com/static/jsconf_eu_Emscripten_lo.pdf
  • 32. SPIDERMONKEY 1.5 is ~ Firefox 2.0 (and ES-3) 1.7 is ~ Firefox 3.0 1.8 is ~ Firefox 3.6 1.8.5 + JITs is ~ Firefox 4http://www.page.ca/~wes/SpiderMonkey/Perf/sunspider_history.png
  • 33. MAIN CONCEPTS
  • 34. INTEGRATION-ORIENTED • PHP (J2PA, V8JS)- using Rhino like with - Helma, Persevere, Narwhal, RingoJS, • C (GPSEE), Sun Phobos...- Oracle Nashorn? • Objective C (iMonkey), • Ruby (Johnson),- using JScript.NET like with - IronJS, Node.NET • Perl (JE), …
  • 35. COMMON JAVASCRIPT• Working Groups: - ECMA TC39 - W3C - WHATWG - CommonJS• Ubiquity beyond ECMAScript• HTML5 specification was also known as: “Web Applications 1.0” http://www.whatwg.org/specs/web-apps/current-work/• Asynchronous & Synchronous APIs
  • 36. ASYNC. EVENT-BASED• Browser’s Event-Loop on the Server• An Event Loop in one single thread• Cooperative («one at a time») with async. callbacks• Node.js (V8), SpiderNode, RhiNodeII, Node.NET
  • 37. SINGLE & MULTI THREADING One global context per threadSINGLE MULTI• Low memory usage • Vertical scalability (multi-core)• Potentially handle lot of requests • Thread-safety for concurrent access• Cooperative • Preemptive: Parallel code execution• Shared context • Allow Synchronous APIs• Use mostly one core* • Uses easily all available cores Notes: - an event loop can generate some other threads which could use other cores - multi-thread architectures can run event loops in some of their threads
  • 38. DATA-DRIVEN • Document Store • Object Store • Key/value Store • Push engineSee also: JSDB, JavaScriptDB
  • 39. APIS - PACKAGES
  • 40. COMMONJS • Modules • Packages• System • Binary • Stream• Unit-Testing • File• Promises • JSGI http://wiki.commonjs.org/wiki/CommonJS
  • 41. NODE ASYNC APIS• Buffer • Net • Streams• Events • OS • Timers• File • Process • ... http://nodejs.org/docs/v0.5.5/api/
  • 42. W3C / HTML5 / ES.NEXT & OTHER STANDARDS• Console • Typed Arrays• Blob, Blob URL • Web Sockets• DataView • Web Storage, Indexed DB• File / FileSystem • Web Workers• Modules • XHR 2• Progress Events • DOM, E4X• Structured clones • Messages
  • 43. PACKAGES & MODULES• github: CommonJS modules in projects (Persevere, Narwhal, RingoJS, ...)• NPM: Node Package Manager (thousands packages)• CPM: CommonJS Package Manager (new)• PINF: Universal module loader
  • 44. IN PRODUCTION NOW!
  • 45. DEMANDWAREMany shops run on SSJS viaDemandware’s commerce platform: London 2012 olympics shop Puma sneaker ...It uses Mozilla Rhino http://jsconf.eu/2010/speaker/server-side_javascript_the_unt.html
  • 46. NEOLANENeolane, a desktop applicationwritten in C++, is used by clientsbut also by integrators & partnerswho need to be able to add theirown codeJavaScript was chosen because it is awell-known interpreted languageThe JavaScript engine isSpiderMonkey http://www.neolane.com
  • 47. MTV• Current deployments include • SpikeTV.com • Comedy Central Indecision,• MTV Networks will be rolling out MongoDB on many other major sites http://www.mongodb.org/display/DOCS/Production+Deployments
  • 48. VOXERVoxer is a next generation application forvoice and text messaging“Node.js dramatically outperformed theprevious solution we had written in Python”Matt Rainey, RebelVox CTO http://voxer.com/
  • 49. HAPPY MEEPLEUsing APE projectSynchronization between usersReuse JavaScript code on client andserver to have the same intelligencewhen online and offline http://www.happymeeple.com
  • 50. FINANCIAL DATA REPORTSUsing WakandaDeployed on employees iOS,Android, & Blackberry smartphonesProvides historical sales and invoicesreports in PDF
  • 51. THANK YOU Come with us at San Jose, CA on October 26th: @jseverywhere http://jseverywhere.orgAlexandre Morgaut - @amorgaut Call to speaker just started!!!