Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
Ruby Object is a Java Object
Defined Java class:
RubyBasicObject, RubyObject,
RubyModule, RubyString, RubyFixnum, etc.
For example...
Ruby Object
is a
Java Object
GC? there's nothing special
Let JVM work!
Not really.
Scanner
Parser
% jruby -S ast foo.rb
% ruby19 --dump=parsetree foo.rb
Scanner&Parser
JRuby JIT Compiler
AST Compiler
AOT Compiler
(jrubyc)
Generated from AST
org.jruby.compiler.ir.*
IR Builder and Compiler
org.jruby.interpreter.*
New JRuby Evaluator
require 'java'
allow to access Java resource
'include_package'
include Java package to the namespace
'include_class'
include Java Class to the namespace
You saw "Keynote - JRuby: Pony Show", right?
org.jruby.Ruby*.java
implements Ruby Core objects
org.jruby.Ruby*.java
org.jruby.ext.*
implements Extension objects
in Java
digest, zlib, mathn, socket, etc.
org.jruby.RubyString.java
org.jruby.RubyEncoding.java
org.jruby.RubyFixnum.java
org.jruby.RubyFloat.java
org.jruby.ast.*
represents Abstract Syntax Tree
org.jruby.lexer.*
org.jruby.parser.*
implements Ruby scanner and parser
generates one AST per one *.rb file
org.jruby.RubyThread.java
org.jruby.runtime.ThreadContext.java
org.jruby.internal.runtime.ThreadService.java
handles JRuby VM runtime information
org.jruby.internal.*
org.jruby.runtime.*
handles VM's runtime information
org.jruby.Main.java (entry point)
org.jruby.Ruby.java (VM implementation)
org.jruby.RubyInstanceConfig.java
JRuby VM instance and runtime settings
JRuby Interpreter
JRuby Interpreter
org.jruby.compiler.*
implements JRuby Compiler
JRuby Interpreter
JVM JIT Compiler
JVM
native machine code
dynamic Java bytecode generation
org.jruby.ant.*
implements Ant task which runs Rake task
lib/ruby/site_ruby/shared/ant/ant.rb
Rake task which runs Ant task
org.jruby.java.*
org.jruby.javasupport.*
lib/ruby/site_ruby/shared/builtin/javasupport.rb
for accessing Java resources from Ruby
org.jruby.embed.*
implements embedding interfaces for Java
Excellent
NO
Poor
NO
NO
Poor
3 interfaces
OK
OK
OK
OK + jffi, c-ext
OK
OK for Server
Startup-time matters
Nihongo-JRuby by Hirotsugu Asari
http://jruby-ja.blogspot.com/
JRuby Wiki | Design: Internals
http://kenai.com/projects/jruby/pages/Internals
Distilling JRuby by R.J. Lorimer
http://www.realjenius.com/category/article/distilling-jruby/
Dynamic Optimization by Charles
http://blog.headius.com/2010/05/kicking-jruby-performance-up-notch.html
InfoQ Article about IR
http://www.infoq.com/news/2009/11/jruby-ir
JRuby Compile Settings by NaHi
http://bit.ly/JRubyCompileSettings
JRuby Source Code Reading Guide
http://bit.ly/JRubySrcReadingGuide