5 ms·
It's a Ruby virtual machine built on LLVM.
by hvs 16y ago
It's a Ruby virtual machine built on LLVM.
- devmonk 16y agoVirtual machine can give the wrong connotation to a Java developer though. It isn't just running compiled classes like in Java. It has to do ongoing runtime compilation.
- hvs 16y agoI would liken it to a JIT compiler in Java, though.
- riffraff 16y agoruntime compilation is what most common use jvms have been doing for a a few years though, so java programmers could get the right connotation :)
- devmonk 16y agoSorry, I never said that it couldn't, but I didn't explain what I was trying to say very well either. Yes, there can be runtime compilation in Java like compilation of JSPs (for example). With Tomcat, Tomcat uses (or used to use- I'm getting old) classes in tools.jar, etc. which uses the JVM to compile and put in the work/... directory which it then loads via classloader, etc. etc. and interprets the bytecode it compiled it into into memory, etc. etc. I was trying to explain to someone that might want to learn about what is going on with Ruby and Rubinus that unlike the Java JVM whose purpose most of the time at runtime is running precompiled bytecode, Rubinus, MRI, etc. are more often compiling at runtime than Java (at least until Java 7 with JRuby, etc. at which point I'll be completely lost, because I will need to understand how that works). When I think of a VM in the Java sense from that background, I still think "MOSTLY (and thank you for clarifying) running compiled classes at runtime". I just didn't want the OP to be confused about that, and in process now I probably look like a total dumbass.
- kingkilr 16y agoUhh, the JVM does runtime compilation as well.
- evanphx 16y agoThis actually puts out a mildly confusing picture. Rubinius uses LLVM to implement the JIT compiler only. LLVM does not provide a performant interpreter, and even if it did, the instructions in LLVM are incredibly lowlevel which would mean even lower performance. For this reason, Rubinius also has a bytecode interpreter, of which the bytecodes are highlevel and associated directly with ruby semantics (send, push_const, etc).