Reputation: 35
This is a very beginner-ish question.
JRuby is Ruby implemented on the JVM. Does this mean that the process for creation was just creating the Ruby language from scratch, implemented in Java methods and classes, instead of in C? That is, every Ruby method was one by one implemented in Java? I think my question is rooted in a lack of understanding of the JVM.
Upvotes: 1
Views: 407
Reputation: 26743
It means that all ruby code running in JRuby ultimately translates to bytecode that gets executed by the JVM. That "translation" can have already been done when JRuby was written and compiled, or it happens at runtime, when the JRuby compiler transforms Ruby code into something that can run on the JVM. More concretely:
String
methods, such as capitalize!
, are implemented inside the org.jruby.RubyString
Java class, or some of the date and time stuff is based on joda-time
), Upvotes: 1