Categories
PHP

Compiled vs. Interpreted Languages

A friend of mine has asked me today what the difference between compiled and interpreted languages is; so here is the answer for her and anybody else who needs it.

What is compiler
A compiler is a computer program that transforms source code (programming language/source language) to another computer language (the target language). The most common reason for converting source code is to create an executable program.

The name “compiler” is used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language or machine code).

Compiler v/s Interpreter

Compiled language v/s Interpreted language
A compiled language is one where you have to compile the code before it can be executed. The compilation process, for those that don’t know it, transforms the source code into object code; the later can be directly executed by the microprocessor (as it’s formed by opcodes), while the former can’t. So, more generically, a compiled language can be executed, after compilation, without any helper utility. Examples of these include C, C++ and assembler.

An interpreted language is one where you can execute the code without compilation, by means of an interpreter. An interpreter reads the code from the source file and executes it, without converting it to machine code (forget about JIT compilers for now). The way this is done depends on the specific interpreter you are using; but to get an idea, they often construct a parse tree – an in-memory representation of the code structure – from the source file and then evaluate it. Examples of these include Perl, Python, PHP, Basic and POSIX shell scripting.

Sources
https://www.quora.com/What-is-the-difference-between-compiled-and-interpreted-programming-languages

Difference between Compiler and Interpreter

Stay in touch

For a daily email update, click HERE or enter your email and stay on top of things by receiving weekly news in your inbox.

By Vaseem Ansari

I’m Vaseem, a Software Engineer by Profession, a Traveler, a Foodie by Heart and the founder of VaseemAnsari.com. I started traveling from college days and it has become a part of me now. So when ever I happen to get a chance I pack my bag and am on the roads. You can follow me on these social networks Facebook, Twitter, Google+ and Linkedin.

One reply on “Compiled vs. Interpreted Languages”

Leave a Reply

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