what is an interpreted language

1 year ago 94
Nature

An interpreted language is a programming language where the instructions are not directly executed by the target machine, but instead read and executed by some other program called an interpreter. The interpreter translates high-level, human-readable source code into low-level, machine-readable target code line by line while the interpreted program is being executed. Interpreted languages are highly adaptable, but less efficient because the interpreter must be present for the entire process. Examples of interpreted languages include JavaScript, Perl, Python, and BASIC.

In contrast, a compiled language is a programming language that is generally compiled and not interpreted. In a compiled language, the program is translated directly into machine code by a compiler, which is a program that translates source code into machine code. Once compiled, the program is expressed in the instructions of the target machine, and this machine code is undecipherable by humans. Examples of compiled languages include C, C++, C#, COBOL, and Fortran.

From a programmers perspective, there is little difference working with an interpreted language, a compiled language, or a scripting language. The process is the same: you write human-readable code, and it gets executed on a machine. It is only the parts in-between those two that differ. Historically, languages that compile to native code allow the programmer the most flexibility because they can take advantage of every aspect of the machine they are programming. In the real world, compiled languages are preferred for computing-intensive software that requires heavy resource usage or in a distributed system where optimal performance from the processor is a key factor. Interpreted languages are preferred for less computing-intensive software.