Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Ruby interpreter called MRI (Matz Ruby Interpreter) or CRuby is written in C language. Writing an interpreter in C has several advantages, such as performance at early development, extensibility in C language and so on. However, now we have several issues because of writing MRI in C. To overcome this issue, I propose to rewrite some part of MRI in Ruby language with C functions. It will be a base of Ruby 3 (or Ruby 2.7). In this talk, I'll show the issues and how to solve them with writing Ruby, how to write MRI internal in Ruby and how to build an interpreter with Ruby code. RubyKaigi 2019 https://rubykaigi.org/2019/presentations/ko1.html#apr18
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 presentation titled "Write a Ruby interpreter in Ruby for Ruby 3" by Koichi Sasada at RubyKaigi 2019 discusses a proposal for enhancing the Matz Ruby Interpreter (MRI) by incorporating Ruby code into its construction, aiming for improved performance and extensibility. **Key Points Discussed:** - **Current Challenges of MRI:** - MRI, primarily written in C, presents challenges such as complex garbage collection and limited ability to use Ruby's features. - Ruby methods are mainly defined in C, with insufficient usage of Ruby’s capabilities, leading to performance and usability issues. - **Proposed Solutions:** - The proposal focuses on writing built-in method definitions in Ruby using a new framework while retaining access to C functions for performance-critical operations. - It emphasizes creating a balance between Ruby's elegance and the performance benefits of C, with potential use of DSL. - **Challenges Identified:** - Notational issues and understanding parameter names in C definitions impact performance profiling. - The method size and class definitions can complicate memory allocations and startup times. - The performance of C code may negate some advantages over Ruby, especially in certain operations like exception handling. - **Technical Improvements:** - Introducing foreign function interfaces that allow seamless transitions between Ruby and C for better performance and easier debugging. - Implementation of new virtual machine instructions to reduce overhead and improve Ruby's efficiency. - Lazy loading techniques to optimize resource allocation when class definitions are extensive but only subsets are needed. **Conclusion and Takeaways:** - The proposed approach aims to define methods in Ruby and utilize C for complex functionalities, thereby making Ruby more accessible and efficient. - Sasada believes these innovations will lead to a more capable Ruby interpreter while maintaining compatibility and enhancing performance. - Emphasis is placed on evaluating how Ruby can evolve to meet modern programming needs without losing its foundational characteristics. In summary, this proposal seeks to blend the user-friendliness of Ruby with the performance efficiency of C, ultimately paving the way for a more modern and flexible Ruby interpreter.
Suggest modifications
Cancel