1. Compiled languages
- Compiled languages are directly converted into machine code that the processor can execute.
- The target machine directly translates the program.
- If a person writes the code, the compiler separates the file and the end result is an executable file. So basically, the owner keeps the source code.
- Compilation errors prevent the code from compiling.
- Advantage: tend to RUN faster than interpreted code. This is because the translation happens before the run time.
- Disadvantage: Additional time is needed to finish the entire compilation step before testing,
e.x) C, C++, Java, Erlang, Haskell, Rust, and Go.
2. Interpreted language
- The source code is not directly translated by the target machine. Instead, a copy is given to another machine, such as the interpreter, and that machine reads and executes the code.
- Interpreters read a program line by line and execute each command.
- So while in this language, interpreted programs can be modified while the program is running.
- All the debugging occurs at the run-time.
- Advantage: more flexible, allowing dynamic typing and smaller program size.
- Disadvantage: slow execution time
e.x) PHP, Ruby, Python, and JavaScript.
ref: https://www.geeksforgeeks.org/difference-between-compiled-and-interpreted-language/