> For the complete documentation index, see [llms.txt](https://til.notdu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.notdu.com/back-end/programming-languages/compiled-vs-interpreted.md).

# Compiled vs Interpreted

| Compiled                                                                                                      | Interpreted                                                                                           |
| ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| compiler is a program that translates statements from programming language to another language (machine code) | Translating each statement into a sequence of one or more subroutines and then into machine code      |
| Not on the fly                                                                                                | On the fly                                                                                            |
| Speed of execution: executable can be directly executed on the target machine                                 | Nowadays, interpreted compiles into bytecode first -> prepare and optimize for further interpretation |
| Programs have to be compiled for a specific cpu architecture                                                  | There are not many fully interpreted languages left                                                   |
| Long compilation time                                                                                         | Faster compilation: for the implementations that compile to bytecode                                  |
| C, Go, Rust,..                                                                                                | Slower execution speed, potential for leaking source code                                             |
|                                                                                                               | JS                                                                                                    |

JIT (Just in time):&#x20;

* hybrid between normal compilation and interpretation
* Store already compiled machine code (base on how often a piece of code is executed)

![](https://2548495579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTsnKOX7xLvOtvOXY9MlI%2Fuploads%2FQOOgjtjYf9THNYPqOgSv%2Fimage.png?alt=media\&token=428b9e04-4938-4108-93d4-260d6dc95b59)
