Compiled vs Interpreted
Last updated
Last updated
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):
hybrid between normal compilation and interpretation
Store already compiled machine code (base on how often a piece of code is executed)