Four steps in compiling code

When source code is compiled into machine code it goes though four steps. These steps are: 

Preprocessing - preprocessing in coding means to add dependencies to your code. The code that is written may rely on functionality that is available in some other code. Of course it is possible to write that code by yourself, but it will be inefficient than to use code that had been already written. It is likely that this code had been already well tested by others and don't contain many errors. Preprocessing means to use that library. Preprocessing step does not include code to your code, but simply points that this library is needed.

Compiling - is the next step in the process of compiling source, this code is not yet transformed into machine code, but it is transformed to instructions that this machine can understand. This code looks like assembly code, or low level programming instructions. Before high level programming languages were developed, people used to make computer programs in the low level code, they needed to specify instructions exactly of what this computer needs to perform.

Assembling - is the next step in compiling process. Assembling means to take the low level code and transform it to low level machine code.

Linking is final step in the process of making machine executable code. The source code that had been written may refer to other files that are needed to be used. Linking step brings that needed code.

We simply call this process as compiling, however if we explore details, there are several steps in order to compile an application. Interpreted code is not as efficient as compiled code.

These four steps are required for the code that is needed to be compiled, however there is interpreted code. This code relies on some other piece of software to be executed. For example Perl or Python code relies on external applications to be executed, interpreted code will generally work on different platforms without additional modifications, but it will be slower than compiled code.

YouTube video


Comments

Popular posts from this blog

Absolute and relative path in HTML pages

Errors

goto PHP operator