compiled and interpreted
Article

What’s the difference between compiled and interpreted language?

The difference is not in the language; it is in the implementation

Compiled language such as c++, are converted to machine language (or “native code”) that run directly by the operation system.

in other word “In a compiled implementation, the original program is translated into native machine instructions, which are executed directly by the hardware.”

Interpreted languages, including c#, visual basic and F# are compiled to intermediate language. When the application is executed a runtime (or “just in time”) compiler translate this intermediate code into native code.

In other word “In an interpreted implementation, the original program is translated into something else. Another program, called “the interpreter”, then examines “something else” and performs whatever actions are called for. Depending on the language and its implementation, there are a variety of forms of “something else”.

From more popular to less popular, “something else” might be

  • Binary instructions for a virtual machine, often called bytecode, as is done in Lua, Python, Ruby, Smalltalk, and many other systems (the approach was popularized in the 1970s by the UCSD P-system and UCSD Pascal)
  • A tree-like representation of the original program, such as an abstract-syntax tree, as is done for many prototype or educational interpreters
  • A tokenized representation of the source program, similar to Tcl
  • The characters of the source program, as was done in MINT and TRAC

Leave a Reply

Your email address will not be published. Required fields are marked *