Bytecode Website Links For
Bytecode
 

Information About

Bytecode




''Bytecode'' is called so because, historically, most instruction sets had one- Byte Opcode s, followed by zero or more parameters such as registers or memory address. It is a form of output code used by Programming Language implementations to reduce dependence on specific hardware (the same binary code can be executed across different platforms) and ease Interpretation . After compiling to bytecode, the resulting output may be used as the input of a Compiler targeting machine code, or executed directly on a Virtual Machine .

Compared to Source Code (intended to be human-readable), bytecodes are less Abstract , more compact, and more computer-centric. For example, bytecodes encode the results of Semantic Analysis such as the scope of each variable access (that is, whether the variable is global or local). Thus, performance is usually better than interpretation of source code.


EXECUTION

A bytecode program is normally executed by parsing the instructions one at a time. This kind of ''bytecode interpreter'' is very portable. Some systems, called dynamic translators, or " and C# code is typically stored in bytecoded format, which is typically then JIT compiled to translate the bytecode to machine code before execution. This introduces a delay before a program is run, when bytecode is compiled to native machine code, but improves execution speed considerably compared to interpretation - normally by several times.

Because of its performance advantage, today many language implementations execute a program in two phases, first compiling the source code into bytecode, and then passing them to the virtual machine. Therefore, there are virtual machines for Java , Python , PHP Although PHP opcodes are generated each time the program is launched, and are always interpreted and not Just-In-Time Compiled , Forth , and Tcl . The current reference implementation of Perl and Ruby Programming Language instead resembles more that of an interpreter, since it works by walking the Abstract Syntax Tree derived from the source code.


EXAMPLES



REFERENCES



SEE ALSO