Science Fair Project Encyclopedia
Context of Execution
The context in which execution takes place is crucial. Very few programs are executed on a bare machine. Programs usually contain implicit and explicit assumptions about resources available at the time of execution. Most programs are executed with the support of an operating system and run-time libraries specific to the source language that provide crucial services not supplied directly by the computer itself. This supportive environment, for instance, usually decouples a program from direct manipulation of the computer peripherals, providing more general, abstract services instead.
A system that executes a program is called an interpreter of the program. Loosely speaking, an interpreter actually does what the program says to do. This is in contrast to a language translator that converts a program from one language to another. The most common language translators are compilers. Translators typically convert their source language to a language that is simpler and faster to execute. The ideal is that the ratio of executions to translations of a program will be large, thus providing a large benefit for translation versus direct interpretation of the source language.
Translators usually produce an abstract result that is not completely ready to execute. The conversion of the translator object code into the final form that is executed is frequently performed by the operating system just before execution of the program begins. This usually involves modifying the code to bind it to real hardware addresses and establishing address links between the program and support code in libraries. In some cases this code is further transformed the first time it is executed, for instance by just-in-time compilers, into a more efficient form that persists for some period, usually at least during the current execution run.
The machine language that is documented as the programming target for most computers is, in almost all cases today except perhaps for very simple processors, actually interpreted by a microprogram running inside the processor, on the real hardware. There have been numerous attempts to design RISC computers that avoid micro-execution, but the distinction between complex and reduced instruction sets has tended to blur over time. The main distinction between this sort of micro-interpreter and an acknowledged software interpreter is that the microcode usually does not change. In the past microcode usually changed only slowly. The execution hardware today is sometimes implemented in field-reprogrammable logic , and execution schemes that modify the hardware dynamically to match the current requirements exist and may become increasingly common.
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details