All I'd Wanted to Know about Ruby's Object Model Starting Out...and Mooar!!!
summary
Walks the CRuby C source (specifically CRuby 2.4 source) and shows the actual structs – RBasic/RClass structs with flags, kclass pointers and method tables – then traces bootstrapping in init_vm, the rv_define_class_id path that creates classes and method classes, and the convoluted make_metaclass logic that spawns meta/meta chains. Demonstrates singleton-class creation (much simpler), how include classes are inserted and share module method tables, and why Ruby’s class/superclass methods skip singletons and include classes.
AI-written summary · about
chapters (14)
- 0:00Introduction to Ruby
- 1:06The Ruby creation myth
- 2:53The object hierarchy
- 3:55Introspection and self-discovery
- 6:08Singleton methods and classes
- 6:58Class methods and meta-classes
- 8:47C Ruby internal representation
- 10:39Method dispatch mechanics
- 12:17Bootstrapping and class creation
- 14:15Metaclass creation details
- 15:53The metaclass inheritance chain
- 18:31Singleton class implementation
- 21:25Modules and include classes
- 24:44Q&A and conclusion
related talks
29mAll I'd Wanted to Know about Ruby's Object Model Starting Out...and Mooar!!!
34mAll I'd Wanted To Know About Ruby's Object Model Starting Out...And Mooar!!!
33mVenturing into the Spooky Science of Ruby
30mGuide to getting started walking source codes of CRuby
36mMetaprogramming? Not good enough!
29mModule Magic
28mDeep Ruby
29mMRI Magic Tricks
