Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 359
Haldir87 Avatar asked Dec 25 '11 16:12

Haldir87


2 Answers

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.

like image 51
Peter Olson Avatar answered Sep 22 '22 17:09

Peter Olson


They're two very different technologies, for two different programming languages - a Java Virtual Machine is a virtual machine for running Java programs, whereas V8 is a JavaScript engine. The fact that they have the word "Java" in the name is where the similarities end.

like image 34
Óscar López Avatar answered Sep 19 '22 17:09

Óscar López