SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
JRuby
http://www.jruby.org



    Amit Solanki
     http://vinsol.com
     amit@vinsol.com
Problems with Ruby

• Green threading
  • No scaling across processors

• Partial Unicode support
  • Internet connected application needs solid unicode support
  • No native support for unicode or multibyte string
  • Rails 1.2 introduced ActiveSupport:Multibyte

• Performance
  •   Interpreted not compiled
  •   Ruby considered “fast enough”
  •   ... but routinely finishes last in benchmark
  •   ... and no work being done in 1.8 to improve
Features missing from Java


• Closures
• Open classes and metaprogramming
• Array, Hash, Regexp literals
• Duck-typing
Introduction to JRuby


• 100% pure java implementation of ruby
  • current version 1.1 RC 1
  • based on ruby 1.8.6 (MRI)
• Originally created by Jan Arne Petersen, in
  2001
  • direct port of ruby 1.6 C code
• Developed by JRuby Team
  • 6 core developers right now
  • open source developers
  • full support from Sun Microsystems
Features

• Running on JVM provides
  • Native threads
  • Unicode Support
  • Portability
• Most builtin ruby classes provided
• Wide variety of GC options
  • Concurrent
  • Generational
  • Real-time
• Scalability with native threading
  (Ruby Thread <=> Java Thread)
  • assign work to multiple processors
  • better performance at I/O & context-switching operations
Features (contd...)

• Support with interacting with and defining
    java classes from within ruby
    • full two way access between the two
• Interpreted, compiled and mixed mode Bean
    Scripting Framework (BSF) support
•   Distributed under tri-license (CPL/GPL/
    LGPL)
•   Support for rubygems, mongrel and (J)Ruby
    on Rails
•   Domain Specific Language (DSL)
JRuby Compiler


• Ahead Of Time (AOT)
  • compile .rb file to .class file
  • directly executable, or require/loadable
• Just In Time (JIT)
  • heavily hit methods compiled at runtime
  • run existing applications, scripts without modification
  • optimize methods generated at runtime
• Incremental design
  • fall back on interpreter for unimplemented bits
Demo
Example

hello_world.rb
Example

testJava.rb
Example

bench_fib_recursive.rb
Comparison:
JRuby vs Ruby
Performance & Stability

• JRuby 1.1 - fastest way to run Ruby 1.8 &
    Rails
•   Better garbage collection mechanism
•   Dynamic optimization
•   Mix-mode virtual machine: compiled JRuby
    • JRuby Compiler
• Mode:
    • Interpret
    • Just-in-time (JIT)
    • Ahead-of-time (AOT)
Use Cases

• Scripting
  • JVM too long to start
  • console clunky when jruby and ruby used together
• Client-side application
  • app runs long enough
  • swings getting pretty fast
• Server-side application
  •   server JVM optimizes app at runtime
  •   lots of great servers: Glassfish, JBoss, Oracle, Tomcat, Jetty ...
  •   great monitoring tools
  •   deployment via WAR file
Downsides

• Slow development
• Not enough documentation
• Missing POSIX methods
  • filesytem support (symlinks, stats, chmod, chown)
  • process control
  • JNA library + JRuby = True POSIX
• Database support
  • ActiveRecord-JDBC still needs more work
• Rmagick support is in progress
• Ruby C extensions, system calls
• Does not support continuations/binding
Core Developers

• Charles Oliver Nutter (Sun Microsystens)
  http://headius.blogspot.com

• Thomas Enebo (Sun Microsystems)
  http://www.bloglines.com/blog/ThomasEEnebo/

• Nick Sieger (Sun Microsystems)
  http://blog.nicksieger.com/

• Ola Bini(Thoughtworks)
  http://ola-bini.blogspot.com/

• Marcin Mielzynski
• Bill Dortch
Live Implementions

• Media Cast - A media file hosting application
    http://mediacast.sun.com/
• Sonar - A free enterprise quality control tool for Java projects
    http://sonar.hortis.ch/
• Mingle - A project collaboration and management tool for Agile
    software development (Webserver: Jetty & DB Server: Derby)
    http://studios.thoughtworks.com/mingle-project-intelligence
• SpringBook - Web application to publish your springnote to website
    http://springbook.playmaru.net/?lang=en
• Openwferu - Open source ruby workflow and BPM engine
    http://openwferu.rubyforge.org/aq.html
• Oracle Mix
    https://mix.oracle.com/
Thank You



   (-:

Weitere ähnliche Inhalte

Was ist angesagt?

Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)OpenBlend society
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?Hiroshi SHIBATA
 
tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02Hiroshi SHIBATA
 
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)OpenBlend society
 
Migrate to JRuby
Migrate to JRubyMigrate to JRuby
Migrate to JRubyIan Yang
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the worldHiroshi SHIBATA
 
jLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoTjLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoTIván López Martín
 
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT CompilerGraal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT CompilerKoichi Sakata
 
Inside The Java Virtual Machine
Inside The Java Virtual MachineInside The Java Virtual Machine
Inside The Java Virtual Machineelliando dias
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the worldHiroshi SHIBATA
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled BundlerHiroshi SHIBATA
 
The JVM is your friend
The JVM is your friendThe JVM is your friend
The JVM is your friendKai Koenig
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard WayHiroshi SHIBATA
 
Garbage First and you
Garbage First and youGarbage First and you
Garbage First and youKai Koenig
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyHiroshi SHIBATA
 

Was ist angesagt? (19)

Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
 
20140925 rails pacific
20140925 rails pacific20140925 rails pacific
20140925 rails pacific
 
tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02
 
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
 
Migrate to JRuby
Migrate to JRubyMigrate to JRuby
Migrate to JRuby
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
2008-12 OJUG JCR Demo
2008-12 OJUG JCR Demo2008-12 OJUG JCR Demo
2008-12 OJUG JCR Demo
 
jLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoTjLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoT
 
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT CompilerGraal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT Compiler
 
Inside The Java Virtual Machine
Inside The Java Virtual MachineInside The Java Virtual Machine
Inside The Java Virtual Machine
 
Ruby On Rails Ecosystem
Ruby On Rails EcosystemRuby On Rails Ecosystem
Ruby On Rails Ecosystem
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
 
The JVM is your friend
The JVM is your friendThe JVM is your friend
The JVM is your friend
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard Way
 
Garbage First and you
Garbage First and youGarbage First and you
Garbage First and you
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
 

Andere mochten auch

Why JRuby? - RubyConf 2012
Why JRuby? - RubyConf 2012Why JRuby? - RubyConf 2012
Why JRuby? - RubyConf 2012Charles Nutter
 
J Ruby Kungfu Rails
J Ruby   Kungfu RailsJ Ruby   Kungfu Rails
J Ruby Kungfu RailsDaniel Lv
 
Abstraction of JRuby Kaigi2010
Abstraction of  JRuby Kaigi2010Abstraction of  JRuby Kaigi2010
Abstraction of JRuby Kaigi2010Koichiro Ohba
 
jRuby: The best of both worlds
jRuby: The best of both worldsjRuby: The best of both worlds
jRuby: The best of both worldsChristopher Spring
 
Focuslight, Jobs and OSS - HackGirls bar vol.2
Focuslight, Jobs and OSS - HackGirls bar vol.2Focuslight, Jobs and OSS - HackGirls bar vol.2
Focuslight, Jobs and OSS - HackGirls bar vol.2Koichiro Ohba
 

Andere mochten auch (8)

Why JRuby? - RubyConf 2012
Why JRuby? - RubyConf 2012Why JRuby? - RubyConf 2012
Why JRuby? - RubyConf 2012
 
S
SS
S
 
J Ruby Kungfu Rails
J Ruby   Kungfu RailsJ Ruby   Kungfu Rails
J Ruby Kungfu Rails
 
Megyünk a Balcsira?
Megyünk a Balcsira?Megyünk a Balcsira?
Megyünk a Balcsira?
 
Abstraction of JRuby Kaigi2010
Abstraction of  JRuby Kaigi2010Abstraction of  JRuby Kaigi2010
Abstraction of JRuby Kaigi2010
 
Intro to J Ruby
Intro to J RubyIntro to J Ruby
Intro to J Ruby
 
jRuby: The best of both worlds
jRuby: The best of both worldsjRuby: The best of both worlds
jRuby: The best of both worlds
 
Focuslight, Jobs and OSS - HackGirls bar vol.2
Focuslight, Jobs and OSS - HackGirls bar vol.2Focuslight, Jobs and OSS - HackGirls bar vol.2
Focuslight, Jobs and OSS - HackGirls bar vol.2
 

Ähnlich wie Introduction to JRuby

J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The JvmQConLondon2008
 
Practical Intro Merb
Practical Intro MerbPractical Intro Merb
Practical Intro MerbPaul Pajo
 
JRuby - Enterprise 2.0
JRuby - Enterprise 2.0JRuby - Enterprise 2.0
JRuby - Enterprise 2.0Jan Sifra
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SEdogangoko
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platformdeimos
 
Modern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsModern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsRobert Glaser
 
Merb Camp Keynote
Merb Camp KeynoteMerb Camp Keynote
Merb Camp KeynoteYehuda Katz
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Application Architecture Trends
Application Architecture TrendsApplication Architecture Trends
Application Architecture TrendsSrini Penchikala
 
Rails hosting
Rails hostingRails hosting
Rails hostingwonko
 
Net Beans61 Ide
Net Beans61 IdeNet Beans61 Ide
Net Beans61 Idesatyajit_t
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBrian Sam-Bodden
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deploymentAbhishek Singh
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSEugene Lazutkin
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Charles Nutter
 

Ähnlich wie Introduction to JRuby (20)

J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
re7olabini
re7olabinire7olabini
re7olabini
 
L R U G - JRuby
L R U G - JRubyL R U G - JRuby
L R U G - JRuby
 
Practical Intro Merb
Practical Intro MerbPractical Intro Merb
Practical Intro Merb
 
JRuby - Enterprise 2.0
JRuby - Enterprise 2.0JRuby - Enterprise 2.0
JRuby - Enterprise 2.0
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SE
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platform
 
Real World Technologies
Real World TechnologiesReal World Technologies
Real World Technologies
 
Modern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsModern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On Rails
 
Merb Camp Keynote
Merb Camp KeynoteMerb Camp Keynote
Merb Camp Keynote
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Application Architecture Trends
Application Architecture TrendsApplication Architecture Trends
Application Architecture Trends
 
Rails hosting
Rails hostingRails hosting
Rails hosting
 
Net Beans61 Ide
Net Beans61 IdeNet Beans61 Ide
Net Beans61 Ide
 
Why Java
Why JavaWhy Java
Why Java
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deployment
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
 

Kürzlich hochgeladen

Structuring and Writing DRL Mckinsey (1).pdf
Structuring and Writing DRL Mckinsey (1).pdfStructuring and Writing DRL Mckinsey (1).pdf
Structuring and Writing DRL Mckinsey (1).pdflaloo_007
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...daisycvs
 
Pre Engineered Building Manufacturers Hyderabad.pptx
Pre Engineered  Building Manufacturers Hyderabad.pptxPre Engineered  Building Manufacturers Hyderabad.pptx
Pre Engineered Building Manufacturers Hyderabad.pptxRoofing Contractor
 
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Falcon Invoice Discounting
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingNauman Safdar
 
BeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdfBeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdfDerekIwanaka1
 
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSCROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSpanmisemningshen123
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon investment
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 MonthsIndeedSEO
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon investment
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1kcpayne
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165meghakumariji156
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizharallensay1
 
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecJual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecZurliaSoop
 
Over the Top (OTT) Market Size & Growth Outlook 2024-2030
Over the Top (OTT) Market Size & Growth Outlook 2024-2030Over the Top (OTT) Market Size & Growth Outlook 2024-2030
Over the Top (OTT) Market Size & Growth Outlook 2024-2030tarushabhavsar
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperityhemanthkumar470700
 
Arti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdfArti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdfwill854175
 
Rice Manufacturers in India | Shree Krishna Exports
Rice Manufacturers in India | Shree Krishna ExportsRice Manufacturers in India | Shree Krishna Exports
Rice Manufacturers in India | Shree Krishna ExportsShree Krishna Exports
 

Kürzlich hochgeladen (20)

Structuring and Writing DRL Mckinsey (1).pdf
Structuring and Writing DRL Mckinsey (1).pdfStructuring and Writing DRL Mckinsey (1).pdf
Structuring and Writing DRL Mckinsey (1).pdf
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Pre Engineered Building Manufacturers Hyderabad.pptx
Pre Engineered  Building Manufacturers Hyderabad.pptxPre Engineered  Building Manufacturers Hyderabad.pptx
Pre Engineered Building Manufacturers Hyderabad.pptx
 
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
BeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdfBeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdf
 
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSCROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
 
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecJual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
 
Over the Top (OTT) Market Size & Growth Outlook 2024-2030
Over the Top (OTT) Market Size & Growth Outlook 2024-2030Over the Top (OTT) Market Size & Growth Outlook 2024-2030
Over the Top (OTT) Market Size & Growth Outlook 2024-2030
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperity
 
Arti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdfArti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdf
 
Rice Manufacturers in India | Shree Krishna Exports
Rice Manufacturers in India | Shree Krishna ExportsRice Manufacturers in India | Shree Krishna Exports
Rice Manufacturers in India | Shree Krishna Exports
 

Introduction to JRuby

  • 1. JRuby http://www.jruby.org Amit Solanki http://vinsol.com amit@vinsol.com
  • 2. Problems with Ruby • Green threading • No scaling across processors • Partial Unicode support • Internet connected application needs solid unicode support • No native support for unicode or multibyte string • Rails 1.2 introduced ActiveSupport:Multibyte • Performance • Interpreted not compiled • Ruby considered “fast enough” • ... but routinely finishes last in benchmark • ... and no work being done in 1.8 to improve
  • 3. Features missing from Java • Closures • Open classes and metaprogramming • Array, Hash, Regexp literals • Duck-typing
  • 4. Introduction to JRuby • 100% pure java implementation of ruby • current version 1.1 RC 1 • based on ruby 1.8.6 (MRI) • Originally created by Jan Arne Petersen, in 2001 • direct port of ruby 1.6 C code • Developed by JRuby Team • 6 core developers right now • open source developers • full support from Sun Microsystems
  • 5. Features • Running on JVM provides • Native threads • Unicode Support • Portability • Most builtin ruby classes provided • Wide variety of GC options • Concurrent • Generational • Real-time • Scalability with native threading (Ruby Thread <=> Java Thread) • assign work to multiple processors • better performance at I/O & context-switching operations
  • 6. Features (contd...) • Support with interacting with and defining java classes from within ruby • full two way access between the two • Interpreted, compiled and mixed mode Bean Scripting Framework (BSF) support • Distributed under tri-license (CPL/GPL/ LGPL) • Support for rubygems, mongrel and (J)Ruby on Rails • Domain Specific Language (DSL)
  • 7. JRuby Compiler • Ahead Of Time (AOT) • compile .rb file to .class file • directly executable, or require/loadable • Just In Time (JIT) • heavily hit methods compiled at runtime • run existing applications, scripts without modification • optimize methods generated at runtime • Incremental design • fall back on interpreter for unimplemented bits
  • 13. Performance & Stability • JRuby 1.1 - fastest way to run Ruby 1.8 & Rails • Better garbage collection mechanism • Dynamic optimization • Mix-mode virtual machine: compiled JRuby • JRuby Compiler • Mode: • Interpret • Just-in-time (JIT) • Ahead-of-time (AOT)
  • 14. Use Cases • Scripting • JVM too long to start • console clunky when jruby and ruby used together • Client-side application • app runs long enough • swings getting pretty fast • Server-side application • server JVM optimizes app at runtime • lots of great servers: Glassfish, JBoss, Oracle, Tomcat, Jetty ... • great monitoring tools • deployment via WAR file
  • 15. Downsides • Slow development • Not enough documentation • Missing POSIX methods • filesytem support (symlinks, stats, chmod, chown) • process control • JNA library + JRuby = True POSIX • Database support • ActiveRecord-JDBC still needs more work • Rmagick support is in progress • Ruby C extensions, system calls • Does not support continuations/binding
  • 16. Core Developers • Charles Oliver Nutter (Sun Microsystens) http://headius.blogspot.com • Thomas Enebo (Sun Microsystems) http://www.bloglines.com/blog/ThomasEEnebo/ • Nick Sieger (Sun Microsystems) http://blog.nicksieger.com/ • Ola Bini(Thoughtworks) http://ola-bini.blogspot.com/ • Marcin Mielzynski • Bill Dortch
  • 17. Live Implementions • Media Cast - A media file hosting application http://mediacast.sun.com/ • Sonar - A free enterprise quality control tool for Java projects http://sonar.hortis.ch/ • Mingle - A project collaboration and management tool for Agile software development (Webserver: Jetty & DB Server: Derby) http://studios.thoughtworks.com/mingle-project-intelligence • SpringBook - Web application to publish your springnote to website http://springbook.playmaru.net/?lang=en • Openwferu - Open source ruby workflow and BPM engine http://openwferu.rubyforge.org/aq.html • Oracle Mix https://mix.oracle.com/
  • 18. Thank You (-: