Hello again friends! I'm looking to start a discussion about caching strategies for dynamic languages. Probably focused mostly around inline caches, but also mechanisms for per-class or global caches to supplement the inline cache.
A description of Ruby's class structure may help frame the discussion: * Ruby's classes are all mutable. Therefore any cache needs to be invalidated either actively or passively in response to changes anywhere in the class hierarchy. We obviously desire to localize such effects as narrowly as possible. * Ruby supports mixin inheritance, where at any time a given class may mix in a "module" containing methods. The module as a pseudo-class in between the current class and its superclass, becoming a virtual superclass. So these mixins must also effect cache validation. * Modules themselves are also open, meaning mutation of an included module needs to be considered as well. * Modules can mix in modules. * Ruby also supports creating per-object "singleton classes", which act as a new anonymous class for a given object, immediately below its original class. Singleton classes act like any other classes, other than their frequently being very short-lived. So there's a lot of complicating factors here. Mixins complicate per-class caching because modules can change after being mixed in. Singletons confound inline caches since object.type can conceivably look different very often; special-cased behavior for singletons may be necessary. The mutability of the entire class structure (and the willingness of Rubyists to (ab)use that mutability) confounds coarse-grained caches. It seems like any one approach (at least approaches I know about) will not be sufficient, but making sure multiple caches don't step on each other and are reasonably memory efficient is tricky. Anyone have thoughts on this or references to papers I might read? - Charlie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---