What is a Compiler A Compiler is a Computer Program that go through the provided source code , Checks for error and converts in into another computer language that a computer can understand (usually binary opcodes). Compilation A compiler's work can be divided into 3 parts. Front End Middle End Back End Front End The Front end first starts with the Preprocessor phase , Which includes handling #define , #include etc directives then it passes to lexical analyser which checks whether the source code is correctly writen on the basis of language's syntax. If error or warnings are forund the compiler reports it and kills the execution. For eg :- Code: #include<stdio.h> int main() { return(0); So in this example we'll be taking a piece of incomplete code , It basicaly misses a closing '}' braces . Lets see if the compiler detects it :- Output :- Code: lionaneesh@lionaneesh:~$ gcc first.c -o first first.c: In function ‘main’: first.c:6:1: error: expected declaration or statement at end of input lionaneesh@lionaneesh:~$ The Middle End The middle end is where the optimisation takes place , It involves removing of useless code , Adding constant values and realocation of computation. The Back End The code from the previous 2 ends finally comes to back end where it is translated to Low Level Assembly , Critical Changes like variables to registers , Intructions to specific Assembly instructions takes place in this end. I hope you liked the article ,Stay tuned for more