ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
WHAT IS JRUBY?
... AND WHY I LIKE IT :)
/BalazsVarga @vbalazs
"JRuby is a100% Javaimplementation of the
Ruby programming language. Itis Ruby for the
JVM."
MIXED MODE ENGINE
Interpreter + JRubyJIT
AOT-compiled to Javabytecode
JIT:JustInTimecompile
AOT:Ahead-of-timecompile
JIT ALL THE THINGS (J.A.T.T ?)
JIT:JustInTimecompiler
HOW CAN I USE IT?
rvm installjruby
rbenvinstalljruby-X.Y.Z
$ruby-v
jruby1.7.11(1.9.3p392)2014-02-2486339bbon
JavaHotSpot(TM)64-BitServerVM1.8.0-b132+indy[darwin-x86_64]
$ruby-e"puts'hello'"
hello
HOW ABOUT WEBAPPS?
Embedded servers mostlybased on Jetty, Tomcat, JBoss and
Vertx (ex.: Puma, Trinidad, TourqueBox)
run with the server from the project
package in ajavaarchive (jar) and execute as ajavaapp
Standard javaservers like Jetty, Tomcat, JBoss, GlassFish,
WebLogic
Phusion Passenger (>=4.0) :)
Differentfeatures and performance butyou can easilyswitch
between them.
PERFORMANCE
JRuby: interpreted or AOTmode
JVM: clientor server mode
JIT:JustInTimecompiler
AOT:Ahead-of-timecompiler
THREADS & CONCURRENCY
THREADS & CONCURRENCY
Rubythread == Javathread == native thread
No GIL
Runtime is threadsafe (exceptsome core classes)
STARTUP TIME
Performance trade-off
DEBUGGING
Itworks :)
C EXTENSIONS, INCOMPATIBILITIES
cannotrun native C extensions
ActiveRecord-JDBC adapter (extension)
FFI ftw
FFI:Foreignfunctioninterface
FUTURE - TRUFFLE
experimentalimplementation usingGraaland Truffle
Graalis anew implementation of aJITcompiler in the
OpenJDK JVM
expose VM functionalityviaJavaAPIs
Truffle: AST(AbstractSyntax Tree) interpretingframework
SimonyiConference 2014
15 April2014
http://konferencia.simonyi.bme.hu
FUTURE DEVELOPMENT
https://github.com/jruby/jruby/wiki/SuccessStories
Sponsors over the years:
Sun Microsystems
ThoughtWorks
Engine Yard
RedHat(from 2012)
SUMMARY
Disadvantages
Slowlyfollows the Rubylang.
Incompatibilitywith C exts
Fewer developer
Advantages
Integration with Java
Performance
Brightfuture
QUESTIONS?

More Related Content

JRuby talk / 26.03.2014 / @vbalazs