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
Vangie Beal is a freelance business and technology writer covering Internet technologies and online business since the late '90s.
Get the Free Newsletter
Subscribe to Daily Tech Insider for top news, trends & analysis
This email address is invalid.
Get the Free Newsletter
Subscribe to Daily Tech Insider for top news, trends & analysis
This email address is invalid.

Related Articles

Virtual Private Network (VPN)

A virtual private network (VPN) encrypts a device's Internet access through a secure server. It is most frequently used for remote employees accessing a...

Gantt Chart

A Gantt chart is a type of bar chart that illustrates a project schedule and shows the dependency between tasks and the current schedule...

Input Sanitization

Input sanitization is a cybersecurity measure of checking, cleaning, and filtering data inputs from users, APIs, and web services of any unwanted characters and...

IT Asset Management Software

IT asset management software (ITAM software) is an application for organizing, recording, and tracking all of an organization s hardware and software assets throughout...

ScalaHosting

ScalaHosting is a leading managed hosting provider that offers secure, scalable, and affordable...

HRIS

Human resources information system (HRIS) solutions help businesses manage multiple facets of their...

Best Managed Service Providers...

In today's business world, managed services are more critical than ever. They can...