24 ms·
Python and Ruby are just a bit more difficult for fast VM implementors because every Object is like a little dictionary. The ordering of the instance values in
by stcredzero 18y ago
Python and Ruby are just a bit more difficult for fast VM implementors because every Object is like a little dictionary. The ordering of the instance values in each Object's collection is dependent on runtime events. In languages where the instance variables are declared ahead of time, the VM implementor can just access each instance variable as an offset of the Object pointer. (Which is what happens in many Smalltalk and Java VMs.)
This is certainly not impossible to overcome. It's just an added difficulty.
- LogicHoleFlaw 18y agoObjects in JavaScript are also dictionaries.. hence the use of "object literals" for dictionaries. The hidden class system in v8 is the technique which allows offsets to be used instead of having to do dict lookups all the time.