Mohanad Kaleia

Idea for a cause

Interpreted Languages VS Compiled Languages

Have you ever wondered what is the difference between interpreted languages and compiled languages. You may already used some interpreted (scripting) languages like Python and some other compiled languages like C++. In this post I will explain briefly what is the difference between scripting and compiled languages.

The main difference between scripting and compiled languages is the former are interpreted where they do not require compilation step while the other do. For example a scripting language (e.g., Python) you can write a code and execute it write away without the need to compile it first and then execute it. The interpreter is execute the code line by line, that’s why interpreted languages considered slower than compiled languages. While a compiler convert the source code into a middle phase named as Byte-code. The byte-code is an executable version of the code that can be executed by an interpreter.

Examples of interpreted languages are PHP, JavaScript and Pyhon. While,  C++ for example is considered as a compiled languages.

There are many advantages of interpreted programming languages, some of them:

  • Interpreted languages saves the compilation time, that’s why they are good for proof of concept application and for scientific applications
  • Interpreted languages are platform independent, unlike in the compiled languages where we have to produce a compiled version for every platform and operating system. This is very useful in web, for example JavaScript application can be run on different browser under different operating system. Just imagine if JavaScript is compiled language then for any webpage we have to test what is the platform and send an appropriate compiled version of the code to the client!
  • Smaller executable package size comparing with a compiled source code

Now we need to speak about the advantages of compiled languages:

  • Compiled languages are considered to be faster in the execution than interpreted languages. Because of that many large and critical projects are written in C++. (e.g., Linux operating system, many web browsers, IDEs, games, …, etc)
  • Secured. the compiled version of a code is not clear and cannot be read this makes application written in compiled languages (e.g., C++) are hard for reverse engineering.

There are many other advantages and disadvantages of both, but I want to limit this post to highlight only the major differences between interpreted and compiled programming languages.

 

References:

  1. https://www.geeksforgeeks.org/whats-the-difference-between-scripting-and-programming-languages/
  2. https://www.codeproject.com/Articles/696764/Differences-between-compiled-and-Interpreted-Langu

Master Student at University of Oklahoma,
Electrical and Computer Engineering

Post a comment

  • *