DEV Community

Cover image for Compiled Programming Language- Part1 (Compiler)
datatoinfinity
datatoinfinity

Posted on • Edited on

Compiled Programming Language- Part1 (Compiler)

A Compiled Programming Language is one where the source code is translated into manchineel code (executable code) by a compiler before the program can run.

[Source Code] → (Compiler) → [Machine Code] → [Executable File]

[Executable File] → (CPU executes) → Program runs

_Source Code _ :- A programmer writes a code, which is called human readable language.

Compiler :- A special program, the compiler, takes the source code as input.
- It checks the errors (syntax, type errors etc.)
- If there no errors, it generate an executable file.
Analogy
Think of it like a translate converting an entire book from English to binary all at once.

Machine Code :- Compiler translates the source code into manchineel code, which is a set of instruction the CPU can understand.
- Machine code is binary code -1s & 0s- that computer CPU can understand directly.
- It is no human Readable.
- usually generated as part of an executable file.

Executable file

A structured file format (like .exe, .out, .elf etc) that contains:

  1. Machine Code
  2. Metadata (like symbol tables, headers, memory layout)
  3. This is the final output produced by the compiler.

Analogy:
The lunchbox (executable file) contains:
The food (machine code) the actual things you're going to consume.

Top comments (0)