- Tech know how online


Bytecode refers to an intermediate code that is created during the compilation of a programming language. This means that the source code of a program is not transformed directly into a machine-readable form. The bytecode is thus machine-independent and a more compact representation of the original source code is created. The final execution of the bytecode is then realized by a virtual machine that depends on the computer platform.

The idea of the transformation of a source code into an intermediate code developed already in the 60's and 70's. Starting points of the considerations at that time were to make the actual compiler independent of the respective computer platform as well as to generate portable computer programs on basis of an intermediate code. The programming language Basic Combined Programming Language( BCPL) as predecessor of the programming languagesC++ndC++ is a development from this time, which used the methodology of the intermediate code. However, also due to the lack of performance of computer systems at that time, these approaches were not pursued further.

Execution of the byte code by byte code interpreter

The bytecode is executed by a special bytecode interpreter emulating a virtual machine. Its instructions, because they are coded in 8 bits, are called bytecodes. A disadvantage of this emulation of a virtual machine is depending upon its performance the extension of the run time of the program. One tries to meet this disadvantage of the byte code methodology by JIT compilers(Just in time compiler), which translate appropriate sequences of bytecodes in an operation and execute afterwards immediately. An advantage of bytecodes is their portability with regard to different platforms. In each case only a corresponding bytecode interpreter must be installed. In addition to the low memory requirements, the bytecode technology also enables general control during the execution of the program through emulation. Thereby the condition of the virtual machine can be pursued dynamically. Likewise, code generation is simplified due to the fact that machine-independent code sequences adapted to the source language are generated. Thus, the translation process does not need to refer to the peculiarities of a particular processor, and this phase is thus significantly accelerated.

Bytecode and programming languages

The programming language most frequently mentioned in connection with bytecode is Java. There, it is the Java Virtual Machine( JVM) that transforms the bytecode into a machine-readable form. In each case, it should again be noted that the JVM must be specific to each different system platform. However, there are certainly other examples of programming or even scripting languages that use bytecode. Other languages that use the bytecode technique are C++harp (C#) and PERL. Further are to be mentioned: Python, Prolog, Tel and Visual Basic. The programming languages Lisp, the Markup Language( ML) and Pascal also use bytecode as the basis of their implementations.

In summary it can be stated that byte codes as intermediate code are an elegant technique for the realization of software. The obvious disadvantage of the higher running time stands against advantages such as the simple portability of software or their optimized memory requirement. By performant byte code interpreters or JIT compilers it is tried to realize a certain compensation at run time.

Englisch: bytecode
Updated at: 02.11.2013
#Words: 528
Links: code, a programming language (APL), source code, program, virtual machine (VM)
Translations: DE

All rights reserved DATACOM Buchverlag GmbH © 2022