Interpreted language

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In computer programming an interpreted language is a programming language whose 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, 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 implementation of C# compiles to CIL from which is often then compiled into native machine code; however there is a virtual machine capable of interpreting CIL.

Contents

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. On the other hand, some 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).

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 eval function)
  • dynamic typing
  • 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

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.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.