Compiled vs Interpreted Languages

When referring to a programming language as “compiled” or “interpreted”, the meaning is about how the computer turns your programming into “machine code” (zeros and ones) that the computer then uses.

Compiled

A “compiled” language compiles the code once, and stores the machine code. This gives the advantage of a faster execution time after compiling, as opposed to “interpreted” languages. The downside of this is that the compiling process itself is slower, possibly taking away time during development. However, for performance-dependant or mission-critical applications, this post-compile speed is necessary, and so compiled languages are preferred.

Compiled languages on this site include:

  • C++

  • C#

  • Java

  • Swift

Interpreted

An “interpreted” language converts straight from your code to machine code while the program is run. The program itself is slower, however there is no time needed to compile, therefore reducing time wasted during development. For use-cases where peak performance isn’t a necessity, but continued development is, interpreted languages can make more sense.

Interpreted languages on this site include:

  • JavaScript

  • Python

Speeds

This site gives a good idea of each language’s speed, or time to compute a given task. “Speed” is relative, of course, so this is not the end-all-be-all of benchmarks. However, you will notice that the compiled languages are an order of magnitude faster than the interpreted languages, and that is something that is consistent. C++ here, for instance, appears to be about thirty times faster than python in this program.

Note

Any language can be compiled or interpreted. This page mentions what is typical for each language. For an example to the contrary, see PyPy, an implimentation of Python that is closer to normal compilation. See a speed comparison here.