SlideShare a Scribd company logo
Ram Vijapurapu
  @rvijapurapu
What is JRuby?

Its just Ruby
Running on the JVM
(Java Virtual Machine)
Conclusion




..I truly wish it is that simple.



 Image credit: http://www.flickr.com/photos/hordurk/3204191929/
Social Context
Social Context
Social Context
Why do we want to go back to the
        Haunted House again?
● Reuse what's already built
                 Enterprise Ready
● Need of a Scalable Platform
                       ^
● Need for an inclusive Platform


   – Ruby, Groovy, Python, JS, ..
●
    Generally Love of Engineering
    Genius
What is the first thing you hear
            about Java?




Image credit: http://bit.ly/btxcPf
Common Man! Java is Slooow
●   Maybe... Maybe not!

     ACHTUNG! Highly Unscientific Testing
Common Man! Java is Slooow


              No
              Optimizations
Common Man! Java is Slooow
             100
Common Man! Java is Slooow
             1,000
Common Man! Java is Slooow
             10,000
Common Man! Java is Slooow
             100,000
Common Man! Java is Slooow
              100,000
What's your Point?
See Java is sl0000w!
st
                      a
Common Man! Java is Slooow
                    F
            1,000,000
st
                     F a
 Common Man! Java is Slooow
                     Fast




             1,000,000
Clearly you
fudged it!
You fudged it!
●   Maybe – but there is method in madness
You fudged it!
         Moral: Focus on your code
  ●   Maybe JVM there is care ofin madness
         & – but takes method the rest
         – well into the future




Performance Improvements in JVM from
1.5 to 1.6 have been significant. both are
running i386
What just happened?
●   Magic – JVM/Hotspot (Dark Magic?)
    ●   JIT (Just In Time Compilation) – Optimization on the
        Fly
    ●   Speaking further on this is beyond the scope of this
        presentation _


Summary: Normal usage on Web you will find
JRuby performs same as CRuby
As all good things in life........
       there are few limitations
●   You cannot use libraries which use CRuby
    Extensions
●   Java Threads
●   Posix Methods
●   Does not support continuations/bindings.
    (Feature Missing)
       http://docs.codehaus.org/display/JRUBY/Limitations
Same stuff – Different Different
●   ruby                     ●   jruby
●   Irb                      ●   jirb
●   rake                     ●   jruby -S rake
●   gem                      ●   jruby -S gem


     Include jruby-complete.jar or jruby.jar in
     your CLASSPATH & PATH for the
     executable
Show me stuff... JRuby
 integration with JVM




              Ruby'ized – by popular demand!
Choose your Hammer – Calling
   Ruby from within Java
Choose your Hammer – Calling
   Ruby from within Java




   JSR 223
Choose your Hammer – Calling
Ruby & Groovy from within Java
Choose your Hammer – Calling
Ruby & Groovy from within Java
         Why would we want to do
         this? Because we   can
Choose your Hammer – Calling
 JRuby file from within Java
Choose your Hammer – Calling
 JRuby file from within Java
Ruby > Java
Ruby > Java & Back




     [SNIPPED]
Ruby > Java & Back
Performance & External Libraries
●   For the sake of performance it would be better
    to use Java Libraries over JRuby at times.
    ●   Totally depends on your requirement.
●   Including external Java libraries within your
    JRuby Code is fairly straightforward
    ●   You can also put the jar files in the rails lib directory
        for getting access to them in your rails application
JfreeChart – Chart Generation
●   All you need to do is either have the jars in your
    classpath
●   Or include it in your libs folder in rails.




                 http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/
JRuby & Library Jars
This guy is boring why doesn't he
       just show me rails
The Holy Blog
...
...
DB Stuff
Packaging...
Packaging & Deploying




                   config/warble.rb
Voila
In Summary
●   I strongly believe JVM should be your platform
    Strategy
    ●   This more or less comes out of my experience.
    ●   JRuby will fit into many cloud architectures with little
        effort (Not sure of Azure yet)
        –   Portability from within
Useful Links
●   http://jruby.org/
●   http://www.infoq.com/vendorcontent/show.action?vc
●   http://code.google.com/p/appengine-jruby/ >
    http://rails-depot.appspot.com/
●   http://en.wikipedia.org/wiki/JRuby#Performance
Ram Vijapurapu
   @rvijapurapu
thinkbelievedo.com

More Related Content

PDF
JRuby Basics
PPTX
RJB - another choice for Ruby and Java interoperability
KEY
JRuby: What's Different (RORO Melbourne October 2011)
PPT
Jug dynamic languages_in_jvm
PPT
Inside the JVM
PDF
Object-Oriented Programming 1
PDF
How to debug mruby (rubyconftw2014)
PDF
20131102 kanjava lt_private
JRuby Basics
RJB - another choice for Ruby and Java interoperability
JRuby: What's Different (RORO Melbourne October 2011)
Jug dynamic languages_in_jvm
Inside the JVM
Object-Oriented Programming 1
How to debug mruby (rubyconftw2014)
20131102 kanjava lt_private

What's hot (14)

PDF
Opal chapter 4_a_new_hope
KEY
Opal - Ruby Style!! Ruby in the browser
PPT
XRuby_Overview_20070831
PDF
Moving to PHP from Java
KEY
MacRuby: What is it? and why should you care?
ODP
Extjs Howto
PDF
JRuby: The Hard Parts
PDF
Writing mruby Debugger
PDF
MacRuby
PDF
Over 9000: JRuby in 2015
PDF
Agile DSL Development in Ruby
KEY
Top 10+ Things .NET Developers Should Know About Ruby
PDF
JRuby - Programmer's Best Friend on JVM
KEY
The Ruby Racer: under the hood
Opal chapter 4_a_new_hope
Opal - Ruby Style!! Ruby in the browser
XRuby_Overview_20070831
Moving to PHP from Java
MacRuby: What is it? and why should you care?
Extjs Howto
JRuby: The Hard Parts
Writing mruby Debugger
MacRuby
Over 9000: JRuby in 2015
Agile DSL Development in Ruby
Top 10+ Things .NET Developers Should Know About Ruby
JRuby - Programmer's Best Friend on JVM
The Ruby Racer: under the hood
Ad

Viewers also liked (20)

PPT
Healthy nutrition rules
PPT
Blended learning
PPT
KNOWLEDGE INTENSIVE BUSINESS SERVICES NEL VENETO: UN’INDAGINE NELL’INDUSTRI...
PDF
Il laboratorio ComunicAbilità
PPT
音乐摇摆可乐罐
PPT
Technology In Our Schools Today
PPT
Prioritizing Process Improvement And Ignoring The Rating
PDF
Five Disruptive Forces that are Shaking Up Indian Pharma!
PPT
Career Portfolio
PDF
Exploring spatial pattern formation using a simple individual-based model
PPT
лето
PDF
Bloco K: Entenda as mudanças e prepare-se
PPT
20091217_EPE-B.Aigaiou_Tsigos
PPT
20130521 hsa maritime-week
PDF
Jupiterimages Roytalty-Free Catalog2
PDF
MedicinMan vol1 Issue 4; November 2011
PPTX
Content area read alouds
PDF
YouGO! Magazine - Wakacje 2014
PDF
Toronto Real Estate Housing Statistics May_2011
Healthy nutrition rules
Blended learning
KNOWLEDGE INTENSIVE BUSINESS SERVICES NEL VENETO: UN’INDAGINE NELL’INDUSTRI...
Il laboratorio ComunicAbilità
音乐摇摆可乐罐
Technology In Our Schools Today
Prioritizing Process Improvement And Ignoring The Rating
Five Disruptive Forces that are Shaking Up Indian Pharma!
Career Portfolio
Exploring spatial pattern formation using a simple individual-based model
лето
Bloco K: Entenda as mudanças e prepare-se
20091217_EPE-B.Aigaiou_Tsigos
20130521 hsa maritime-week
Jupiterimages Roytalty-Free Catalog2
MedicinMan vol1 Issue 4; November 2011
Content area read alouds
YouGO! Magazine - Wakacje 2014
Toronto Real Estate Housing Statistics May_2011
Ad

Similar to JRuby - The Perfect Alternative (20)

PPTX
Day 8 - jRuby
PDF
GlassFish can support multiple Ruby frameworks ... really ?
PDF
Glass fish rubyconf-india-2010-Arun gupta
PDF
Bitter Java, Sweeten with JRuby
KEY
Introduction to JRuby
PPT
Ruby On Google App Engine 2nd Athens Ruby Me
KEY
Euruko 2012 - JRuby
PDF
JRuby in the enterprise
PDF
Developing cross platform desktop application with Ruby
PPT
Practical JRuby
PDF
Ugo Cei Presentation
KEY
Jruby synergy-of-ruby-and-java
PDF
Introduction to JRuby
PDF
JRuby - Java version of Ruby
PDF
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
KEY
Aloha RubyConf 2012 - JRuby
KEY
Polyglot and Functional Programming (OSCON 2012)
PPTX
How we took our server side application to the cloud and liked what we got
PDF
Java notes | All Basics |
KEY
Why JRuby? - RubyConf 2012
Day 8 - jRuby
GlassFish can support multiple Ruby frameworks ... really ?
Glass fish rubyconf-india-2010-Arun gupta
Bitter Java, Sweeten with JRuby
Introduction to JRuby
Ruby On Google App Engine 2nd Athens Ruby Me
Euruko 2012 - JRuby
JRuby in the enterprise
Developing cross platform desktop application with Ruby
Practical JRuby
Ugo Cei Presentation
Jruby synergy-of-ruby-and-java
Introduction to JRuby
JRuby - Java version of Ruby
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
Aloha RubyConf 2012 - JRuby
Polyglot and Functional Programming (OSCON 2012)
How we took our server side application to the cloud and liked what we got
Java notes | All Basics |
Why JRuby? - RubyConf 2012

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Electronic commerce courselecture one. Pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Understanding_Digital_Forensics_Presentation.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Chapter 3 Spatial Domain Image Processing.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Big Data Technologies - Introduction.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Electronic commerce courselecture one. Pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...

JRuby - The Perfect Alternative

  • 1. Ram Vijapurapu @rvijapurapu
  • 2. What is JRuby? Its just Ruby Running on the JVM (Java Virtual Machine)
  • 3. Conclusion ..I truly wish it is that simple. Image credit: http://www.flickr.com/photos/hordurk/3204191929/
  • 7. Why do we want to go back to the Haunted House again? ● Reuse what's already built Enterprise Ready ● Need of a Scalable Platform ^ ● Need for an inclusive Platform – Ruby, Groovy, Python, JS, .. ● Generally Love of Engineering Genius
  • 8. What is the first thing you hear about Java? Image credit: http://bit.ly/btxcPf
  • 9. Common Man! Java is Slooow ● Maybe... Maybe not! ACHTUNG! Highly Unscientific Testing
  • 10. Common Man! Java is Slooow No Optimizations
  • 11. Common Man! Java is Slooow 100
  • 12. Common Man! Java is Slooow 1,000
  • 13. Common Man! Java is Slooow 10,000
  • 14. Common Man! Java is Slooow 100,000
  • 15. Common Man! Java is Slooow 100,000 What's your Point? See Java is sl0000w!
  • 16. st a Common Man! Java is Slooow F 1,000,000
  • 17. st F a Common Man! Java is Slooow Fast 1,000,000 Clearly you fudged it!
  • 18. You fudged it! ● Maybe – but there is method in madness
  • 19. You fudged it! Moral: Focus on your code ● Maybe JVM there is care ofin madness & – but takes method the rest – well into the future Performance Improvements in JVM from 1.5 to 1.6 have been significant. both are running i386
  • 20. What just happened? ● Magic – JVM/Hotspot (Dark Magic?) ● JIT (Just In Time Compilation) – Optimization on the Fly ● Speaking further on this is beyond the scope of this presentation _ Summary: Normal usage on Web you will find JRuby performs same as CRuby
  • 21. As all good things in life........ there are few limitations ● You cannot use libraries which use CRuby Extensions ● Java Threads ● Posix Methods ● Does not support continuations/bindings. (Feature Missing) http://docs.codehaus.org/display/JRUBY/Limitations
  • 22. Same stuff – Different Different ● ruby ● jruby ● Irb ● jirb ● rake ● jruby -S rake ● gem ● jruby -S gem Include jruby-complete.jar or jruby.jar in your CLASSPATH & PATH for the executable
  • 23. Show me stuff... JRuby integration with JVM Ruby'ized – by popular demand!
  • 24. Choose your Hammer – Calling Ruby from within Java
  • 25. Choose your Hammer – Calling Ruby from within Java JSR 223
  • 26. Choose your Hammer – Calling Ruby & Groovy from within Java
  • 27. Choose your Hammer – Calling Ruby & Groovy from within Java Why would we want to do this? Because we can
  • 28. Choose your Hammer – Calling JRuby file from within Java
  • 29. Choose your Hammer – Calling JRuby file from within Java
  • 31. Ruby > Java & Back [SNIPPED]
  • 32. Ruby > Java & Back
  • 33. Performance & External Libraries ● For the sake of performance it would be better to use Java Libraries over JRuby at times. ● Totally depends on your requirement. ● Including external Java libraries within your JRuby Code is fairly straightforward ● You can also put the jar files in the rails lib directory for getting access to them in your rails application
  • 34. JfreeChart – Chart Generation ● All you need to do is either have the jars in your classpath ● Or include it in your libs folder in rails. http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/
  • 36. This guy is boring why doesn't he just show me rails
  • 38. ...
  • 39. ...
  • 42. Packaging & Deploying config/warble.rb
  • 43. Voila
  • 44. In Summary ● I strongly believe JVM should be your platform Strategy ● This more or less comes out of my experience. ● JRuby will fit into many cloud architectures with little effort (Not sure of Azure yet) – Portability from within
  • 45. Useful Links ● http://jruby.org/ ● http://www.infoq.com/vendorcontent/show.action?vc ● http://code.google.com/p/appengine-jruby/ > http://rails-depot.appspot.com/ ● http://en.wikipedia.org/wiki/JRuby#Performance
  • 46. Ram Vijapurapu @rvijapurapu thinkbelievedo.com