logo

How Intermediate Code Improves Program Portability

A computer programme A meme in intermediate representation (IR) is a form of computer programme that falls between source code written in high-level programming languages and the machine code executing the programme. The compiler generates the intermediate representation of the programme during the translation phase to allow it to run on any platform. A computer programme that runs on multiple hardware platforms can now be produced using this intermediate representation and therefore is more portable, thus enabling easier optimisation of the software.

By separating the tasks of parsing a high-level programming language and generating the appropriate machine-specific instructions from the hardware when creating an intermediate representation of the source code, compilers can efficiently generate machine code from the intermediary stage of the compiler. In addition, it is possible for a compiler to generate tailored versions of the generated machine code to take advantage of specific architectural features.

Intermediate code is also the basis for performing various forms of analysis and securing computer applications through static analysis, checking for security vulnerabilities and performing performance analysis. A number of new technologies, including Java, employ the use of IR; in this case bytecode that runs on the Java Virtual Machine, and the .NET Framework uses Common Intermediate Language (CIL) for the languages within that framework. The intermediate representation of the software has therefore established the capability to execute consistently across multiple operating systems and has enabled the development of cross-platform software.

Software Development