answersLogoWhite

0


Best Answer

Byte code would be detrimental to performance because byte code must run in a virtual machine. Java compiles to byte code suitable for the Java Virtual Machine (JVM), but C++ compiles to native machine code. For that reason alone, C++ programs perform many times better than equivalent Java programs. However, the need for a virtual machine also means Java is highly-abstract, with no direct access to specific architecture features. C++ has no such limitations and can therefore produce highly-efficient code specific to any platform. Java simply cannot compete for performance, but Java programs need only be compiled once to run on any platform that supports the JVM, whereas C++ must be compiled separately for each platform, and preprocessor directive code must be written to suit each supported platform. This naturally requires a lot more work on the part of the programmer, but the performance speaks for itself.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why c plus plus compiler cannot produce byte code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the Byte code definition?

Java compiler produces an intermediate code after compilation, understandable by JVM is called Byte Code.


What does the Java compiler translate Java source code to?

The Java compiler translates Java source code to Java byte code.


Is compiler is platform independent?

No. (Of course you should specify what compiler you are talking about.)


What does a compiler perform?

A compiler converts high-level source code into native machine. In the case of Java, source code is compiled to Java byte code suitable for interpretation by the Java virtual machine which produces the machine code.


How does VM code compiler works?

The Java virtual machine is not a compiler, it is an interpreter which primarily performs runtime-translation of Java byte code (the native language of the Java virtual machine) to machine-code (the native language of the physical machine). The Java compiler, on the other hand, is a separate program used to perform compile-time conversion of high-level Java source code to the lower level byte code. Java byte code is highly portable; once compiled, any architecture or platform that implements a JVM can execute the byte code without modification.


What is a hybrid compiler?

Hybrid compiler is a compiler which translates a human readable source code to an intermediate byte code for later interpretation. So these languages do have both features of a compiler and an interpreter. These types of compilers are commonly known as Just In-time Compilers (JIT). Java is one good example for these types of compilers.


What is BYTE Code in java?

Java byte code is the code that is output by the Java compiler. Byte code is not machine code, it must be interpreted to create the machine code. This is handled by the Java virtual machine. Pretty much every platform produced today has a Java virtual machine implementation, so the same byte code can be executed upon any machine. Byte code can be regarded as being the native language of the virtual machine, as opposed to machine code which is the native language of the physical machine.


Executon steps in java?

First of all the compiler converts our source code into byte code ,this is done by "javac" compiler.then we use interpretor that is the"java interpretor" for making our byte code executed.thats y java is called as an compiled and interpred language.by that way our java program will be interpreted. First of all our source code vl b converted into byte code by da java compiler named "javac" ,then dt byte code vl be executed by da interpretor named "java" interpretor. These are execution steps in java dts y v call java as a compiled and interpreted language.


What translates a Java program into Bytecode?

The Java Runtime Environment (JRE) converts the byte code to machine language.


Is jvm a compiler or an interpreter?

JVM is an Interpreter because it interprets the Java Byte Code which it is feed and then it executes it line by line.


How do you convert higher level language into lower level language?

Not only can we but we have to! Machine code is the only language understood by the computer, thus all languages, both low and high level, must be converted to machine code in order to execute. Most compiled languages can produce low-level symbolic code (assembly language), but not all, especially those that compile to byte code rather than machine code. However, all code has to be compiled or interpreted to machine code at some point and machine code can be disassembled to produce low-level symbolic code.


What is compiled code?

Compiled code is plain-text source code that is translated from an English-like, high-level language into either machine code or byte code by a program known as a compiler. Machine code is the native language of the machine, consisting of binary patterns that represent a sequence of machine instructions and their operands. Byte code is the native language of a virtual machine; a machine that only exists within a computer's memory. The virtual machine is simply a program that interprets the byte code in order to produce the actual machine code. Unlike machine code which must be compiled separately for each platform, byte code will run on any platform that has a corresponding virtual machine implementation.