0% found this document useful (0 votes)
41 views2 pages

Compiled Vs Interpreted

Compiled languages translate the entire source code into machine code before execution, resulting in faster runtime performance but slower debugging. In contrast, interpreted languages translate code line-by-line during execution, which allows for easier debugging but slower performance. Key takeaway: the main difference lies in when and how the translation to machine code occurs.

Uploaded by

ab49282h
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views2 pages

Compiled Vs Interpreted

Compiled languages translate the entire source code into machine code before execution, resulting in faster runtime performance but slower debugging. In contrast, interpreted languages translate code line-by-line during execution, which allows for easier debugging but slower performance. Key takeaway: the main difference lies in when and how the translation to machine code occurs.

Uploaded by

ab49282h
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Compiled vs Interpreted Languages -- Revision Notes

Compiled Language
• Definition: Entire source code is fully translated into machine code before execution.
• When translation happens: One-time before execution.
• Execution: CPU directly executes machine code.
• Speed: Very fast at runtime.
• Debugging: Slower (needs recompilation after code changes).
• Examples: C, C++, Rust, Go

Interpreted Language
• Definition: Code is read and translated line-by-line while running.
• When translation happens: Every time during execution.
• Execution: Interpreter (already compiled) translates the code at runtime and passes instructions to
OS/hardware.
• Speed: Slower due to real-time translation.
• Debugging: Easier (quick feedback after changes).
• Examples: Python, JavaScript, Ruby, PHP, Perl, Tcl

Key Technical Point


• CPU always executes machine code.
• The difference is when and how high-level code is translated into machine code.

Visual Flow
Compiled Language:

Source Code → Compiler → Machine Code → CPU

Interpreted Language:

Source Code → Interpreter → OS/System Calls → CPU

1
Special Notes
• Perl and Tcl are traditionally interpreted languages.
• They follow the same real-time translation model.
• Some implementations may have partial pre-compilation (bytecode), but in general, they belong to
interpreted category.

Golden Rule
"Translation always happens. The only question is: before running or during running?"

You might also like