Search code examples
javajavascriptnode.jsv8

Does Google V8 work in similar way to Java Virtual Machine?


I know that V8 is a JavaScript engine, but does it work in a similar way to a Java Virtual Machine?

If it doesn’t work in the same manner, what are the differences? Does V8 compile JavaScript to machine language directly?


Solution

  • Excepting that Lars Bak was instrumental to both projects, they are unrelated.

    V8 is a JavaScript engine that compiles JavaScript to native machine code, used most notably by Google Chrome and Node js.

    The JVM is a virtual machine that runs bytecode produced by a Java compiler.

    One is a JavaScript engine, and the other is a Java Virtual Machine, and note that Java and JavaScript are about as similar as cars and carpets. Also note that one is a compiler, and the other is a medium for execution.