jRuby

by Hubert Łępicki

@hubertlepicki

jRuby

  • implementation of Ruby on JVM
  • compatible with 2.0 syntax
  • no GIL
  • threads
  • runs on windows
  • deploys to Java infrastructure

Problems

  • slow startup time
  • incompatible gems / libraries
  • somehow lags behind in features compared to MRI

Advantages over MRI

  • access to Java & JVM libraries/frameworks
  • allows access to Ruby from Java & JVM
  • integrates with Java montioring/profiling tools

Cool jRuby projects

  • Torquebox
  • vert.x
  • puma

What about hosting?

  • Heroku!
  • Any Java hosting really
  • Any dedicated hosting
  • Any VPS

Just have enough RAM

Torquebox

http://torquebox.org

Vert.x

http://vertx.io

 

Synchronous vs Async

  • i/o  and database access APIs
  • message bus
  • integration with JavaScript
  • clustering

Ruby web servers

  • Threads!
  • Threads :(
  • Puma
  • Trinidad
  • Jubilee

Performance

  • JIT
  • slow startup
  • slow warmup
  • suddenly insanely fast

Project Gral

 

"The aim of this project is to expose VM functionality via Java APIs. Namely, we want to make it feasible to write in Java a dynamic compiler and interpreter for a language runtime. These components will seamlessly integrate and leverage existing VM infrastructure (e.g., HotSpot)."

Truffle

"The Truffle runtime of JRuby is an experimental implementation of an interpreter for JRuby using the Truffle AST interpreting framework and the Graal compiler. (...) The goal is to be both significantly faster and simpler than other high performance implementations of Ruby."

Try it out

rvm install jruby

Thank you!

jRuby

By Hubert Łępicki

jRuby

  • 1,461