No way it could be as ugly as an x86. The x86 has been with us since the 8080 days (the 8086 was a 16-bit 8085, done in a hurry because the i432 flopped). It's a kludge wrapped in a another kludge.
It's not a generic VM. Sure it's got a lot of basic instructions for adding (signed) numbers together but a lot of important instructions are very high-level and very specific to Java. It was never designed to run anything else. So non-Java languages ported to the JVM do involve kludges. The comparison to x86 isn't far off.
yes, and implementing things like tail call recursion requires major kludge.
But, albeit we could discuss about stack based vs register based VM instruction set design, some of the limitations of the JVM are not inherent to its design, but rather to the inability to evolve.
Who's going to introduce bytecode extensions to the JVM now? And correctly manage the upgrades, backward compatibility process etc.
Mature products sometimes have this kind of issues. But, who knows, perhaps there will be a time frame when such a change will be welcome (along with java7 closures?) by the community, even if causing some migration problems.
> Java 7 is much friendlier to dynamic languages ... it would need to be really inelegant to warrant a comparison with the x86
Not that much, and not that inelegant ... at least x86 evolved a lot since 8086. The JVM itself evolved only in the internal architecture, but the bytecode itself is almost the same since Java 1.
The best VM for multiple language will soon prove to be LLVM, only because it makes your code cross-platform, while being low-level enough and not being strangled by a standards body.
It's actually easier to build a compiler for LLVM than it is for the JVM ... you might not go at first with a generational GC, and the speed might be terrible ... but at least you have room to grow ...
I have yet to see a language on top of the JVM beat LuaJIT2 (even Java itself can hardly beat it in simpler benchmarks). And the optimizations in Java7 can be achieved today in Java6 (with lots of workarounds, of course).
Saying the x86 evolved is like saying that, it would be evolution if I grew half a dozen tentacles, wings, two more unconnected brains, an exoskeleton and poison bags.
If you start with a can opener and attach it seats, engine, wheels, transmission and a steering wheel, all in ways it can still be in your kitchen and open cans, is it a car or a can opener? That's an x86.
I am not saying the JVM is the VM to end all VMs. It's just that it's nicely done. Much unlike the x86.
Or, as people say, it's kludges all the way down.