This talk at RubyKaigi describes the object shapes technique, and how it could be useful to CRuby.