SlideShare a Scribd company logo
1 of 119
RingoJS: Server-Side Javascript
                      When Only Java Will Do
Darren Cruse                         darren.cruse@gmail.com

June 19, 2012
Agenda

✤   Server-Side Javascript? Ringo?

✤   The main difference between Ringo and Node

✤   Our Project At Elsevier...

✤   RingoJS (hands on)

✤   EtherealJS
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 your backgrounds

   You guys wouldn’t find them all equally funny either

I had to pick and choose which I thought you might enjoy

And this reminded me of how unique people’s technology
                   preferences are

And how they often reflect our unique personal experiences
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 my parts

                     are good ones.




                                        (from: my demented brain)
I remember a “software
engineering workshop” class.

    (not unlike this book)

  Where you had to learn a
different 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)
It’s absolutely understandable that we become
    attached to our programming languages.

Look how hard we work to get good at them.
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 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.
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 embellished
overheard 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?
                Why Server-Side Javascript?
Server Side Javascript?
Why?!!
I mean...
Server Side Javascript?
WTF Dude!!

                                     Why?
                Why Server-Side Javascript?
                  What do you mean why?
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***!!
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://en.wikipedia.org/wiki/Flatulence
    http://en.wikipedia.org/wiki/Brain_fart
   http://en.wikipedia.org/wiki/Fart_lighting
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 browser.
✤   Java became popular on the server.
✤   But now days node.js is bringing javascript to the server.!
✤   Plus: the browser's becoming practically an operating system of it's 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...
✤   It's looking like javascript is really becoming the write once anywhere
    language.
✤   Not java.
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.
                                 At least not yet.
OK so you’re anti-java now.
So you’re switching to node.js


                                           Well actually no.
                                            At least not yet.
                                 Right now I'm using Ringo.
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!

                      javascript is becoming a very
              productive part of the server side tool
                                               chain.
How So?
Because...

✤   JSON services

✤   plus JSON datastores

✤   along with Javascript's smooth handling of JSON




    These all take a weed wacker to unnecessary complexity in
                                     server side development.
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.
                             WebSphere Admin Console
Unnecessary Complexity?
What kind of unnecessary complexity?




           Excruciatingly painful unnecessary complexity.
                             WebSphere Admin Console
                          kind of unnecessary complexity.
Unnecessary Complexity?
What kind of unnecessary complexity?




          Excruciatingly painful unnecessary complexity.
                            WebSphere Admin Console
                         kind of unnecessary complexity.
So where does Ringo fit?
Ringo is a gateway drug
✤   Ringo is a gateway drug from Java to Javascript.
✤   Because it's 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.
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.
                                       I mean he liked Cobol.
                                   He passed away last year.
                                Like Java's going to someday.


Maybe.
No time soon though.

                                                      Bingo!
Bingo?
Ringo!
Ringo!

               www.ringojs.org
https://twitter.com/#!/ringojs
        http://hns.github.com/

                       Hannes Wallnöfer (lead developer)
The main difference between
node and ringo




       Hanne’s drawing stolen from: http://2011.wakanday.org/concurrent-ssjs/
The (other) main difference
between node and ringo




  Stolen from Oleg Podsechin’s Common Node talk at: http://www.slideshare.net/olegp
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” overstating
things?
Is “json/java impedance mismatch” overstating
things?
When we switched to ringo the same code
looked like this:
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.
How about this json java style - is it better?
Other languages?



(how about groovy?)
Would you call this a “json/groovy impedance
mismatch”?
Would you call this a “json/groovy impedance
mismatch”?
Javascript has an advantage for clear and readable
   code for projects making heavy use of JSON
Sidebar: this is what our next
generation project will look like:
But for multiple reasons we
couldn’t go there for our project



✤   Much legacy code that we did not have time to rewrite

✤   Including code that depended on Oracle tables!
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 real
question...




                  http://www.infoq.com/news/2012/02/websockets-rest
Nathan Evans asks the real
question...
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 have
gotten 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...
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 for
every 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 not
been 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 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.
With the idea that CommonJS
modules feel a little like “actors”
                    (but simpler)
 browser




ringo

        node.js

           smart phone
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
Thank You.
My Contact Info



✤   Darren Cruse
✤   darren.cruse@gmail.com
✤   (314)482-9237

More Related Content

Similar to RingoJS: Server-Side Javascript When Only Java Will Do

Workshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General OverviewWorkshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General OverviewVisual Engineering
 
Dear compiler please don't be my nanny v2
Dear compiler  please don't be my nanny v2Dear compiler  please don't be my nanny v2
Dear compiler please don't be my nanny v2Dino Dini
 
WebAssembly: Digging a bit deeper
WebAssembly: Digging a bit deeperWebAssembly: Digging a bit deeper
WebAssembly: Digging a bit deeperAll Things Open
 
JRuby - The Perfect Alternative
JRuby - The Perfect AlternativeJRuby - The Perfect Alternative
JRuby - The Perfect AlternativeRam Vijapurapu
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBrian Sam-Bodden
 
Happy Programming with CoffeeScript
Happy Programming with CoffeeScriptHappy Programming with CoffeeScript
Happy Programming with CoffeeScriptEddie Kao
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming languageMarco Cedaro
 
How we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotHow we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotBaruch Sadogursky
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with RubyAnis Ahmad
 
Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015Gregory Starr
 
Migrating Web SDK from JS to TS
Migrating Web SDK from JS to TSMigrating Web SDK from JS to TS
Migrating Web SDK from JS to TSGrigory Petrov
 
There Is No JavaScript
There Is No JavaScriptThere Is No JavaScript
There Is No JavaScriptNoam Kfir
 
Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015AboutYouGmbH
 
Server-Side JavaScript with Nashorn
Server-Side JavaScript with NashornServer-Side JavaScript with Nashorn
Server-Side JavaScript with NashornDaniel Woods
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptSpike Brehm
 
How we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotHow we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotBaruch Sadogursky
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsSpike Brehm
 
Raphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberRaphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberReact Conf Brasil
 

Similar to RingoJS: Server-Side Javascript When Only Java Will Do (20)

Workshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General OverviewWorkshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General Overview
 
Dear compiler please don't be my nanny v2
Dear compiler  please don't be my nanny v2Dear compiler  please don't be my nanny v2
Dear compiler please don't be my nanny v2
 
WebAssembly: Digging a bit deeper
WebAssembly: Digging a bit deeperWebAssembly: Digging a bit deeper
WebAssembly: Digging a bit deeper
 
JRuby - The Perfect Alternative
JRuby - The Perfect AlternativeJRuby - The Perfect Alternative
JRuby - The Perfect Alternative
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
Happy Programming with CoffeeScript
Happy Programming with CoffeeScriptHappy Programming with CoffeeScript
Happy Programming with CoffeeScript
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
 
How we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotHow we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we got
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with Ruby
 
Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015
 
Migrating Web SDK from JS to TS
Migrating Web SDK from JS to TSMigrating Web SDK from JS to TS
Migrating Web SDK from JS to TS
 
Groovy And Grails
Groovy And GrailsGroovy And Grails
Groovy And Grails
 
There Is No JavaScript
There Is No JavaScriptThere Is No JavaScript
There Is No JavaScript
 
Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015
 
Server-Side JavaScript with Nashorn
Server-Side JavaScript with NashornServer-Side JavaScript with Nashorn
Server-Side JavaScript with Nashorn
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScript
 
How we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotHow we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we got
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
 
Coffee script throwdown
Coffee script throwdownCoffee script throwdown
Coffee script throwdown
 
Raphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberRaphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React Fiber
 

Recently uploaded

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

RingoJS: Server-Side Javascript When Only Java Will Do

Editor's Notes

  1. \n
  2. I should warn you guys I think I’m good at writing but in general I think I’m not a good speaker.\nI’ve always liked to write and I think I kind of intuitively write my slides\nin a form that’s good for reading standalone.\nBut in some ways might be making these less good for presentation.\nI remember I gave a talk some years back.\nAnd my buddy later politely said “you were reading your slides.\nIt’s better if you just talk and let the slides be on their own you shouldn’t read them”.\nUnfortunately I’m sure I’ll do some of that tonite.\nEsp. since I’ve never given this talk before.\nI’m sure I’d do better if I gave the talk several times.\n\nThis is I think the 4th time I’ve presented at one of these groups.\nAnd I think the biggest thing I’ve realized is when it comes time to present.\nI need to remind myself to relax and say “WTF” - it doesn’t matter.\nBut that’s not always easy for me.\nWe all have different temperaments and personalities right.\nMy mom for example - no problem for her she can talk to anybody any group no matter how big.\n\nAlso I have no idea how long this presentation I’ve put together would take btw.\nI’m certain it’s going to run long.\nSo at some point near the end I will probably be asking you if you want to see more hands on with Ringo.\nOr if you’d like to hear about this open source project I’ve started.\nWhere selfishly I would like to hear your guys thoughts about what I’m doing and if it’s something you feel is worthwhile.\nBut another option is I volunteer again in 6 months or something to talk about Ethereal.\n\n\n\n
  3. \n
  4. \n
  5. \n
  6. When I picked out these pictures\nI didn’t find them all equally funny.\nAnd it struck that depending on each of your backgrounds\nYou guys wouldn’t find them all equally funny either\nI had to pick and choose which I thought you might enjoy\nAnd this reminded me of how unique people’s technology preferences are\nAnd how they often reflect our unique personal experiences\n
  7. When I picked out these pictures\nI didn’t find them all equally funny.\nAnd it struck that depending on each of your backgrounds\nYou guys wouldn’t find them all equally funny either\nI had to pick and choose which I thought you might enjoy\nAnd this reminded me of how unique people’s technology preferences are\nAnd how they often reflect our unique personal experiences\n
  8. When I picked out these pictures\nI didn’t find them all equally funny.\nAnd it struck that depending on each of your backgrounds\nYou guys wouldn’t find them all equally funny either\nI had to pick and choose which I thought you might enjoy\nAnd this reminded me of how unique people’s technology preferences are\nAnd how they often reflect our unique personal experiences\n
  9. When I picked out these pictures\nI didn’t find them all equally funny.\nAnd it struck that depending on each of your backgrounds\nYou guys wouldn’t find them all equally funny either\nI had to pick and choose which I thought you might enjoy\nAnd this reminded me of how unique people’s technology preferences are\nAnd how they often reflect our unique personal experiences\n
  10. When I picked out these pictures\nI didn’t find them all equally funny.\nAnd it struck that depending on each of your backgrounds\nYou guys wouldn’t find them all equally funny either\nI had to pick and choose which I thought you might enjoy\nAnd this reminded me of how unique people’s technology preferences are\nAnd how they often reflect our unique personal experiences\n
  11. When I picked out these pictures\nI didn’t find them all equally funny.\nAnd it struck that depending on each of your backgrounds\nYou guys wouldn’t find them all equally funny either\nI had to pick and choose which I thought you might enjoy\nAnd this reminded me of how unique people’s technology preferences are\nAnd how they often reflect our unique personal experiences\n
  12. When I picked out these pictures\nI didn’t find them all equally funny.\nAnd it struck that depending on each of your backgrounds\nYou guys wouldn’t find them all equally funny either\nI had to pick and choose which I thought you might enjoy\nAnd this reminded me of how unique people’s technology preferences are\nAnd how they often reflect our unique personal experiences\n
  13. When I picked out these pictures\nI didn’t find them all equally funny.\nAnd it struck that depending on each of your backgrounds\nYou guys wouldn’t find them all equally funny either\nI had to pick and choose which I thought you might enjoy\nAnd this reminded me of how unique people’s technology preferences are\nAnd how they often reflect our unique personal experiences\n
  14. \n
  15. \n
  16. If we watched your brains in an MRI machine while I showed you those pictures.\nAnd I could see the “pleasure centers” of your brain light up with what you found funny.\nI’d bet that from that information *alone*.\n I could figure out which of you guys were web developers and which of you guys had done SQL versus java etc. etc.\nAnd my point is I wouldn’t just see it in the “higher thinking” part of your brain.\nI would see it in the deep part of your brain.\nThe emotional, animal part of your brain.\nWe all have deep biases because of our unique experiences.\n
  17. If we watched your brains in an MRI machine while I showed you those pictures.\nAnd I could see the “pleasure centers” of your brain light up with what you found funny.\nI’d bet that from that information *alone*.\n I could figure out which of you guys were web developers and which of you guys had done SQL versus java etc. etc.\nAnd my point is I wouldn’t just see it in the “higher thinking” part of your brain.\nI would see it in the deep part of your brain.\nThe emotional, animal part of your brain.\nWe all have deep biases because of our unique experiences.\n
  18. Brendan Eich\nI’ve turned him into a creep (sorry Brendan)\nOf course I’m referring to this book...\n
  19. Of course I’m referring to this book.\n
  20. And I couldn’t resist putting in this picture.\nHave you seen this?\nI found both this and the ryangoslingprogrammer site thru the lamdba lounge google group btw.\nI do find this picture funny.\nAnd not to rain on the parade, but I did want to point out that the very title of this popular book.\nBespeaks a certain negativity surrounding the language.\nAnd I’ve been using pretty heavily server side for the last year and a half or so.\nAnd I like it - I feel like most of the negativity comes from it being *different* than what most people are used to.\nNot from it being bad.\nAnd to drive the point home let’s return to those funny ryangosling pictures again...\n\n
  21. \n
  22. \n
  23. Perl is what really flipped the switch for me.\nWhen this guy was hired at this company I worked for.\nAnd started generating database reports in truly about a 5th the time it was taking me with C.\n
  24. \n
  25. \n
  26. It’s annoying because I’m not always the best at explaining things.\nI’m often just intuitive.\nSo it’s a challenge for me to answer this question.\nIt’s asking me to work.\nAnd try and convince someone of something.\nThat they quite possibly won’t be convinced of.\nBecause they’re background, biases, and experiences\nAre different than mine.\n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. I hope nobody’s offend by my language here btw.\n*I’m* not saying it.\nI’m playing a part here.\nThese two guys are arguing and it’s an expression of their frustration.\nMy mom never liked this argument either.\nThe f word is a taboo word right. It’s scary to break taboos.\nLike using javascript on the server.\nI don’t normally say the f word.\nBut here I’m not saying it I’m playing a part while I’m saying it.\n\n
  38. I don’t tweet or do facebook but I do know about like LOL and WTF.\nYou indian guys know about WTF right? Justin?\nThe indian guys are on average very polite btw.\nHere’s the wikipedia page...\nPlus...\n\n
  39. I didn’t realize you can find wikipedia pages on anything btw.\nI don’t know why I didn’t realize that. \nI always would look up technical things.\nI never made the connection with it being truly like a real encyclopedia.\nHere’s also the pages for a lot of other things I didn’t expect to be there.\n \nThey’ve got a page for the mother of all curse words the F word.\nThey’ve got a page on farts where you can see the chemical composition of farts.\nAnd from there you can segue to relate fart topics\nIncluding “Fart lighting” also known as “pyro flatulence”.\nWhich many people know from the classic american film “Blazing Saddles”\nBut I digress...\n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. So that’s an important question.\nWhat would it mean to say “javascript is the new java”?\nThat might be annoying statement to hard code java-only kinds of people.\nBut here’s my attempt at how one might support such a statement.\n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. John Kerry reference here.\nCan’t hear “flip-flopper” without thinking of John Kerry now days.\nHe should try and get like royalties or something on the work “flip flopper”.\n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \nYou indian guys no what Bingo is?\n
  74. This was meant to be a punchy ending like in one of those commercials right.\nOf course it’s like one of those weird European commercials. Riccola!\nBut see I yell “Ringo” and now it’s ringing in your head.\nSo subliminally you’re going to want to use Ringo now.\nI’m no idiot.\n\n
  75. \n
  76. Ringo’s based on Rhino which has always had threads because it’s based on java.\ne.g. There’s a spawn keyword.\nAnd Ringo can deploy in a servlet container.\nWhere servlets have always had this thread per request model.\nWhere as a programmer you mostly write your code without thinking too hard that multiple requests may process in parallel under different threads.\nNode has support for threads now (e.g. threads a go go).\nBut the design of it’s inspired by things like EventMachine and Twisted in Python.\nWhich means non-blocking i/o.\nAnd events with callbacks. Events for everything including I/O.\nSo node has brought the single threaded non-blocking programming style of the browser to the server.\nWhile Ringo is really more comparable to other languages like Ruby or Python that have threads and blocking apis. \nRyan Dahl has said the node approach scales better at the high end because lots of threads that are blocked end up consuming a lot of memory.\nI should confess that I’ve still not written hardly any node code so take this with a grain of salt.\nBut to me it looks like an engineering tradeoff between ease of learning/ease of programming and scalability.\nIn other words, for projects that don’t need the extreme scalability of Twitter or Google, Ringo might provide a lower learning curve and still get the job done just fine.\nBut I guess it all depends on your background and your point of view which you prefer.\nAnd there are a lot of libraries and things in the node world now to simplify working with lots of callbacks.\n\n
  77. \n
  78. \n
  79. This is a pretty standard state of the art java/spring/hibernate architecture.\nOut project is kind of hub that offers up json services to a front end customer facing portal (on the left)\nPlus some admin screens - that also tend to use a lot of ajaxy/web-2.0/json stuff there.\nAnd then talk both JSON and XML services to the back end.\nSo very much a service based SOA type of architecture.\nBut heavily using JSON and RESTful services as it’s data transfer format.\n
  80. So by “converters” I’m really highlighting what I see as three kind of “programming models” being used here.\n(next slide) \n
  81. JSON is really a javascript object.\nPOJOs are java’s standard object.\nAnd relational tables are the third.\nThese are each kind of independent programming models.\nI mean if we were writing this stuff in LISP maybe LISP S-expression list things would be the primary data strucure.\nIf it was Perl it might have been hashmaps which at least in my Perl days were popular.\nLikewise Relational databases have their ways of thinking about problems.\nAnd certainly Spring popularized the idea that you could organize programs in java using simple objects without a lot of inheritance hierarchies and stuff.\nSo all three of these are in a sense different “programming paradigms” with their own idioms for how you solve problems in them. \n
  82. Now the idea of an “object-relational impedance mismatch” is well understood with databases.\nAnd hibernate is definitely seen as a good tool for dealing with that.\nSo no surprises there.\nBut I’m claiming there’s something at least a little similar on the left hand side too.\nAt least from the idealistic point of view that the code is harder to read and get right than it would be if that left arrow weren’t there.\n\n
  83. So here’s a flavor of what our java code for working with JSON tended to look like.\nMaps from String to Object are what JSON looks like.\nPlus Lists for arrays.\nThe constants aren’t necessary of course.\nBut I showed them here because our guys were using them.\nAnd of course that is a java idiom that developers are taught to do this\n(like I was too when I first learned C years ago)\n\n
  84. Here it is without those constants, and of course it makes the code a bit more readable.\nA bit closer to where you can see what the JSON is that this code is supposed to create.\n
  85. But here’s the javascript function for generating the same JSON error payload.\nAnd here you see exactly what you’re generating.\n\n
  86. So I feel the javascript version is a more readable and more likely-to-be-correct version.\n
  87. \n
  88. \n
  89. I would call it that.\nIt’s really a syntax-mismatch with groovy.\nGroovy has neat meta programming features where you can give different semantics to things by using for example the “missing method” technique.\nPlus they’ve made a lot of stuff optional like parenthese and stuff.\nSo here e.g. “name” is really a method/”missing method” that’s taking the argument “Colorado”.\nBut there’s limits to this technique.\nIt’s the grammar of the groovy language that would not allow them to truly embed JSON syntax directly in groovy without that breaking other things in the groovy language. \n
  90. \n
  91. \n
  92. so fewer boxes and fewer “conversions”\n\n
  93. \n
  94. So we didn’t wind up here overnight\nWe did the agile thing of learning a little bit more about Ringo \nIteration after iteration\nAnd ultimately wound up using it more and more.\nTo the extent now that we can do whole admin screens without using any spring mvc controller\ni.e. We do call out and use velocity from ringo\nThough ringo bundles mustache we just already had a standard of using velocity\nWe run ringo as a servlet filter and intercept all the reqests going through to spring\nso we can modify the json requests\nthe responses\nor even just completely take the place of the original spring mvc pipeline alltogether\nso this has a bit of an AOP flavor if you’re familiar - before advice/after advice/around advice\nWe’ve created a little ringo module where we can say “spring.inject” and inject one of our Spring services into a javascript module where we can call into those java “services” from javascript.\nAnd from there take advantage of hibernate as well no different than if we were in java.\nEsp. for a lot of our communication to these backend systems we’ve actually bypassed the original spring stack completely.\nAnd e.g. where those backends use XML SOAP services we’re actually hitting those SOAP endpoints RESTfully and working with the XML directly using Ringo’s E4X support.\n\n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. WebSockets bring a different set of constraints to web programming.\nThe fact that they’re bidirectional is the biggie.\nThat the server can now message the browser without the browser initiating.\nBut also that they’re not tied to the HTTP verbs or status codes.\nThat they’re just basic plumbing for sending messages.\n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. This explains why right now I’m not *that* interested in Vertex. \nI’m not really embracing the polyglot idea anymore.\nI think there’s leverage gained by not being polyglot.\nThis is in line with the idea of “mobile code”, or “code on demand” in a distributed environment.\nThese things require the same language across the nodes to really make a lot of sense.\n
  116. \n
  117. \n
  118. \n
  119. \n