The difference between the compiler and the interpreter is as follows:
The compiler scans the source code only once and changes it to the execution code (possibly machine code). The next time you run your program, you directly execute the execution code without analyzing the source code, which is efficient.
The interpreter, however, analyzes the source code each time you run your program.
This optimization only makes sense when your program will run more than once.
As @Eli Barzilay said, βa much better name for analyze is compile β your functions being analyzed are like executable code. Recursive functions are similar to programs that will be executed more than once.
source share