Schedule

Back
Petr Chalupa
Petr Chalupa
@pitr_ch

Petr is a researcher at Oracle Labs where he works as part of a team developing a high performance Ruby implementation called TruffleRuby. He is the maintainer of concurrent-ruby, a tool-box of concurrency abstractions for Ruby, a 60th most downloaded gem. He is a happy Ruby user for 10 years.

TruffleRuby: Wrapping up compatibility for C extensions

We think it is crucial that any alternative Ruby implementation aiming to be fully compatible with MRI runs the C extensions. TruffleRuby's compatibility was recently significantly improved, with much better support that almost completely removes the need to patch C extensions.

In this talk you will hear and see: how the old approach to C extensions worked and where and why it was failing short; how does the new approach work and how much closer it brings TruffleRuby to its goal to be a drop-in replacement for MRI.

We have been interpreting the C extensions (and JITing together with Ruby code) for a while, however we have been passing the Ruby objects directly into the C code which had lead to problems. We now have a new innovative technique which no longer requires patches in almost all cases. The objects are wrapped for greater compatibility and there is a virtual GC marking phase to avoid memory leaks.