Paolo Molaro <[EMAIL PROTECTED]> wrote: > On 10/27/04 Luke Palmer wrote: >> >> Ugh, yeah, but what does that buy you? In dynamic languages pure >> derivational typechecking is very close to useless.
> Actually, if I were to write a perl runtime for parrot, mono or > even the JVM I'd experiment with the same pattern. For the latter two yes, but as Luke has outlined that doesn't really help for languages where methods are changing under the hood. > You would assign small interger IDs to the names of the methods > and build a vtable indexed by the id. Well, we already got a nice method cache, which makes lookup a vtable-like operation, i.e. an array lookup. But that's runtime only (and it needs invalidation still). So actually just the first method lookup is a hash operation. > ... There are a number of optimizations that > can be done to reduce the vtable size, but I'm not sure this would > matter in parrot as long as bytecode values are as big as C ints:-) That ought to come ;) Cachegrind shows no problem with opcode fetch and you know, when it's compiled to JIT bytecode size doesn't matter anyway. We just avoid the opcode and operand decoding. > lupus leo