In computer programming, a runtime system or just runtime is a sub-system that exists in the computer where a program is created, as well as in the computers where the program is intended to be run. The name comes from the compile time and runtime division from compiled languages, which similarly distinguishes the computer processes involved in the creation of a program (compilation) and its execution in the target machine (the runtime).
|-
| Engine
| Component of a runtime environment that executes code by compiling or interpreting it
| JavaScript engine in web browsers, Java Virtual Machine
|-
| Interpreter
| Type of engine that reads and executes code line by line, without compiling the entire program beforehand
| CPython interpreter, Ruby MRI, JavaScript (in some cases)
|-
| JIT interpreter
| Type of interpreter that dynamically compiles code into machine instructions at runtime, optimizing the code for faster execution
| V8, PyPy interpreter
|}
Relation to runtime environments
The runtime system is also the gateway through which a running program interacts with the runtime environment. The runtime environment includes not only accessible state values, but also active entities with which the program can interact during execution. For example, environment variables are features of many operating systems, and are part of the runtime environment; a running program can access them via the runtime system. Likewise, hardware devices such as disks or DVD drives are active entities that a program can interact with via a runtime system.
One unique application of a runtime environment is its use within an operating system that only allows it to run. In other words, from boot until power-down, the entire OS is dedicated to only the application(s) running within that runtime environment. Any other code that tries to run, or any failures in the application(s), will break the runtime environment. Breaking the runtime environment in turn breaks the OS, stopping all processing and requiring a reboot. If the boot is from read-only memory, a secure, single-mission system is created.
Examples of such directly bundled runtime systems include:
- Between 1983 and 1984, Digital Research offered several of their business and education applications for the IBM PC on bootable floppy diskettes bundled with SpeedStart CP/M-86, a reduced version of CP/M-86 as runtime environment.
