STATE OF THE ART     SERVER-SIDE JAVASCRIPT@amorgaut                  4d.com              2011-09-24
HISTORY
BIRTH•   1995    LiveScript/JavaScript•   1996    Microsoft JScript (IE4)    NetScape Enterprise Server 2    aka LiveWire/...
MATURITY•   1998 - DOM, Mozilla Rhino•   1999 - ES3, XMLHttpRequest, HTML 4•   2000 - ActionScript, Helma Hop•   2001 - JS...
SSJS: THE COMEBACK•   2008    Aptana Jaxer    CouchDB    Acid Test 3•   2009    Narwhal & Jack    GPSEE    ServerJS -> Com...
SSJS: THE COMEBACK•   2008    Aptana Jaxer    CouchDB    Acid Test 3•   2009    Narwhal & Jack    GPSEE    ServerJS -> Com...
SSJS: THE COMEBACK•   2008    Aptana Jaxer    CouchDB    Acid Test 3•   2009    Narwhal & Jack    GPSEE    ServerJS -> Com...
SSJS: THE COMEBACK•   2008    Aptana Jaxer    CouchDB    Acid Test 3•   2009    Narwhal & Jack    GPSEE    ServerJS -> Com...
60+ EXISTING SOLUTIONShttp://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions
ENGINES
C                                                   C+                                                                    ...
CLIENT-SIDESpiderMonkey           JavaScriptCore   Rhino                      V8 Tamarin   Trident / Chakra   Carakan / Fu...
SERVER-SIDESpiderMonkey                                  JavaScriptCore          Narwhal                                  ...
BENCHMARKS and what they worth....
BROWSERS WAR II                                           (MAY 2009)http://www.maximumpc.com/article/features/browser_brou...
PERSEVERE & JAVASCRIPTDB                                  (APRIL 2009) http://www.sitepen.com/blog/2009/04/20/javascriptdb...
NODE VS THIN VS NARWHAL          (SEPTEMBER 2009)                        300 concurrent clients                        com...
RINGOJS VS NODEJS       (SEPTEMBER 2010) http://hns.github.com/2010/09/21/benchmark.html
SUNSPIDER 0.9.1                               (AUGUST 2011)         7         8         6         5         4         3   ...
MAIN CONCEPTS
INTEGRATION-ORIENTED• Rhino  - Interaction with Java (APIs and objects)  - Helma, Persevere, Narwhal, RingoJS, Sun Phobos....
COMMON JAVASCRIPT•   Ubiquity not only for ECMAScript•   Server missing APIs•   Web Applications 1.0•   Asynchronous & Syn...
ASYNC. EVENT-BASED• Browser   Event-Loop on the Server• An   Event Loop in one single thread• Cooperative   («one at a tim...
SINGLE vs MULTI THREADING        One context per thread
SINGLE vs MULTI THREADING                               One context per threadSINGLE                                     M...
DATABASE-DRIVEN• Document         Store -   CouchDB, MongoDB• Object    Store -   Wakanda• Push     Store -   APE
APIS
COMMONJS•   Modules•   Packages                           •   Binary•   Promises                           •   File•   Sys...
NODE ASYNC APIS•   Buffer                     •   Process•   Events                     •   Streams•   File               ...
W3C / HTML5       & OTHER STANDARDS•   Console             •   Structured clones•   Blob, Blob URL*     •   Typed Arrays*•...
PACKAGES & MODULES• github: CommonJS        modules in forks (Persevere, Narwhal, RingoJS, ...)• NPM: Node   Package Manag...
STATE OF THE ART     SERVER-SIDE JAVASCRIPT                     The End                See us at Wakanday aka        JS.ev...
Upcoming SlideShare
Loading in...5
×

State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World Forum 2011

7,140

Published on

Presented at WebWorkersCamp IV during the Open World Forum 2011

Published in: Technology
1 Comment
9 Likes
Statistics
Notes
No Downloads
Views
Total Views
7,140
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
61
Comments
1
Likes
9
Embeds 0
No embeds

No notes for slide

Transcript of "State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World Forum 2011"

  1. 1. STATE OF THE ART SERVER-SIDE JAVASCRIPT@amorgaut 4d.com 2011-09-24
  2. 2. HISTORY
  3. 3. BIRTH• 1995 LiveScript/JavaScript• 1996 Microsoft JScript (IE4) NetScape Enterprise Server 2 aka LiveWire/iPlanet• 1997 ECMAScript 1 “DHTML” Windows IIS 3
  4. 4. MATURITY• 1998 - DOM, Mozilla Rhino• 1999 - ES3, XMLHttpRequest, HTML 4• 2000 - ActionScript, Helma Hop• 2001 - JSON, Apple JavaScript OSA• 2002 - JSLint• 2003 - JavaScript Adobe Press, JScript .NET• 2004 - E4X , “Web 2.0”• 2005 - Prototype, “Ajax”• 2006 - Firebug, jQuery, “Comet”, APE, “HTML5”• 2007 - SitePoint Persevere, Rhino on Rails
  5. 5. SSJS: THE COMEBACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack GPSEE ServerJS -> CommonJS Node.js ECMAScript 5• 2010 Helma NG -> RingoJS Sun Phobos• 2011 Wakanda
  6. 6. SSJS: THE COMEBACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack GPSEE ServerJS -> CommonJS Node.js ECMAScript 5• 2010 Helma NG -> RingoJS Sun Phobos• 2011 Wakanda
  7. 7. SSJS: THE COMEBACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack GPSEE ServerJS -> CommonJS Node.js ECMAScript 5• 2010 Helma NG -> RingoJS Sun Phobos• 2011 Wakanda
  8. 8. SSJS: THE COMEBACK• 2008 Aptana Jaxer CouchDB Acid Test 3• 2009 Narwhal & Jack GPSEE ServerJS -> CommonJS Node.js ECMAScript 5• 2010 Helma NG -> RingoJS Sun Phobos• 2011 Wakanda
  9. 9. 60+ EXISTING SOLUTIONShttp://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions
  10. 10. ENGINES
  11. 11. C C+ +SpiderMonkey webkit JavaScriptCore: JSC TraceMonkey (JIT) SquirrelFish Extreme: SFX (JIT) JägerMonkey (JIT) IonMonkey (JIT) Nitro C+ Jav + a Rhino V8 C+ + Trident Chakra C+ + C+ + Carakan Tamarin Futhark
  12. 12. CLIENT-SIDESpiderMonkey JavaScriptCore Rhino V8 Tamarin Trident / Chakra Carakan / Futhark
  13. 13. SERVER-SIDESpiderMonkey JavaScriptCore Narwhal Narwhal CouchDB, MongoDB Wakanda APE, GPSEE, SpiderNode ... V8 Narwhal Akshell Node.js Rhino Trident / Chakra Narwhal IronJS Helma / RingoJS, AppJet Node.NET Persevere, Phobos, RhiNodeII ...
  14. 14. BENCHMARKS and what they worth....
  15. 15. BROWSERS WAR II (MAY 2009)http://www.maximumpc.com/article/features/browser_brouhaha_your_maximum_guide_browsers_today_and_tomorrow?page=0,6
  16. 16. PERSEVERE & JAVASCRIPTDB (APRIL 2009) http://www.sitepen.com/blog/2009/04/20/javascriptdb-perseveres-new-high-performance-storage-engine/
  17. 17. 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
  18. 18. RINGOJS VS NODEJS (SEPTEMBER 2010) http://hns.github.com/2010/09/21/benchmark.html
  19. 19. 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/
  20. 20. MAIN CONCEPTS
  21. 21. INTEGRATION-ORIENTED• Rhino - Interaction with Java (APIs and objects) - Helma, Persevere, Narwhal, RingoJS, Sun Phobos...• JScript .Net - Interaction with MS .NET (APIs and objects) - IronJS, Node.NET
  22. 22. COMMON JAVASCRIPT• Ubiquity not only for ECMAScript• Server missing APIs• Web Applications 1.0• Asynchronous & Synchronous• Working Groups: - CommonJS - WHATWG - W3C - ECMA TC39
  23. 23. ASYNC. EVENT-BASED• Browser 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
  24. 24. SINGLE vs MULTI THREADING One context per thread
  25. 25. SINGLE vs MULTI THREADING One 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
  26. 26. DATABASE-DRIVEN• Document Store - CouchDB, MongoDB• Object Store - Wakanda• Push Store - APE
  27. 27. APIS
  28. 28. COMMONJS• Modules• Packages • Binary• Promises • File• System • JSGI• Unit-Testing • Stream http://wiki.commonjs.org/wiki/CommonJS
  29. 29. NODE ASYNC APIS• Buffer • Process• Events • Streams• File • Timers• Net • ...• OS http://nodejs.org/docs/v0.5.5/api/
  30. 30. W3C / HTML5 & OTHER STANDARDS• Console • Structured clones• Blob, Blob URL* • Typed Arrays*• DataView* • Web Sockets• File / FileSystem • Web Storage• Modules* • Web Workers• Progress Events • XHR 2
  31. 31. PACKAGES & MODULES• github: CommonJS modules in forks (Persevere, Narwhal, RingoJS, ...)• NPM: Node Package Manager (3600+ packages)• CPM: CommonJS Package Manager (new)• PINF: Universal module loader http://wiki.commonjs.org/wiki/CommonJS
  32. 32. STATE OF THE ART SERVER-SIDE JAVASCRIPT The End See us at Wakanday aka JS.everywhere(Boston, October, 15)@amorgaut 4d.com@thibarg Wakanda.org@wakanday Wakanday.org
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×