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

> I don't know what (if any) performance boost the VM would get by being converted to LLVM IR

Well you can already convert the VM to LLVM IR today by compiling with clang.



This is an interesting idea. If you transpile the Ruby runtime to LLVM-IR you can run Ruby's IR in LLVM's tracing JIT mode.

Theoretically the LLVM will optimize your application as its running.

P.S.: I don't know Ruby so YMMV

P.P.S.: If it works with Ruby it'll work with Python too.


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: