AiroServer's Blog

Interpreted vs. Compiled languages

Interpreted vs. Compiled languages

In this article, we are going to Compare Interpreted and Compiled languages. But first, let’s give you some needed information.

What are Interpreter and Compiler?

Compiler vs. Interpreter

Both Interpreter and Compiler are computer programs. Their responsibility is to translate high-level scripting languages to a machine language. High-level languages are the ones that are closer to human language. A machine language is an understandable language for machines.Scripting languages can either be interpreted or compiled. Interpreters translate Interpreted languages and Compilers translate compiled languages.

Interpreted languages: JavaScript, PHP, Perl, Ruby, Python, VBScript,…

Compiled Language: Visual Basic, C++, C#, Cobol,…

The differences:

Interpreted vs. Compiled
  1. How they work: Interpreters translate and execute scripts step by step. It means that they translate a statement, execute it and then goes for the next statement. Compilers translate everything and then, execute them.
  2. Platform dependent: Compiled languages are platform dependent. When a program is compiled, the operating system codes are also compiled in it. That’s why, when you compile a program on an OS, you can’t execute it on another OS. However, Interpreted programs aren’t like that. Interpreted programs only need an Interpreter to be executed. So, You can execute Interpreted programs on any platform that has an Interpreter.
  3. Speed: as we said earlier, Interpreters translate and execute step by step. That’s why it takes more time than compilers. Compiler translates the program once and after that it just executes it.
  4. Resource usage: Interpreter uses more CPU and RAM every time. Again it is because every time you want to execute interpreted language, interpreter has to translate and execute it. However, compile program executes faster and uses less RAM and CPU after being translated (compiled) once.
  5. Troubleshooting: Interpreted languages are easier to troubleshoot. When an Interpreter is translating a script, when a statement has a problem it just stops on that line and inform you about the error. So, you find the exact line that has a problem and fix the problem easily. Troubleshooting for Compiled languages is not that easy. Compilers translate the whole script and at the end inform you about errors. That’s why it’s harder to find the errors in compiled languages.

If you enjoyed this post, take a look at our other posts on our blog page!

Find More Articles...

Whats New?

AiroServer's Services

VPS | سرور مجازی | هاست | سرور اختصاصی

Leave a Reply

Your email address will not be published.