-1

I read a lot about the comparison between compiler and an interpreter, but what i found that, compiler compiles a file into .obj file which after linking becomes .exe file.
But in the case of an interpreter, it interprets the code line by line and executes it directly...
My question is:- WHILE INTERPRETATION, HOW DOES THE INTERPRETER MAKES REFERENCE TO A LIBRARY FUNCTION OR A CODE THAT IS WRITTEN A LITTLE LATER THAN THE CURRENT CODE THAT IS BEING EXECUTED?
AND WHERE IS THE INTERPRETED CODE SAVED IMMEDIATELY AFTER EXECUTION? AS I HAD A DOUBT HOW CAN IT BE EXECUTED LINE BY LINE AS IT HAS TO MAKE SOME LIBRARY REFERENCES OR OTHER REFERENCES?

please please please help asap.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Narue
0

Interpreted code isn't necessarily executed line by line. In many cases it's compiled to an easier to run intermediate form (Java bytecode, for example). While an interpreter might be one program that reads and runs source code all at the same time, often you'll really have two programs under the hood: one to compile source code and one to run the compiled result.

In the case of library references, it really depends on how the interpreter works. If the libraries are in the same form as the source code, or an intermediate form, execution is a somewhat simple matter of handling multiple input files and piecing everything together into one monolithic instruction base. If the libraries really are in library form, such as a DLL, the interpreter's runtime environment needs to understand how to load and use such libraries.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.