Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
RingoJS: Server-Side Javascript                      When Only Java Will DoDarren Cruse                         darren.cru...
Agenda✤   Server-Side Javascript? Ringo?✤   The main difference between Ringo and Node✤   Our Project At Elsevier...✤   Ri...
But first
Something funny
Something funny(from http://programmerryangosling.tumblr.com/)
(from http://programmerryangosling.tumblr.com/)
(from http://programmerryangosling.tumblr.com/)
(from http://programmerryangosling.tumblr.com/)
(from http://programmerryangosling.tumblr.com/)
(from http://programmerryangosling.tumblr.com/)
(from http://programmerryangosling.tumblr.com/)
(from http://programmerryangosling.tumblr.com/)
(from http://programmerryangosling.tumblr.com/)
As I picked out those funny pics...           I didn’t find them all equally funny.And it struck that depending on each of ...
Experiences that determine what we like and don’t like.
Would you have gotten this one?              (from http://programmerryangosling.tumblr.com/)
How about this?              (from http://programmerryangosling.tumblr.com/)
I bet you’d get this...           Don’t believe that trash                         talk girl...                     all of...
I remember a “softwareengineering workshop” class.    (not unlike this book)  Where you had to learn adifferent language e...
It’s absolutely understandable that we become    attached to our programming languages.Look how hard we work to get good a...
I myself seem to like “dynamic” languages.Perl, Groovy, Ruby, Python, Javascript kind of languages.
And I find these user groups fun. Sometimes it’s fun to be around people who have similar               interests, and back...
The people who hear I’m doing server side javascript.           And ask an annoying question.
Why?
An odd way to answer...✤   In the style of:
The following is a highly embellishedoverheard bathroom conversation.
Server Side Javascript?
Server Side Javascript?Why?!!
Server Side Javascript?Why?!!I mean...
Server Side Javascript?Why?!!I mean...Server Side Javascript?
Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!!
Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!!                          Why?
Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!!                                     Why?          ...
Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!!                                     Why?          ...
Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!!                                     Why?          ...
http://en.wikipedia.org/wiki/WTF
http://en.wikipedia.org/wiki/WTF       http://en.wikipedia.org/wiki/F*ck        http://en.wikipedia.org/wiki/Fart    http:...
No I’m serious.
Why Server Side Javascript?
Because
Javascript is the new Java
Huh?
Is it true?✤   Java was supposed to be the write once run anywhere language.✤   But java applets never got popular in the ...
Back to the bathroom...
Back to the bathroom (conversation).
OK so you’re anti-java now.
OK so you’re anti-java now.So you’re switching to node.js
OK so you’re anti-java now.So you’re switching to node.js                                 Well actually no.
OK so you’re anti-java now.So you’re switching to node.js                                 Well actually no.               ...
OK so you’re anti-java now.So you’re switching to node.js                                           Well actually no.     ...
Ringo?
Because javascript ain’t the new java.                      At least not yet.
Because javascript ain’t the new java.                                    At least not yet.flip-flopper!
Because javascript ain’t the new java.                                    At least not yet.flip-flopper!                    ...
How So?
Because...✤   JSON services✤   plus JSON datastores✤   along with Javascripts smooth handling of JSON    These all take a ...
Unnecessary Complexity?
Unnecessary Complexity?What kind of unnecessary complexity?
Unnecessary Complexity?What kind of unnecessary complexity?           Excruciatingly painful unnecessary complexity.
Unnecessary Complexity?What kind of unnecessary complexity?           Excruciatingly painful unnecessary complexity.      ...
Unnecessary Complexity?What kind of unnecessary complexity?           Excruciatingly painful unnecessary complexity.      ...
Unnecessary Complexity?What kind of unnecessary complexity?          Excruciatingly painful unnecessary complexity.       ...
So where does Ringo fit?
Ringo is a gateway drug✤   Ringo is a gateway drug from Java to Javascript.✤   Because its javascript running on top of ja...
Java and Javascript together in the same program?
Java and Javascript together in the same program?That sounds like this...
Java and Javascript together in the same program?That sounds like this...
No way dude it’s more like this...
No way dude it’s more like this...
I like my Java just the way it is.                                     My grandpa likes Cobol.                            ...
Bingo?
Ringo!
Ringo!               www.ringojs.orghttps://twitter.com/#!/ringojs        http://hns.github.com/                       Han...
The main difference betweennode and ringo       Hanne’s drawing stolen from: http://2011.wakanday.org/concurrent-ssjs/
The (other) main differencebetween node and ringo  Stolen from Oleg Podsechin’s Common Node talk at: http://www.slideshare...
Switching gears:About our project at Elsevier(the one using Ringo)
Before Ringo...
Before Ringo...
Fisher-Price Architecture Diagram
Fisher-Price Architecture Diagram
Is “json/java impedance mismatch” overstatingthings?
Is “json/java impedance mismatch” overstatingthings?
When we switched to ringo the same codelooked like this:
Only in the javascript version do you see one for one between:      a. What the JSON service specification indicates       ...
How about this json java style - is it better?
Other languages?(how about groovy?)
Would you call this a “json/groovy impedancemismatch”?
Would you call this a “json/groovy impedancemismatch”?
Javascript has an advantage for clear and readable   code for projects making heavy use of JSON
Sidebar: this is what our nextgeneration project will look like:
But for multiple reasons wecouldn’t go there for our project✤   Much legacy code that we did not have time to rewrite✤   I...
But in time, we’ve wound up here:
RingoJS (hands on)
EtherealJS
From last year...                    http://www.infoq.com/articles/rest-soap
From this year...                    http://www.infoq.com/news/2012/02/websockets-rest
Nathan Evans asks the realquestion...                  http://www.infoq.com/news/2012/02/websockets-rest
Nathan Evans asks the realquestion...
Ethereal’s an experiment...
That responds to this question...(about the fate of REST)
With an answer...
That’s consistent
with the lack of hair on my head.
And Ethereal’s answer is...             (drum roll please)
Remote Procedure Calls
(disappointed?)
Remote Procedure Calls havegotten a bad name...✤   e.g. CORBA’s approach to distributed objects promised location    trans...
But things are changing...  (e.g. the browser’s getting threads in the form of web workers)
But things are changing...(so synchronous calls via xhr can now be done without blocking the user)
And an approach doesn’t have to be right forevery situation...              To be right for some.
And considering the tradeoffs,              RPCs have one big advantage:        They are dead simple to understand.
If we lived in a world where RPCs had notbeen invented...  The next 8 year old who learned to program - would!
The main ideas in Ethereal✤   REST is assuming a heterogenous system with different    nodes implemented in different lang...
With the idea that CommonJSmodules feel a little like “actors”                    (but simpler) browserringo        node.j...
Important Ringo and Rhino Links✤   Ringo:✤   http://ringojs.org/✤   http://groups.google.com/group/ringojs✤   http://hns.g...
Thank You.
My Contact Info✤   Darren Cruse✤   darren.cruse@gmail.com✤   (314)482-9237
RingoJS:  Server-Side Javascript When Only Java Will Do
RingoJS:  Server-Side Javascript When Only Java Will Do
Upcoming SlideShare
Loading in …5
×

RingoJS: Server-Side Javascript When Only Java Will Do

2,453 views

Published on

Slides for a talk I gave at the St. Louis Javascript User Group about server-side javascript, Ringo, and a preview of my work-in-progress project EtherealJS which aims for easy interop between ringo, browser, and node.js.

Published in: Technology
  • Be the first to comment

RingoJS: Server-Side Javascript When Only Java Will Do

  1. 1. RingoJS: Server-Side Javascript When Only Java Will DoDarren Cruse darren.cruse@gmail.comJune 19, 2012
  2. 2. Agenda✤ Server-Side Javascript? Ringo?✤ The main difference between Ringo and Node✤ Our Project At Elsevier...✤ RingoJS (hands on)✤ EtherealJS
  3. 3. But first
  4. 4. Something funny
  5. 5. Something funny(from http://programmerryangosling.tumblr.com/)
  6. 6. (from http://programmerryangosling.tumblr.com/)
  7. 7. (from http://programmerryangosling.tumblr.com/)
  8. 8. (from http://programmerryangosling.tumblr.com/)
  9. 9. (from http://programmerryangosling.tumblr.com/)
  10. 10. (from http://programmerryangosling.tumblr.com/)
  11. 11. (from http://programmerryangosling.tumblr.com/)
  12. 12. (from http://programmerryangosling.tumblr.com/)
  13. 13. (from http://programmerryangosling.tumblr.com/)
  14. 14. As I picked out those funny pics... I didn’t find them all equally funny.And it struck that depending on each of your backgrounds You guys wouldn’t find them all equally funny eitherI had to pick and choose which I thought you might enjoyAnd this reminded me of how unique people’s technology preferences areAnd how they often reflect our unique personal experiences
  15. 15. Experiences that determine what we like and don’t like.
  16. 16. Would you have gotten this one? (from http://programmerryangosling.tumblr.com/)
  17. 17. How about this? (from http://programmerryangosling.tumblr.com/)
  18. 18. I bet you’d get this... Don’t believe that trash talk girl... all of my parts are good ones. (from: my demented brain)
  19. 19. I remember a “softwareengineering workshop” class. (not unlike this book) Where you had to learn adifferent language every two weeks. I thought it was ridiculous.But I realize now what a good idea it was. (to force an open mind on a young brain)
  20. 20. It’s absolutely understandable that we become attached to our programming languages.Look how hard we work to get good at them.
  21. 21. I myself seem to like “dynamic” languages.Perl, Groovy, Ruby, Python, Javascript kind of languages.
  22. 22. And I find these user groups fun. Sometimes it’s fun to be around people who have similar interests, and backgrounds. You get the same jokes. Programming languages do form “communities”.But like at my company we’ve traditionally been a java shop.So it’s understandable that you meet people who are new to things like server-side javascript and node.
  23. 23. The people who hear I’m doing server side javascript. And ask an annoying question.
  24. 24. Why?
  25. 25. An odd way to answer...✤ In the style of:
  26. 26. The following is a highly embellishedoverheard bathroom conversation.
  27. 27. Server Side Javascript?
  28. 28. Server Side Javascript?Why?!!
  29. 29. Server Side Javascript?Why?!!I mean...
  30. 30. Server Side Javascript?Why?!!I mean...Server Side Javascript?
  31. 31. Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!!
  32. 32. Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!! Why?
  33. 33. Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!! Why? Why Server-Side Javascript?
  34. 34. Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!! Why? Why Server-Side Javascript? What do you mean why?
  35. 35. Server Side Javascript?Why?!!I mean...Server Side Javascript?WTF Dude!! Why? Why Server-Side Javascript? What do you mean why? YTF Not A**h***!!
  36. 36. http://en.wikipedia.org/wiki/WTF
  37. 37. http://en.wikipedia.org/wiki/WTF http://en.wikipedia.org/wiki/F*ck http://en.wikipedia.org/wiki/Fart http://en.wikipedia.org/wiki/Flatulence http://en.wikipedia.org/wiki/Brain_fart http://en.wikipedia.org/wiki/Fart_lighting
  38. 38. No I’m serious.
  39. 39. Why Server Side Javascript?
  40. 40. Because
  41. 41. Javascript is the new Java
  42. 42. Huh?
  43. 43. Is it true?✤ Java was supposed to be the write once run anywhere language.✤ But java applets never got popular in the browser.✤ Java became popular on the server.✤ But now days node.js is bringing javascript to the server.!✤ Plus: the browsers becoming practically an operating system of its own.✤ With threads and sockets and canvas graphics.✤ So java was supposed to be the write once run anywhere language.✤ But if your "anywhere" includes the browser...✤ Its looking like javascript is really becoming the write once anywhere language.✤ Not java.
  44. 44. Back to the bathroom...
  45. 45. Back to the bathroom (conversation).
  46. 46. OK so you’re anti-java now.
  47. 47. OK so you’re anti-java now.So you’re switching to node.js
  48. 48. OK so you’re anti-java now.So you’re switching to node.js Well actually no.
  49. 49. OK so you’re anti-java now.So you’re switching to node.js Well actually no. At least not yet.
  50. 50. OK so you’re anti-java now.So you’re switching to node.js Well actually no. At least not yet. Right now Im using Ringo.
  51. 51. Ringo?
  52. 52. Because javascript ain’t the new java. At least not yet.
  53. 53. Because javascript ain’t the new java. At least not yet.flip-flopper!
  54. 54. Because javascript ain’t the new java. At least not yet.flip-flopper! javascript is becoming a very productive part of the server side tool chain.
  55. 55. How So?
  56. 56. Because...✤ JSON services✤ plus JSON datastores✤ along with Javascripts smooth handling of JSON These all take a weed wacker to unnecessary complexity in server side development.
  57. 57. Unnecessary Complexity?
  58. 58. Unnecessary Complexity?What kind of unnecessary complexity?
  59. 59. Unnecessary Complexity?What kind of unnecessary complexity? Excruciatingly painful unnecessary complexity.
  60. 60. Unnecessary Complexity?What kind of unnecessary complexity? Excruciatingly painful unnecessary complexity. WebSphere Admin Console
  61. 61. Unnecessary Complexity?What kind of unnecessary complexity? Excruciatingly painful unnecessary complexity. WebSphere Admin Console kind of unnecessary complexity.
  62. 62. Unnecessary Complexity?What kind of unnecessary complexity? Excruciatingly painful unnecessary complexity. WebSphere Admin Console kind of unnecessary complexity.
  63. 63. So where does Ringo fit?
  64. 64. Ringo is a gateway drug✤ Ringo is a gateway drug from Java to Javascript.✤ Because its javascript running on top of java.✤ Ringo adds the CommonJS module system to Rhino.✤ Where Rhino is the tried and true been around forever javascript interpreter for the JVM.✤ With Rhino you can call into java code, just like with Groovy or JRuby or Clojure etc.✤ but with javascript - which is something we were doing a lot of anyway.✤ So there’s really not much to learn.
  65. 65. Java and Javascript together in the same program?
  66. 66. Java and Javascript together in the same program?That sounds like this...
  67. 67. Java and Javascript together in the same program?That sounds like this...
  68. 68. No way dude it’s more like this...
  69. 69. No way dude it’s more like this...
  70. 70. I like my Java just the way it is. My grandpa likes Cobol. I mean he liked Cobol. He passed away last year. Like Javas going to someday.Maybe.No time soon though. Bingo!
  71. 71. Bingo?
  72. 72. Ringo!
  73. 73. Ringo! www.ringojs.orghttps://twitter.com/#!/ringojs http://hns.github.com/ Hannes Wallnöfer (lead developer)
  74. 74. The main difference betweennode and ringo Hanne’s drawing stolen from: http://2011.wakanday.org/concurrent-ssjs/
  75. 75. The (other) main differencebetween node and ringo Stolen from Oleg Podsechin’s Common Node talk at: http://www.slideshare.net/olegp
  76. 76. Switching gears:About our project at Elsevier(the one using Ringo)
  77. 77. Before Ringo...
  78. 78. Before Ringo...
  79. 79. Fisher-Price Architecture Diagram
  80. 80. Fisher-Price Architecture Diagram
  81. 81. Is “json/java impedance mismatch” overstatingthings?
  82. 82. Is “json/java impedance mismatch” overstatingthings?
  83. 83. When we switched to ringo the same codelooked like this:
  84. 84. Only in the javascript version do you see one for one between: a. What the JSON service specification indicates b. What the code looks like, and c. What testing with a browser actually returns.
  85. 85. How about this json java style - is it better?
  86. 86. Other languages?(how about groovy?)
  87. 87. Would you call this a “json/groovy impedancemismatch”?
  88. 88. Would you call this a “json/groovy impedancemismatch”?
  89. 89. Javascript has an advantage for clear and readable code for projects making heavy use of JSON
  90. 90. Sidebar: this is what our nextgeneration project will look like:
  91. 91. But for multiple reasons wecouldn’t go there for our project✤ Much legacy code that we did not have time to rewrite✤ Including code that depended on Oracle tables!
  92. 92. But in time, we’ve wound up here:
  93. 93. RingoJS (hands on)
  94. 94. EtherealJS
  95. 95. From last year... http://www.infoq.com/articles/rest-soap
  96. 96. From this year... http://www.infoq.com/news/2012/02/websockets-rest
  97. 97. Nathan Evans asks the realquestion... http://www.infoq.com/news/2012/02/websockets-rest
  98. 98. Nathan Evans asks the realquestion...
  99. 99. Ethereal’s an experiment...
  100. 100. That responds to this question...(about the fate of REST)
  101. 101. With an answer...
  102. 102. That’s consistent
  103. 103. with the lack of hair on my head.
  104. 104. And Ethereal’s answer is... (drum roll please)
  105. 105. Remote Procedure Calls
  106. 106. (disappointed?)
  107. 107. Remote Procedure Calls havegotten a bad name...✤ e.g. CORBA’s approach to distributed objects promised location transparency but didn’t really deliver (network latency anyone?).✤ (normal) procedure calls are synchronous by nature.✤ In a single threaded environment (like the browser!) synchronous calls block the user...
  108. 108. But things are changing... (e.g. the browser’s getting threads in the form of web workers)
  109. 109. But things are changing...(so synchronous calls via xhr can now be done without blocking the user)
  110. 110. And an approach doesn’t have to be right forevery situation... To be right for some.
  111. 111. And considering the tradeoffs, RPCs have one big advantage: They are dead simple to understand.
  112. 112. If we lived in a world where RPCs had notbeen invented... The next 8 year old who learned to program - would!
  113. 113. The main ideas in Ethereal✤ REST is assuming a heterogenous system with different nodes implemented in different languages and using different tools.✤ What if you assumed javascript all around?✤ What if CommonJS modules could be "remote modules"?✤ So machine “A” could do a require and use a module running on machine “B” as easily as if it were on the local machine.
  114. 114. With the idea that CommonJSmodules feel a little like “actors” (but simpler) browserringo node.js smart phone
  115. 115. Important Ringo and Rhino Links✤ Ringo:✤ http://ringojs.org/✤ http://groups.google.com/group/ringojs✤ http://hns.github.com/✤ http://twitter.com/ringojs✤ Rhino:✤ http://www.mozilla.org/rhino/doc.html✤ http://www.mozilla.org/rhino/ScriptingJava.html
  116. 116. Thank You.
  117. 117. My Contact Info✤ Darren Cruse✤ darren.cruse@gmail.com✤ (314)482-9237

×