FACTOID # 45: American adults have spent more time than anyone in education .
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Interpreter (computing)

In computer science, an interpreter is a computer program that executes, or performs, instructions written in a computer programming language. Interpretation is one of the two major ways in which a programming language can be implemented, the other being compilation. Computer science, or computing science, is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. ... A computer program is a collection of instructions that describe a task, or set of tasks, to be carried out by a computer. ... An alternate rewrite has been has been proposed. ... A diagram of the operation of a typical multi-language, multi-target compiler. ...


The term interpreter may refer to a program that executes source code that has already been translated to some intermediate form, or it may refer to the program that performs both the translation and execution (e.g., many BASIC implementations). Source code (commonly just source or code) is any series of statements written in some human-readable computer programming language. ... Screenshot of Atari BASIC, an early BASIC language for small computers. ...

Contents

Structure of an interpreter

An interpreter needs to be able to analyze, or parse, instructions written in the source language. It also needs to represent any program state, such as variables or data structures, that a program may create. It needs to be able to move around in the source code when instructed to do so by control flow constructs such as loops or conditionals. Finally, it usually needs to interact with an environment, such as by doing input/output with a terminal or other user interface device. An example of parsing a mathematical expression. ... In computer science and mathematics, a variable (IPA pronunciation: ) (sometimes called a pronumeral) is a symbolic representation denoting a quantity or expression. ... A binary tree, a simple type of branching linked data structure. ... In computer science control flow (or alternatively, flow of control) refers to the order in which the individual statements, instructions or function calls of an imperative or functional program are executed or evaluated. ... In computer science and in computer programming, statements in pseudocode or in a program are normally obeyed one after the other in the order in which they are written (sequential flow of control). ... In computer science, conditional statements are a vital part of a programming language. ... Energy Input: The energy placed into a reaction. ... A computer terminal is an electronic or electromechanical hardware device that is used for entering data into, and displaying data from, a computer or a computing system. ... The user interface is the part of a system exposed to users. ...


Interpreted vs compiled languages

Any language can be implemented via an interpreter or compiler; there is no such thing as an "interpreted language" or "compiled language", only interpreted and compiled implementations of a language. Indeed, a single program may contain parts that are implemented via interpreter and a compiler, e.g., some Lisp systems. Nonetheless, certain languages are best known for having particular kinds of implementations, and because of this are often termed "compiled" or "interpreted" languages (although technically these terms are more accurately reserved for implementations). Lisp is a family of computer programming languages with a long history and a distinctive fully-parenthesized syntax. ...


Many "interpreters" today include some element of compilation as well, such as a bytecode compiler, as found in Perl and Python. In such an arrangement, source code is compiled to a more efficient intermediate form, which is then interpreted. Wikibooks has a book on the topic of Perl Programming Perl is a dynamic programming language created by Larry Wall and first released in 1987. ... Python is an interpreted programming language created by Guido van Rossum in 1990. ...


Efficiency

The main disadvantage of interpreters is that when a program is interpreted, it runs slower than if it had been compiled. The difference in speeds could be tiny or great; often an order of magnitude and sometimes more. It generally takes longer to run a program under an interpreter than to run the compiled code but it can take less time to interpret it than the total time required to compile and run it. This is especially important when prototyping and testing code when an edit-interpret-debug cycle can often be much shorter than an edit-compile-run-debug cycle.


Interpreting code is slower than running the compiled code because the interpreter must analyze each statement in the program each time it is executed and then perform the desired action whereas the compiled code just performs the action. This run-time analysis is known as "interpretive overhead". Access to variables is also slower in an interpreter because the mapping of identifiers to storage locations must be done repeatedly at run-time rather than at compile time.


There are various compromises between the development speed when using an interpreter and the execution speed when using a compiler. Some systems (e.g., some LISPs) allow interpreted and compiled code to call each other and to share variables. This means that once a routine has been tested and debugged under the interpreter it can be compiled and thus benefit from faster execution while other routines are being developed. Many interpreters do not execute the source code as it stands but convert it into some more compact internal form. For example, some BASIC interpreters replace keywords with single byte tokens which can be used to find the instruction in a jump table. An interpreter might well use the same lexical analyzer and parser as the compiler and then interpret the resulting abstract syntax tree. Lisp is a family of computer programming languages with a long history and a distinctive fully-parenthesized syntax. ... BASIC (Beginners All-purpose Symbolic Instruction Code) is a family of high-level programming languages. ... Keywords are the words that are used to reveal the internal structure of an authors reasoning. ... In computer science, a jump table is a list of the addresses of a set of routines which can be selected by number. ... In computer science, lexical analysis is the process of converting a sequence of characters into a sequence of tokens. ... A parser is a computer program or a component of a program that analyses the grammatical structure of an input, with respect to a given formal grammar, a process known as parsing. ... In computer science, an abstract syntax tree (AST) is a finite, labeled, directed tree, where the internal nodes are labeled by operators, and the leaf nodes represent the operands of the node operators. ...


Bytecode interpreter

There is a spectrum of possibilities between interpreting and compiling, depending on the amount of analysis performed before the program is executed. For example, Emacs Lisp is compiled to bytecode, which is a highly compressed and optimized representation of the Lisp source, but is not machine code (and therefore not tied to any particular hardware). This "compiled" code is then interpreted by a bytecode interpreter (itself written in C). The compiled code in this case is machine code for a virtual machine, which is implemented not in hardware, but in the bytecode interpreter. The same approach is used with the Forth code used in Open Firmware systems: the source language is compiled into "F code" (a bytecode), which is then interpreted by a virtual machine. Emacs Lisp is a dialect of the Lisp programming language used by the GNU Emacs and XEmacs text editors (which we will collectively refer to as Emacs in this article. ... Bytecode is a binary representation of an executable program designed to be executed by a virtual machine rather than by dedicated hardware. ... C is a general-purpose, block structured, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. ... In computer science, a virtual machine is software that creates a virtualized environment between the computer platform and its operating system, so that the end user can operate software on an abstract machine. ... Forth is a programming language and programming environment, initially developed by Charles H. Moore at the US National Radio Astronomy Observatory in the early 1970s. ... Open Firmware (also, OpenBoot) is a hardware-independent firmware (computer software which loads the operating system), developed by Mitch Bradley at Sun Microsystems, and used in post-NuBus PowerPC-based Apple Macintosh computers, Sun Microsystems SPARC based workstations and servers, IBM POWER systems, Pegasos systems, and the laptop designed by...


Just-in-time compilation

Just-in-time compilation, or JIT, refers to a technique where bytecode is compiled to native machine code at runtime; giving the high execution speed of running native code at the cost of increased startup-time as the bytecode is compiled. It has gained attention in recent years, which further blurs the distinction between interpreters, byte-code interpreters and compilation. JIT is available for both the .NET and Java platforms. The JIT technique is a few decades old, appearing in languages such as Smalltalk in the 1980s. For other uses, see Just In Time. ... Machine code or machine language is a system of instructions and data directly understandable by a computers central processing unit. ... The Microsoft . ... The Java platform is the name for a bundle of related programs, or platform, from Sun Microsystems which allow for developing and running programs written in the Java programming language. ... For other uses, see Small talk. ...


Example of a simple interpreter

There is an example of a simple program and interpreter in the Literate programming article. See also: Lisp in Small Pieces Literate programming is the writing of computer programs primarily for human beings to read, similar to a work of literature; hence the name literate programming. ... Lisp in Small Pieces (Cambridge University Press; New Ed edition (December 4, 2003) ISBN 0521545668)is a book by Christian Queinnec on Lisp, Scheme and other related dialects, their interpretation, semantics, and compilation and contains code for 11 interpreters and 2 compilers. ...


Punched card interpreter

The term "interpreter" often referred to a piece of unit record equipment that could read punched cards and print the characters in human-readable form along the top edge of the card. The IBM 550 Numeric Interpreter and IBM 557 Alphabetic Interpreter are typical examples from 1930 and 1954, respectively. Before the advent of electronic computers, data processing was performed using electromechanical devices called unit record equipment, electric accounting machines (EAM) or tabulating machines. ... The punch card (or Hollerith card) is a recording medium for holding information for use by automated data processing machines. ... The IBM 550 numerical interpreter. ... The IBM 557 Alphabetic Interpreter allowed holes in punch cards to be interpreted and the Hollerith punch card characters printed on any row or column, programmed by the means of a wiring plug board. ... Year 1930 (MCMXXX) was a common year starting on Wednesday (link will display 1930 calendar) of the Gregorian calendar. ... Year 1954 (MCMLIV) was a common year (link will display full calendar) of the Gregorian calendar. ...


See also

In computing, partial evaluation is a technique for program optimization by specialization. ... In computer programming, an interpreted language is a programming language whose programs may be executed from source form, by an interpreter. ... A compiled language is a programming language whose implementations are typically compilers (translators which generate machine code from source code), and not interpreters (step-by-step executors of source code, where no translation takes place). ... Dynamic compilation is a process used by some programming language implementations to gain performance during program execution. ... In computer science, the term threaded code refers to an implementation technique for programming languages that produces very compact code. ... A self-interpreter (frequently called meta-circular interpreter or meta-interpreter) is a programming language interpreter written in the language it interprets. ...

External links

  • IBM Card Interpreters page at Columbia University

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL. This article does not cite any references or sources. ... Bold text // “GFDL” redirects here. ...


  Results from FactBites:
 
Interpreter (computing) - Wikipedia, the free encyclopedia (703 words)
Interpreting code is slower than running the compiled code because the interpreter must analyse each statement in the program each time it is executed and then perform the desired action whereas the compiled code just performs the action.
An interpreter might well use the same lexical analyzer and parser as the compiler and then interpret the resulting abstract syntax tree.
The IBM 550 Numeric Interpreter and IBM 557 Alphabetic Interpreter are typical examples from 1930 and 1954, respectively.
Interpreter - Computing Reference - eLook.org (418 words)
It may be possible to execute the same source code either directly by an interpreter or by compiling it and then executing the machine code produced.
An interpreter might well use the same lexical analyser and parser as the compiler and then interpret the resulting abstract syntax tree.
This "compiled" code is then executed (interpreted) by a byte code interpreter (itself written in C).
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.