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
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/