What Is An "Interpreted" Language?

Jason C. McDonald - Sep 1 '19 - - Dev Community

There seems to be a considerable amount of debate about what defines an interpreted language.

My view is pretty cut-and-dry:

  • A compiled language is one that is primarily compiled to machine code which is executed natively by the CPU on most standard hardware (Intel, AMD, ARM, etc.) C, C++, and Ada are three examples of this.

  • An interpreted language is one that is primarily executed either as source code or bytecode through a dedicated virtual machine. Python, Ruby, and Java are three examples of this.

It should be understood that, in theory, if not in unconvential practice, any compiled language can also be run as source or bytecode in a virtual machine; conversely, any interpreted language can be theoretically converted to machine code.

(Mind you, I'm not really invested in defending my viewpoint. I want to see what everyone else thinks, and why.)

A Few Definitions

Just to keep us on topic, instead of descending into the pedantic word-mincing that sometimes occurs in these sorts of discussions, let's use these as our common definitions.

Even if you think these are "slightly off", please just roll with this to make the core topic accessible to everyone. If you need to use a different term, be sure to define it.

Remember, not everyone has a vast academic background in computer science!

  • Assemble — to convert source code, bytecode, or object code into machine code. (Contrast with compile.)

  • Assembler — produces machine code (assembly code).

  • Binary file — an executable file containing machine code.

  • Bundled executable — an executable file containing both code and a virtual machine.

  • Bytecode — Code which is intended primarily to efficiently provide direct instructions to a virtual machine, rather than to be human-readable. (Contrast with source code, machine code and object code.)

  • Central Processing Unit [CPU] — the physical piece of hardware on the computer in question which is responsible for executing instructions in the form of machine code.

  • Code — catch-all term that can include source code, machine code, bytecode, and object code.

  • Compile — to convert code to source code in another language, to bytecode, or to object code. (Contrast with assemble.)

  • Compiler — converts code to either source code in another language, or to bytecode. (Contrast with assembler.)

  • Executable file — a file containing either source code, bytecode, or machine code, but which can be "executed" directly on the operating system. (In the case of bytecode, it may invoke a virtual machine as part of its execution.)

  • Interpreter — see virtual machine [VM].

  • (Programming) Language — a complete set of syntax and grammar, in which source code is written.

  • Machine code — assembly language code, in the "flavor" of assembly native to the physical CPU on the computer in question. (Contrast with bytecode and object code.)

  • Object code — "intermediary" code which is not intended to be executed directly (contrast with bytecode), but is converted by the assembler into machine code. (Borrowed from C/C++ terminology; goes by other names in other languages.)

  • Source code — code which is intended primarily to be readable to humans. (Contrast with bytecode, object code, and machine code.)

  • (CPU) Virtualizer — a piece of software which is intended primarily to emulate a CPU, but which executes the same machine code a CPU would. (Contrast with virtual machine and CPU.) [I know I'm flubbing the vocabulary, but I want to make sure we don't confuse the two; they're not the same in this topic.]

  • Virtual machine [VM] or interpreter — a piece of software which interprets and executes instructions from bytecode or source code. Examples include the Java JVM and the Python interpreter. (Contrast with (CPU) Virtualizer and CPU.)

Ground Rules

Be polite! We're here to debate ideas, not people.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player