3 ms·
"...hope Python/Ruby/Perl and other languages..." JITing code of these languages surely is possible (compare e.g. with psyco, exceptions might be eval'ed statem
by sb 18y ago
"...hope Python/Ruby/Perl and other languages..." JITing code of these languages surely is possible (compare e.g. with psyco, exceptions might be eval'ed statements and the like...), however, all of these languages take the approach of a simple but fast compiler and having an interpreter as an execution engine (where more optimizations are easily possible), hence the ideas are not directly applicable (as far as python is concerned: their explicit goal is to have the utmost simplicity in their compiler/interpreter)
also, while the JITing part of the v8 surely is nice by itself, IMHO the real runtime performance seems to come from the inlining by what they call "fast property access" -- the papers cited are a very good reference; indepth details can be found via scholar.google.com, though not explicitly mentioned, i figure that PICS, polymorphic inlince caches, are relevant too...
besides that i find the source code very interesting, it seems that it's just a very small codebase (with "ugly" c++ coding standards--given my subjective taste of course; i liked ellemtel guidelines best...); actually, i found myself looking for the "rest" until it became obvious thats all...
- stcredzero 18y agoPython 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.