= Interpreter
{disambiguate=computing}
{wiki}
= Interpreter
{synonym}
An <interpreter> executes a program's operations according to its <programming language semantics>. It can recursively evaluate an <abstract syntax tree>, or follow an instruction sequence using an execution state such as a <stack> and an <instruction pointer>. It need not repeatedly read <source code> characters, and it need not use an <abstract syntax tree> at all.
<Compilation> and interpretation can coexist. In <CPython>, <Python> <source code> is compiled into <bytecode> for execution by an <interpreter>; its <bytecode> is not promised to remain stable between releases.<Python 3.14 documentation/Glossary, Python 3.14 documentation>[Python 3.14 documentation; Python 3.14 glossary: bytecode and virtual machine entries; compilation, execution and release-specific bytecodes]{ref} The <Python> 3.14 `compile` function accepts text or an <abstract syntax tree> and can produce a code object, which `eval` or `exec` can execute.<Python 3.14 documentation/Built-in Functions, Python 3.14 documentation>[Python 3.14 documentation; Python 3.14 Built-in Functions: compile, accepted source forms, code objects and execution by eval or exec]{ref} These operations make translation and execution separately accessible without requiring them to live in different applications.
<Just-in-time compilation> gives another combination: an interactive implementation can translate a submitted <program expression> into <machine code> and then execute it immediately. The <LLVM> 20.1.0 tutorial demonstrates this by adding an <intermediate representation> module to its <just-in-time compilation> facility, looking up the generated function, and calling it.<LLVM 20.1.0 documentation/4. Kaleidoscope: Adding JIT and Optimizer Support>[LLVM 20.1.0 documentation; Implementing a language with LLVM, chapter 4, section 4.4: HandleTopLevelExpression, addModule, lookup and calling the generated native function]{ref} Thus calling a <programming language> permanently "compiled" or "interpreted" hides an implementation choice: ask which representation is translated, which is executed, and when.
Back to article page