Penguin
Annotated edit history of Interpreter version 1, including all changes. View license author blame.
Rev Author # Line
1 AristotlePagaltzis 1 [Interpreter]s present an interface to the user such that it appears that the computer is executing the SourceCode. With the exception of MachineLanguage, this can't actually be done, so instead it's done with smoke and mirrors. The two common approaches are incremental compilation (either to an intermediate form or to MachineLanguage) and writing a VirtualMachine which translates the SourceCode into MachineLanguage an instruction at a time as it is executed.
2
3 [BASIC], [Scheme] and [Haskell] are examples of languages that are commonly interpreted.
4
5 The line is blurry at best, though.
6
7 By the above definition, [Java] is also usually interpreted, yet because its VirtualMachine's intermediate MachineCode is stored in class files, people regard it as a compiled language. [Perl] on the other hand is regarded as interpreted, even though it compiles the source to an optree - simply because it does not save this optree to disk. Even so there do exist environments (such as [Apache] __mod_perl__) which cache the compiled optree for reuse.
8
9 On the other hand, a lot of modern [CPU]s do not implement all of their MachineLanguage in hardware - rather, they contain MicroCode for some of their more complex instructions, which is interpreted and executed as a series of "real" operations.
10
11 For all intents and purposes, attempting to make a clear distinction between [Compiler]s and [Interpreter]s is impossible. It is therefor also silly to talk of interpreted or compiled [ProgrammingLanguage]s. Any language could be interpreted or compiled, whether a [Compiler] or interpreter exists or not.