Game Development Reference
In-Depth Information
Fig. 2.4
Translating using a compiler and an interpreter
Fig. 2.5
Translating using a compiler and a compiler
compiler, interpreting the bytecode is relatively fast, although a program compiled
directly to 'real' machine code will always run faster.
2.4.5 Compiler + Compiler
The C# language uses yet another variation, which relies on an intermediate lan-
guage similar to the bytecode used in Java. What is special about this intermediate
language is that it can be generated from different programming languages. This
means that bigger projects can integrate programs written in different programming
languages. The intermediate language is not interpreted like with Java, but it is trans-
lated again into machine code for a specific platform by another compiler. Figure 2.5
shows what this looks like. An example of such a platform is the PC, but it can also
be a game console or a mobile device.
Sometimes the compilation into machine code happens at a very late stage, when
the program is already running and it needs a part that is not yet compiled. In this ap-
proach, the difference between a compiler and an interpreter is not so clear anymore.
Because the compiler compiles parts of the program just before the code is needed,
this special type of compiler is also called a just-in-time compiler (or 'jitter').
Search WWH ::




Custom Search