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.
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
- 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.