Skip to content

Comment on Virtual Machine Showdown: Stack Versus Registers

Comments

This had some interesting information, but it's meaningless. If you care about performance, you won't be using interpretation in your VM, and code that's quick to interpret is almost never code that's quick when compiled. The challenges are simply different when you're dealing with compiled VM code.

"meaningless" is probably a bit harsh--usually there is a very good reason to use interpretation in the first place: ease of implementation and portability. you get both things for free when using an interpreter but have to take care when implementing a compiled system (even gets worse with a just-in-time compiler [needs interpreter AND compilation stuff]).

Yes, interpretation has strengths, but those go away when you try to do 'optimized' interpretation. Interpretation optimizations, particularly in register forms, are not only difficult to implement but non-portable (they'll work everywhere, but all architectures are not created equal).

If you care about performance, going the compiler route is the only way. In addition, JITCs do not need an interpreter as well, it's just often done that way to offset the cost of compilation for routines that aren't hit often.

concerning your second point: you're absolutely right, there are a couple of direct compilation systems (without interpreters). for example, the cacao jvm for dec alphas (afaik) used to be a jit compiler without an interpreter (but they added one afterwards)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.