Difference between revisions of "Interpreter (computing)"
Karl Jones (Talk | contribs) (→See also) |
Karl Jones (Talk | contribs) (etc) |
||
Line 6: | Line 6: | ||
** Examples: early versions of the Lisp programming language and Dartmouth BASIC | ** Examples: early versions of the Lisp programming language and Dartmouth BASIC | ||
* Translate source code into some efficient intermediate representation and immediately execute this | * Translate source code into some efficient intermediate representation and immediately execute this | ||
− | ** Examples: [[Perl]], [[Python (programming language)|Python]], MATLAB, and Ruby | + | ** Examples: [[Perl]], [[Python (programming language)|Python]], [[MATLAB]], and [[Ruby (programming language)|Ruby]] |
* Explicitly execute stored precompiled code made by a compiler which is part of the interpreter system | * Explicitly execute stored precompiled code made by a compiler which is part of the interpreter system | ||
** Example: UCSD Pascal | ** Example: UCSD Pascal | ||
− | 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, contemporary versions of BASIC, Java and others may also combine two and three. | + | 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, contemporary versions of BASIC, [[Java (programming language)|Java]] and others may also combine two and three. | ||
While interpretation and compilation are the two main means by which programming languages are implemented, they are not mutually exclusive, as most interpreting systems also perform some translation work, just like compilers. | While interpretation and compilation are the two main means by which programming languages are implemented, they are not mutually exclusive, as most interpreting systems also perform some translation work, just like compilers. |
Revision as of 06:56, 30 August 2015
In computer science, an interpreter is a computer program that directly executes, i.e. performs, instructions written in a programming or scripting language, without previously compiling them into a machine language program.
An interpreter generally uses one of the following strategies for program execution:
- Parse the source code and perform its behavior directly
- Examples: early versions of the Lisp programming language and Dartmouth BASIC
- Translate source code into some efficient intermediate representation and immediately execute this
- Explicitly execute stored precompiled code made by a compiler which is part of the interpreter system
- Example: UCSD Pascal
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, contemporary versions of BASIC, Java and others may also combine two and three.
While interpretation and compilation are the two main means by which programming languages are implemented, they are not mutually exclusive, as most interpreting systems also perform some translation work, just like compilers.
The terms "interpreted language" or "compiled language" signify that the canonical implementation of that language is an interpreter or a compiler, respectively.
A high level language is ideally an abstraction independent of particular implementations.
See also
External links
- Interpreter (computing) @ Wikipedia