A compiler translates an entire program at once into machine code, while an interpreter translates programs line by line. Compilers typically execute programs faster but require more memory and make debugging harder, while interpreters execute more slowly but require less memory and make debugging easier. Programming languages are compiler-based while scripting languages are interpreter-based.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
8 views2 pages
Day1 Assignment
A compiler translates an entire program at once into machine code, while an interpreter translates programs line by line. Compilers typically execute programs faster but require more memory and make debugging harder, while interpreters execute more slowly but require less memory and make debugging easier. Programming languages are compiler-based while scripting languages are interpreter-based.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
1) what is the difference between compiler and interpreter?
Compiler Interpreter
It translates the entire source code into
machine code before execution at once. It translates the source code line by The machine code is saved as an line during execution. executable file. It does not generate an executable The executable file can be run directly file. without the need for the compiler. The source code must be present Compilers are typically used such as C, for the interpreter to run the C++, and Java. program. Interpreters are typically used such as Python, JavaScript, and Ruby.
2) Which one is better Compiler or interpreter?
A compiler typically runs a program faster because it translates an entire program at
once. Meanwhile, the interpreter translates a program line by line. This makes its overall speed and execution slower.
A compiler requires more memory capacity because it generates an intermediary object
code. Object code refers to the binary code, which it directly stores in a file. This means that a compiler may require an external memory source, such as disk storage, to store machine code. Meanwhile, the interpreter needs less memory because it doesn't create an intermediate object code.
Whether a compiler is better than an interpreter typically depends on the
function you wish to perform. The interpreter is highly beneficial in helping to debug errors, but its overall execution is slow. Compilers have fast execution, but they make error correction slightly difficult. Selecting these computer programs generally depends on the result you desire.
So, compiler is better than interpreter.
Scripting language Programming language
The scripting languages are interpreter-based The programming languages are
languages. compiler-based languages. Scripting languages convert high-level Programming languages help in instructions into machine language. converting the full program into the You don’t need to compile these languages. machine language (at once). Scripting languages don’t create any file These languages first need a compilation. types. Programming languages create .exe files. Scripting languages help write a small piece of Programming languages help write the an entire code. full code concerning a program. Javascript,PHP ,Perl,Python, VBScript etc Examples are Java, C , C++, C# etc these all are the examples of scripting Programming languages are most widely language used to make software or drivers.
3) what is the difference between scripting language and programming