COMPILER, LINKER, INTERPRETER, AND LOADER
WHAT IS A COMPILER? • Translates the entire source code into machine code. • Generates an executable file (.exe). • Execution is fast after compilation. • Example: GCC compiler for C.
COMPILER EXAMPLE OUTPUT : HELLO, WORLD!
PHASES OF COMPILATION • 1. Lexical Analysis • 2. Syntax Analysis • 3. Semantic Analysis • 4. Optimization • 5. Code Generation
WHAT IS A LINKER? • Combines object files and libraries into a final executable. • Resolves external references (e.g., library functions). • Two types: Static linker and Dynamic linker.
TYPES OF LINKERS • Static Linker: Links all modules at compile time • Dynamic Linker: Links during program execution (runtime)
WHAT IS AN INTERPRETER? • Translates and executes code line by line. • Does not produce an independent executable. • Execution is slower compared to compiler. • Example: Python Interpreter.
EXAMPLES OF INTERPRETERS • Python Interpreter • JavaScript Engine (V8, Spider Monkey) • Ruby Interpreter
WHAT IS A LOADER? • Loads the executable file into memory for execution. • Allocates memory and sets program counter. • Part of the operating system.
COMPARISON • Compiler:Translates full program executable. → • Interpreter: Executes line by line no executable. → • Linker: Combines object files + libraries final → program. • Loader: Loads program into memory ready to run. →
CONCLUSION • Compiler:Translates code • Linker: Combines modules • Interpreter: Executes line by line • Loader: Loads program into memory • All four are essential for program execution.

Compiler_Linker_Interpreter_Loader.pptxfg

  • 1.
  • 2.
    WHAT IS ACOMPILER? • Translates the entire source code into machine code. • Generates an executable file (.exe). • Execution is fast after compilation. • Example: GCC compiler for C.
  • 3.
  • 4.
    PHASES OF COMPILATION •1. Lexical Analysis • 2. Syntax Analysis • 3. Semantic Analysis • 4. Optimization • 5. Code Generation
  • 5.
    WHAT IS ALINKER? • Combines object files and libraries into a final executable. • Resolves external references (e.g., library functions). • Two types: Static linker and Dynamic linker.
  • 6.
    TYPES OF LINKERS •Static Linker: Links all modules at compile time • Dynamic Linker: Links during program execution (runtime)
  • 7.
    WHAT IS ANINTERPRETER? • Translates and executes code line by line. • Does not produce an independent executable. • Execution is slower compared to compiler. • Example: Python Interpreter.
  • 8.
    EXAMPLES OF INTERPRETERS •Python Interpreter • JavaScript Engine (V8, Spider Monkey) • Ruby Interpreter
  • 9.
    WHAT IS ALOADER? • Loads the executable file into memory for execution. • Allocates memory and sets program counter. • Part of the operating system.
  • 10.
    COMPARISON • Compiler:Translates fullprogram executable. → • Interpreter: Executes line by line no executable. → • Linker: Combines object files + libraries final → program. • Loader: Loads program into memory ready to run. →
  • 11.
    CONCLUSION • Compiler:Translates code •Linker: Combines modules • Interpreter: Executes line by line • Loader: Loads program into memory • All four are essential for program execution.