问题
From Thinking in C++ - Vol. 1:
Interpreters have many advantages. The transition from writing code to executing code is almost immediate, and the source code is always available so the interpreter can be much more specific when an error occurs.
What does the bold line mean?
Does it mean that the interpreter cannot work unless whole of the program is in memory? Which means we cannot divide the program into modules and then have the modules interpreted as and when needed (like we do with compilers)?
If yes, then what's the reason behind this?
UPDATE:
From Thinking in C++ - Vol. 1:
Most interpreters require that the complete source code be brought into the interpreter all at once.
So, does this now indicate what I wrote above?

回答1:
Does it mean that the interpreter cannot work unless whole of the program is in memory?
No. The whole program need not to be in memory. the parts are loaded into memory as and when required.
Means we cannot divide the program into modules and then have the modules interpreted as and when needed (like we do with compilers)?
You can very well modularize your programs. but the required modules should be availble when required by interpreter.
And the bold line: the source code is always available
It means that it's the source code that runs, i.e. converted to machine specific instruction at run time. line by line without being converted to a different (intermediate) format. (as is done by compiler)
From Wikipedia:
An interpreter may be a program that uses one the following strategies for program execution:
- executes the source code directly
- translates source code into some efficient intermediate representation (code) and immediately executes this
- explicitly executes stored precompiled code1 made by a compiler which is part of the interpreter system
Efficiency
The main disadvantage of interpreters is that when a program is interpreted, it typically runs more slowly than if it had been compiled. The difference in speeds could be tiny or great; often an order of magnitude and sometimes more. It generally takes longer to run a program under an interpreter than to run the compiled code but it can take less time to interpret it than the total time required to compile and run it. This is especially important when prototyping and testing code when an edit-interpret-debug cycle can often be much shorter than an edit-compile-run-debug cycle.
回答2:
For compiled languages, when you run the program, you don't have the source code — you have compiled machine/byte code and this is executed on the machine (or VM in the case of Java).
Interpreters work on the source code and immediately interpret it and executes it using some internal mechanism. Since their working data is the source code itself, it is always available to them.
来源:https://stackoverflow.com/questions/14037090/what-does-it-mean-to-say-that-the-source-code-is-always-available-to-interpreter