Glossary · Automation software engineering and architecture
Interpreter
German: Interpreter
In computing, an interpreter is a program that executes source code or intermediate code directly, statement by statement or in small units, at runtime, instead of translating the whole program into machine code beforehand. Python and many scripting languages are typically interpreted.
- Software engineering
In one sentence
An interpreter executes source or intermediate code directly at runtime instead of translating the whole program beforehand.
Example
The robot controller interprets the robot program line by line, so a syntax error in a rarely used branch is detected only when that line is reached.
How it applies
- Engineering: Interpreters make it easy to change programs without a build step and are common for scripting, test automation, robot and CNC programs, and configuration logic. Some errors are only detected when the affected code runs.
- Timing: Interpretation usually runs slower and less predictably than compiled code. Just-in-time compilation narrows the gap but adds its own timing effects.
- Documentation: For interpreted languages in products, such as scripting interfaces for customers, document the language version, available functions, runtime limits and error messages. Scripts that customers write become part of their machine configuration and should be versioned.
Interpreter vs. compiler
A Compiler translates the whole program before execution; an interpreter executes it directly. Many systems combine both: source code is compiled to bytecode, which is then interpreted by a virtual machine. PLC runtimes generally compile IEC 61131-3 code, while some simple controllers interpret intermediate code.