Frank DENIS random thoughts.

A YARV to LLVM compiler

YARV is the virtual machine shipped with Ruby 1.9. YARV is a great step forward, since current benchmarks show that Ruby 1.9 is about 4.5 times faster than Ruby 1.8. Speed wise, Ruby 1.9 can really compete PHP and Python. I also played with JRuby today, and its JIT and AOT compiler + a current JVM makes it a very scalable platform.

But here’s a project that might really makes Ruby a speed daemon: a YARV to LLVM compiler.

The LLVM compiler infrastructure provides aggressive optimizations, and the recently-released Adobe Alchemy is yet another proof that LLVM rocks.

Can you imagine if Ruby code could be compiled through LLVM?

This is the goal of the yarv2llvm project and it already works pretty well. The web page is only in japanese, the benchmarks are easy to read:

http://d.hatena.ne.jp/miura1729/20081012/1223785541

42 times faster than Ruby 1.9. Pure crazyness. It probably blows away every VM of other script languages out there.

Here’s the github for yarv2llvm, as you can see, the project is quite active.

(by there way, here’s a link to a project that didn’t get a lot of coverage, but that’s also worth looking at: the Ludicrous JIT compiler although I’m quite confident that LLVM will remain more efficient).