THE INTERPRETER
In computer science , an interpreter normally means a computer program that executes , i.e. performs , instructions written in a programming language . Interpreter is a translator that convert High level programming language to machine language.
An interpreter may be a program that either
1. Executes the source code directly
2. Translates source code into some efficient intermediate representation (code) and immediately executes this
3. Explicitly executes stored pre-compiled code made by a compiler which is part of the interpreter system Perl , Python , MATLAB , and Ruby are examples of type 2, while UCSD, Pascal and Java are type 3: Source programs are compiled ahead of time and stored as machine independent code, which is then linked at run-time and executed by an interpreter and/or compiler (for JIT systems).Some systems, such as Smalltalk , and others, may also combine 2 and 3.
EFFICIENCY, ADVANTAGES AND DISADVANTAGES
The main disadvantage of interpreters is that when a program is interpreted, it typically runs slower than if it had been compiled. This is because must analyze each statement in the program each time it is executed and then perform the desired action.
Whereas whereas the compiled code just performs the action within a fixed context determined by the compilation.
The difference in speeds could be tiny or great; often an order of magnitude and sometimes more.
THE COMPILER
A compiler is a computer program language (the source language ) into another computer language(the original sequence is usually called the the output has a form suitable for processing by other programs (e.g., a human-readable text file . The most common reason for wanting to translate source code is to create an program.
The name "compiler" is primarily used for programs that translate source code from a high-level programming language language ).A program that translates from a low level language to a higher level one is a decompiler .A program that translates between high -level languages is usually called a source to source translator , or language converter .
COMPILED VERSUS INTERPRETED LANGUAGES
Higher-level programming languages are generally divided for convenience into compiled languages and interpreted languages .
However, there is rarely anything about a language that requires it to be exclusively compiled, or exclusively interpreted.
The categorization usually reflects the most popular or widespread implementations of a language — for instance, BASIC is sometimes called an interpreted language, and C a compiled one, despite the existence of BASIC compilers and C interpreters.
In a sense, all languages are interpreted, with "execution" being merely a special case of interpretation performed by transistors switching on a CPU . Modern trends toward just-in-time compilation and byte code interpretation also blur the traditional categorizations.
There are exceptions. Some language specifications spell out that implementations must include a compilation facility; for example, Common Lisp . Other languages have features that are very easy to implement in an interpreter, but make writing a compiler much harder; for example, APL , SNOBOL4 , and many scripting languages allow programs to construct arbitrary source code at runtime with regular string operations, and then execute that code by passing it to a special evaluation function. To implement these features in a compiled language, programs must usually be shipped with a runtime library that includes a version of the compiler itself.
Related Links
In computer science , an interpreter normally means a computer program that executes , i.e. performs , instructions written in a programming language . Interpreter is a translator that convert High level programming language to machine language.
An interpreter may be a program that either
1. Executes the source code directly
2. Translates source code into some efficient intermediate representation (code) and immediately executes this
3. Explicitly executes stored pre-compiled code made by a compiler which is part of the interpreter system Perl , Python , MATLAB , and Ruby are examples of type 2, while UCSD, Pascal and Java are type 3: Source programs are compiled ahead of time and stored as machine independent code, which is then linked at run-time and executed by an interpreter and/or compiler (for JIT systems).Some systems, such as Smalltalk , and others, may also combine 2 and 3.
EFFICIENCY, ADVANTAGES AND DISADVANTAGES
The main disadvantage of interpreters is that when a program is interpreted, it typically runs slower than if it had been compiled. This is because must analyze each statement in the program each time it is executed and then perform the desired action.
Whereas whereas the compiled code just performs the action within a fixed context determined by the compilation.
The difference in speeds could be tiny or great; often an order of magnitude and sometimes more.
THE COMPILER
A compiler is a computer program language (the source language ) into another computer language(the original sequence is usually called the the output has a form suitable for processing by other programs (e.g., a human-readable text file . The most common reason for wanting to translate source code is to create an program.
The name "compiler" is primarily used for programs that translate source code from a high-level programming language language ).A program that translates from a low level language to a higher level one is a decompiler .A program that translates between high -level languages is usually called a source to source translator , or language converter .
COMPILED VERSUS INTERPRETED LANGUAGES
Higher-level programming languages are generally divided for convenience into compiled languages and interpreted languages .
However, there is rarely anything about a language that requires it to be exclusively compiled, or exclusively interpreted.
The categorization usually reflects the most popular or widespread implementations of a language — for instance, BASIC is sometimes called an interpreted language, and C a compiled one, despite the existence of BASIC compilers and C interpreters.
In a sense, all languages are interpreted, with "execution" being merely a special case of interpretation performed by transistors switching on a CPU . Modern trends toward just-in-time compilation and byte code interpretation also blur the traditional categorizations.
There are exceptions. Some language specifications spell out that implementations must include a compilation facility; for example, Common Lisp . Other languages have features that are very easy to implement in an interpreter, but make writing a compiler much harder; for example, APL , SNOBOL4 , and many scripting languages allow programs to construct arbitrary source code at runtime with regular string operations, and then execute that code by passing it to a special evaluation function. To implement these features in a compiled language, programs must usually be shipped with a runtime library that includes a version of the compiler itself.
Related Links
- Operating System Services
- Windows 8-Opening safe mode
- Command Prompt 1
- Command Prompt 2
- Creating StopvWatch Application in Visual Basic
No comments:
Post a Comment