Why it's important to optimise the tricky parts of Ruby [video]
youtube.com
youtube.com
[1] http://chrisseaton.com/rubytruffle/cext/
It makes me wonder about writing a JIT compiler to produce LuaJIT bytecode, since I'm currently working on AOT compilation of a dynamic language to LuaJIT bytecode.
A lot of good things going on in this space like Helix (http://blog.skylight.io/introducing-helix/)
The concept of using Ruby with external optimisations using Rust or whatever feels a lot like C with inline ASM - really like where it's going
You might be able to make a standalone sort fast, but you really need to be able to make a sort followed by an index fast (or followed by a reverse, or any other endless combinations you can't plan for), and if your sort is an external routine, your VM can't simplify it with the knowledge that it's going to be followed by an index operation.
That's particularly important in idiomatic Ruby code, because so much of it is just calls to the core library. This is what makes Ruby slow, and is what needs to be addressed to make it fast.
I use JRuby as an example, but it also applies to Rubinius and MRI.
The fact that you parse C extensions was really unexpected.
Given something like Object#blank? using the Ruby implementation vs Sam Saffron's "fast_blank", after JRuby+Truffle has done it's work, which implementation ends up more performant?
And would a future JRuby+Truffle (given both the Ruby and C implementation) make an intelligent decision of which one to use?
Exciting!
I have had no real issues with it to be honest. Never any incompatibilities. Some slight care needed when picking gems to make sure no cext but it is rare that I find one.
I use JRuby on the CI box to make sure nothing untowards goes to prod.