Difference between revisions of "Interpreter"

From Computer History Wiki
Jump to: navigation, search
(An OK start)
 
m (Correct cat)
Line 3: Line 3:
 
For example, the line 'a = b + c' would result in a compiler emitting a sequence of load, add and store [[instruction]]s to achieve that; an interpreter would locate its current copy of the data items 'b' and 'c', add them together, and store the result in its copy of 'c'.
 
For example, the line 'a = b + c' would result in a compiler emitting a sequence of load, add and store [[instruction]]s to achieve that; an interpreter would locate its current copy of the data items 'b' and 'c', add them together, and store the result in its copy of 'c'.
  
{{stub}}
+
{{semi-stub}}

Revision as of 13:25, 19 October 2018

An interpreter is a program which takes a program in the source code for a particular programming language, and examines it line by line, to work out what each line of the program is doing. For each line, instead of converting it to object code to perform the action specified, for execution later (as a compiler) would do), the interpreter takes the action indicated in that line there and then.

For example, the line 'a = b + c' would result in a compiler emitting a sequence of load, add and store instructions to achieve that; an interpreter would locate its current copy of the data items 'b' and 'c', add them together, and store the result in its copy of 'c'.