Interpreting the program

Now, let’s suppose that we choose an interpreter to execute our program. We have the file with its source code on the disk drive. The file is ready for execution. When we run it, the OS loads the interpreter first. Then, the interpreter reads our source code file into the RAM and executes it line by line.

The translation of source code commands to machine code instructions happens in the RAM. Some interpreters save files with an intermediate representation of the program to the disk drive. It speeds up the program execution if we restart it. However, we always need to run an interpreter first to execute our program.

The figure below shows the process of interpreting the program.

Get hands-on with 1400+ tech skills courses.