Share on Facebook Share on Twitter Email
Answers.com

Interpreted language

 
Sci-Tech Dictionary: interpretive language
(in′tər·prəd·iv ′laŋ·gwij)

(computer science) A computer programming language in which each instruction is immediately translated and acted upon by the computer, as opposed to a compiler which decodes a whole program before a single instruction can be executed. Also known as interpretive code.


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
Wikipedia: Interpreted language
Top

In computer programming, an interpreted language is a programming language whose programs are not directly executed by the host cpu but rather executed (or said to be interpreted) by a software program known as an interpreter. The source code of the program is often translated to a form that is more convenient to interpret, which may be some form of machine language for a virtual machine. 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. Some languages have characteristics which mean that there is little performance difference between an interpretive or compiled based approach to their implementation.

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 compilation is 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 machine capable of interpreting CIL. Many Lisp implementations can freely mix interpreted and compiled code. These implementations also use a compiler that can translate arbitrary source code at runtime to machine code.

Contents

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 variable at 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 bytecode or threaded code, which is then executed by a bytecode interpreter. Examples include Python, and Java. Similarly, Ruby uses an abstract syntax tree as 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).

Advantages of interpreted languages

Interpreted languages 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):

Disadvantages of interpreted languages

An execution by an interpreter is usually much less efficient than regular program execution. It happens because either every instruction should pass an interpretation at runtime or as in newer implementations, the code has to be compiled to an intermediate representation before every execution. The virtual machine is a partial solution to the performance issue as the defined intermediate-language is much closer to machine language and thus easier to be translated at run-time. Another disadvantage is the need of an interpreter on the local machine to make the execution possible.

List of frequently interpreted languages

Languages usually compiled to a virtual machine code

Many interpreted languages are first compiled to some form of virtual machine code, which is then either interpreted or compiled at runtime to native code.

See also


 
 

 

Copyrights:

Sci-Tech Dictionary. McGraw-Hill Dictionary of Scientific and Technical Terms. Copyright © 2003, 1994, 1989, 1984, 1978, 1976, 1974 by McGraw-Hill Companies, Inc. All rights reserved.  Read more
Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Interpreted language" Read more