The document discusses the roles of compilers and interpreters in programming, highlighting that compilers translate high-level source code into machine-readable code, allowing for faster execution and better error diagnosis, but are harder to debug. In contrast, interpreters translate code line-by-line, making debugging easier and development faster, but can lead to slower execution times. It also mentions the differences between high-level and low-level languages, noting that low-level languages are closer to machine code and do not typically require a compiler or interpreter.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views10 pages
Compiler Sand Interpreters
The document discusses the roles of compilers and interpreters in programming, highlighting that compilers translate high-level source code into machine-readable code, allowing for faster execution and better error diagnosis, but are harder to debug. In contrast, interpreters translate code line-by-line, making debugging easier and development faster, but can lead to slower execution times. It also mentions the differences between high-level and low-level languages, noting that low-level languages are closer to machine code and do not typically require a compiler or interpreter.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 10
• A compiler is a computer program that
translate written code (source code) into
another computer language • Associated with high level languages • A well formed list of compilers • Compiles Java source code into Java bytecode • Translates all code at once • Used with high level languages • Faster Execution • Single file to execute • Compiler can do better diagnosis of syntax and semantic errors, since it has more info than an interpreter (Interpreter only sees one line at a time) • Compiler can optimize code • Harder to debug • Takes longer to change source code, recompile and relink • Slower execution times • No optimization • Need all of source code available • Source code larger than executable for large systems • In Java, the interpreter is a component of the Java JDK that runs Java bytecode classes • Allows Java to be ran outside of a web browser • Translates code one line at a time and then executes the instruction immediately • Used with high level languages • Easier to debug • Faster development time • Used with low level languages • Basically this translates the low level language to machine code (then the program can be executed) • Usually have to be either interpreted, compiled, or translated (or some combination of all three) • Easier to use than low level languages – Language is closer to spoken language • Portable • Abstract • Examples: Java, Visual Basic, ?, ? (lab assignment) • In a sense low level languages speak the same language as the hardware • Usually does not need a compiler or interpreter • 1st Generation: Machine Code • 2nd Generation: Assembly Language