- Interpreted language
computer programmingan interpreted language is a programming languagewhose implementation often takes the form of an interpreter. Theoretically, any language may be compiled or interpreted, so this designation is applied purely because of common implementation practice and not some underlying property of a language.
Many languages have been implemented using both compilers and interpreters, including Lisp, Pascal, C, BASIC, and Python. While Java is translated to a form that is intended to be interpreted,
just-in-time compilationis often used to generate machine code. The Microsoft.Net languages compile to CIL from which is often then compiled into native machine code; however there is a virtual machinecapable of interpreting CIL.
Historical background of Interpreted/Compiled
In the early days of computing, language design was heavily influenced by the decision to use compilation or interpretation as a mode of execution. For example, some compiled languages require that programs must explicitly state the data-type of a
variableat the time it is declared or first used while some interpreted languages take advantage of the dynamic aspects of interpretation to make such declarations unnecessary. For example, Smalltalk—which was designed to be interpreted at run-time—allows generic Objects to dynamically interact with each other.
Initially, interpreted languages were compiled line-by-line; that is, each line was compiled as it was about to be executed, and if a loop or subroutine caused certain lines to be executed multiple times, they would be recompiled every time. This has become much less common. Most so-called interpreted languages use an
intermediate representation, which combines both compilation and interpretation. In this case, a compiler may output some form of bytecodeor threaded code, which is then executed by a bytecode interpreter. Examples include Python, and Java. Similarly, Ruby uses an abstract syntax treeas intermediate representation. The intermediate representation can be compiled once and for all (as in Java), each time before execution (as in Perl or Ruby), or each time a change in the source is detected before execution (as in Python).
Language features suiting interpreters well
Interpreted languages still give programs certain extra flexibility over compiled languages. Features that are easier to implement in interpreters than in compilers include (but are not limited to):
* platform independence (Java's byte code, for example)
* reflective usage of the evaluator (e.g. a first-order
* ease of
debugging(It is easier to get source code information in interpreted languages)
* small program size (Since interpreted languages have flexibility to choose instruction code)
* object polymorphism
* dynamic scoping
List of frequently interpreted languages
*APL A vector oriented language using an unusual character set.
*ASP Web page scripting language
*BASIC (although the original version, Dartmouth BASIC, was compiled, as are many modern BASICs)
*Equation manipulation and solving systems
*Euphoria Interpreted or compiled.
*Forth (traditionally threaded interpreted)
*J An APL variant in which tacit definition provides some of the benefits of compilation.
MUMPS(traditionally interpreted, modern versions compiled)
R (programming language)
JRuby( A Java implementation of Ruby)
Smalltalk(pure object-orientation, originally from Xerox PARC, often supports debugging across machines.)
**Excel stores formulas, interprets them from a tokenized format.
S (programming language)
Languages usually compiled to a virtual machine code
Many interpreted languages are first compiled to some form of
virtual machinecode, which is then either interpreted or compiled at runtime to native code.
*Java (frequently translated to
bytecode, but can also be compiled to a native binary using an AOT compiler)
.NET Frameworklanguages (translated to CIL code)
Visual Basic .NET
* [http://drpubagump.ouaibou.info DrPubaGump] A tiny Interpreter written in Scheme, which provides to interpret PUBA-GUMP (a subset of BASIC) in Scheme fr icon
Wikimedia Foundation. 2010.