Interpreter

An interpreter is a program that executes instructions written in a high-level language. Interpreters enable other programs to run on a computer or server. They process program code at run time, checking the code for errors line by line.

There are two ways to run programs written in a high-level language. The most common is to compile the program; the other method is to pass the program through an interpreter.

INTERPRETER VERSUS COMPILER

An interpreter translates high-level instructions into an intermediate form, which it then executes. In contrast, a compiler translates high-level instructions directly into machine language. Compiled programs generally run faster than interpreted programs. Compilers see all errors upon compilation, which must all be resolved before the program can run. Since the errors have all been fixed by runtime, the program will run more quickly.

Interpreted programs typically run more slowly than compiled programs, because interpreters translate code one section at a time. An interpreter requires a discovered error to be fixed before the program can continue running.

The advantage of an interpreter, however, is that it does not need to go through the compilation stage during which machine instructions are generated. The compilation process can be time-consuming if the program is long. An interpreter, on the other hand, can immediately execute high-level programs.

 Interpreters are sometimes used during the development of a program, when a programmer wants to add small sections at a time and test them quickly. Interpreters are also often used in education because they allow students to program interactively.

Both interpreters and compilers are available for most high-level languages. However, BASIC and LISP are especially designed to be executed by an interpreter. In addition, page description languages, such as PostScript, use an interpreter. Every PostScript printer, for example, has a built-in interpreter that executes PostScript instructions.

Dynamic and static typing

Dynamic and static typing have to do with how data types in a program are handled at compilation time. Dynamically typed programs don’t require data types to be checked for accuracy until the program runs; statically typed programs require type checking at compilation. There is no completely direct connection between typing and using an interpreter or compiler. Interpreters can translate both dynamically and statically typed code, and compilers can also compile both static and dynamic programs.

 

 

 

Vangie Beal
Vangie Beal is a freelance business and technology writer covering Internet technologies and online business since the late '90s.

Top Articles

List of Windows Operating System Versions & History [In Order]

The Windows operating system (Windows OS) refers to a family of operating systems developed by Microsoft Corporation. We look at the history of Windows...

How to Create a Website Shortcut on Your Desktop

Website Shortcut on Your Desktop reviewed by Web Webster   This Webopedia guide will show you how to create a website shortcut on your desktop using...

What are the Five Generations of Computers? (1st to 5th)

Reviewed by Web Webster Learn about each of the 5 generations of computers and major technology developments that have led to the computing devices that...

Hotmail [Outlook] Email Accounts

Launched in 1996, Hotmail was one of the first public webmail services that could be accessed from any web browser. At its peak in...

Indicators of Compromise

When a system administrator finds anomalous or malicious behavior within network...

Disk Drive

A disk drive is a device that allows a computer to read from...

Firewall as a Service...

For the cloud-first organization, Firewall as a Service (FWaaS) brings all...