
Too Many TicketsTokens
Investigating the crime of the compiler
Manas Malla
Apr 20 2025
2 min read
Share
Bookmark
Click the play button, wait for a few seconds, and tada, a window opens with the output of the multitudinous code you have just written. This is something all the developers take for granted: Write a program, and let the IDE , just like magic, render the output. But have you ever wondered about how does your code actually produce the output you were expecting.
Wait, is it magic, or is the computer actually intelligent enough to understand the code you've written and do the math to give you the output? Well, I wish it was able to understand my emotion and what I meant, as I struggle sometimes to help it understand my thoughts
But yeah jokes apart, the IDE takes the help of the compiler of the programming language to generate an executable (.apk, .ipa, or .exe or just an executable file) which is then run to display the output. So, now the questions shifts from the responsibility of the IDE to the court of the compiler.
Compiler
Compilers are specialized computer programs that have the superpower to understand the code based on the rules that the programming language defines to be able to produce machine-understandable code in the form of 0's and 1's. Yeah, they are the translators, translating high-level programming languages into binary .
Phases of the compiler
A compiler is built of two components: the syntaxical component and the analytical compontent.
The syntaxical component is responsible for converting the entire code into a simple parse tree while the analytical component is responsible for checking the structure and rules of the generated tree.
The compilation of code can be be divided into 7 phases:
- Lexical analysis
- Syntax analysis
- Semantical analysis
- Intermediate code generation
- Machine-independant code optimization
- Code generation
- Machine-specific code optimization
A quick break..
Well, that's it for now. After all this investigation, it calls for a break. But that doesn't mean we rest our case here, it's just the beginning. Follow us as we are #BreakingItDownWith @Agent009 to tune into this trail of decrypting the crime of the compiler in this series.
Ps. We'll be joined by @Agent2251 ✨ to break this case further.