Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
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. RubyKaigi 2019 https://rubykaigi.org/2019/presentations/pitr_ch.html#apr20
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
The video presented by Petr Chalupa at RubyKaigi 2019 discusses the advancements in TruffleRuby, particularly focusing on its compatibility with C extensions. The aim of TruffleRuby is to serve as a drop-in replacement for MRI (Matz's Ruby Interpreter). The talk covers the evolution of C extensions support, explaining the former challenges and the innovative new method developed. Key points discussed include: - **Introduction to TruffleRuby**: This project focuses on being fully compatible with MRI, enhancing performance through improved startup times and JIT compilation. - **Old Approach to C Extensions**: The previous method of dealing with C extensions faced significant limitations, especially concerning memory management between Ruby objects (managed) and C code (unmanaged). - **New Approach**: A new wrapping system for Ruby objects was introduced, allowing better tracking and management of object usage when interacting with C code. This involves wrapping Ruby objects in a controlled manner, which avoids the need for excessive patches to C extensions. - **Polyglot Protocol**: This feature allows seamless communication between Ruby and C, significantly simplifying code interactions. - **Memory Management**: The new implementation addresses garbage collection issues by closely mimicking MRI's memory management strategies, ensuring effective preservation and disposal of memory allocations in C extensions. - **Examples Demonstrating Compatibility**: The presenter cites practical instances where libraries such as OpenSSL, SQLite, and MySQL can now run without modifications, illustrating the enhanced support for standard libraries and applications. - **Community Engagement**: Chalupa encourages the Ruby community to explore TruffleRuby’s capabilities in smaller service deployments, noting that while it’s not yet ready for production for all use cases, it is stable enough for experimentation. In conclusion, TruffleRuby has significantly improved compatibility with C extensions, reducing dependency on traditional patches and enhancing overall performance. The focus remains on ongoing improvements, and feedback from users is invaluable as the project evolves. The audience is reminded of the research nature of this project, encouraging questions and discussions to further its development.
Suggest modifications
Cancel