Compiler


What is a COMPILER and what is COMPILING a program?

A compiler is a computer program. It translates a high-level programming language (C, C++, etc.) into binary code for a particular CPU (Central Processing Unit).

FIG. – Translation of high-level language into executable CPU code

CPUs execute their program by reading instructions from memory in binary code (often hexadecimal words). These codes differ from CPU to CPU type.

An important advantage of high-level languages and compiling them is the portability of programs on different CPU platforms. Portability means compiling source code with different compilers for different CPU platforms.

The compiler will turn the high-level programming language into codes corresponding to different CPU instruction sets. A source program compiled by an Apple C++ compiler will also run on Windows when compiled with a Windows C++ compiler.

In the early days of computers, one wrote programs (‘object code’) directly in binary code understandable by the CPU. The number of instructions needed to write a program was huge, difficult, and cumbersome. Nowadays, we program computers in high-level languages with instructions written as readable text (often similar to English). After writing the program in source code, we must compile the source code into code executable by the CPU.

The source code, written in C++ of the ODR-mmbTools, can be found on GitHub. Once downloaded, you will have to compile it into executable object code for the CPU on your PC. The Linux operating system uses the ISO C++ GCC (GNU Compiler Collection).

Back