Compilation Created 2026-10-13 Updated 2026-10-31
Compilation is the translation process performed by a compiler, which may include checking and transforming an abstract syntax tree. Translation can finish before execution, or happen during execution through just-in-time compilation. Reusing the translated representation can avoid repeated parsing and repeated constant folding when only the inputs change. This does not guarantee a speedup: translation itself costs work, and the choice of representation and execution mechanism matters.
One possible compilation pipeline for
. Details. x*(2+3)-4, with execution from an abstract syntax tree, a stack machine instruction sequence, or machine code Interpreter (computing) Created 2026-10-13 Updated 2026-10-14
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.[ref]
Glossary, Python 3.14 documentation. Python 3.14 documentation; Python 3.14 glossary: bytecode and virtual machine entries; compilation, execution and release-specific bytecodes
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.[ref]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
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.[ref]
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
Thus calling a programming language permanently "compiled" or "interpreted" hides an implementation choice: ask which representation is translated, which is executed, and when. JavaScript engine 2026-11-05
A JavaScript engine implements the execution of JavaScript programs according to the applicable ECMAScript language rules. It reads program structure and performs the operations that produce values, state changes and errors. The engine is one component of an environment; a web browser additionally supplies document, networking and interaction facilities.[ref]
ECMAScript Language Specification by Ecma International. §§1–2, Scope and Conformance; §4.2, Hosts and Implementations
For example,
function square(n) { return n * n; } square(7); evaluates to 49. An interpreter can execute a representation of these operations, while compilation can translate operations into another executable form. Just-in-time compilation performs compilation during execution rather than requiring a wholly separate advance compilation step. These implementation choices do not change the multiplication result required by the language.A concrete implementation is V8, whose Ignition is documented as a register-based interpreter. Such an implementation can use intermediate bytecode rather than repeatedly treating source text as its direct execution format. This example describes one engine architecture, not a requirement that every JavaScript engine use the same machinery.[ref]
Ignition in the V8 documentation. Opening description and linked interpreter overview
Host facilities must be distinguished from language execution. Evaluating a call involving
document requires the environment to supply that object; implementing ECMAScript alone does not promise the Document Object Model. Conversely, numerical computations need not create any document nodes.Performance comparisons require a specified workload. Parsing, first execution, repeated execution and calls into host facilities can have different costs. Timing only a tiny warmed-up function therefore does not measure every aspect of loading or running an application, even when the returned values are identical.
Java virtual machine 2026-11-05
The Java virtual machine is the abstract execution machine specified for Java class files and bytecode. It defines runtime data areas, stack frames, operand stacks, local variables and instruction behavior, while leaving implementation choices such as interpretation and just-in-time compilation open.[ref]
For example, two integer loads followed by an integer-add instruction obtain operands from a stack frame and leave their sum on its operand stack. A method call establishes a new stack frame and later returns a result to its caller. These specified effects remain the contract even if a compiler keeps the values in native registers and emits one machine instruction. The virtual-machine interface therefore supports portable compiled code without requiring every implementation to execute bytecode one instruction at a time.
Operand stack 2026-11-05
An operand stack holds intermediate values used by bytecode operations in a Java virtual machine method invocation. Each stack frame has its own last-in-first-out operand stack, initially empty; its maximum depth is recorded in the class file. Values can be loaded from local variables, consumed by operations and replaced by results.[ref]
Starting from an empty operand stack,
iconst_2; iconst_3; iadd produces the successive contents 2, 2,3 and 5, with the top shown at the right. The addition consumes both operands. This abstract execution rule does not require a physical memory push for each operation: just-in-time compilation may retain values in processor registers while preserving the specified behavior.