Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We do this to run Ruby C extensions on the JVM - compile the extension to LLVM IR instead of native code, then JIT compile the IR using the JVM's JIT. It's fast!


Huh? You use the JVM's JIT to compile LLVM IR? How does that work? Isn't it a bytecode compiler?


Well yes but at some point in the pipeline the byte code is long gone. So you can use it for anything by using just the parts beyond that point.

But really we don't directly compile the IR. We have an interpreter for IR, and we JIT compile the interpreter, sort of constant folded with the IR. It achieves the same thing without getting more technical.

https://github.com/graalvm/sulong




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: