BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help

Interpreted language

Print-Friendly
About 2 pages (689 words)

Bookmark and Share Know this topic well? Help others and get FREE products!

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 .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.

Contents

Historical background

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).

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 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

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.

External links

  • DrPubaGump A tiny Interpreter written in Scheme, which provides to interpret PUBA-GUMP (a subset of BASIC) in Scheme

See also

View More Summaries on Interpreted language
 
Ask any question on Interpreted language and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Interpreted language from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

Article Navigation
Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy