In the programming world you will hear a lot about pros and cons of interpreted vs compiled language. New programmers often ponder about whether to learn a compiled or interpreted language. Here is a tip, scratch this comparison from your head. There is no such thing as interpreted language or compiled language. Lets understand why.

Interpreter vs Compiler

Lets understand the basic difference between the two. Compiler is a program that translates from one (source) language to another (target) language. For example a C compiler might convert high level C program (source) into low level X86 (target) instructions. You can get high level overview of how compilers work here. The compiled code can then be executed. So there are two distinct steps needed in order to run the program; namely compilation and then execution. Interpreter, on the other hand not just converts from high level language to some intermediate representation but also interprets (executes) instructions. In other words interpreters “do” while compilers “think about doing”.

Interpreter vs compiler

Thus, you can create a compiler or an interpreter for any language. Compiled or interpreted “language” doesn’t carry any meaning. It is true that for some languages only interpreters are written while for some only compilers are written. This is mostly because the language syntax and semantics are more suitable to be used with compiler than interpreter or vice versa. But there is nothing that is stopping you from creating interpreter or a compiler for any language.

Conclusion

You can create interpreter or a compiler for any language and there is no such thing as interpreted vs compiled language. In addition, you can have a combination of both. For example Python is first “compiled” into an intermediate byte code (.pyc files) which are then interpreted by Python interpreter.

Categories: Technology

0 Comments

Leave a Reply

Avatar placeholder

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