Every programming language specifies an
execution model, and many implement at least part of that model in a runtime system. One possible definition of runtime system behavior, among others, is "any behavior not directly attributable to the program itself". This definition includes putting parameters onto the stack before function calls, parallel execution of related behaviors, and disk
I/O. By this definition, essentially every language has a runtime system, including
compiled languages,
interpreted languages, and
embedded domain-specific languages. Even
API-invoked standalone execution models, such as
Pthreads (
POSIX threads), have a runtime system that implements the execution model's behavior. Most scholarly papers on runtime systems focus on the implementation details of parallel runtime systems. A notable example of a parallel runtime system is
Cilk, a popular parallel programming model. The proto-runtime toolkit was created to simplify the creation of parallel runtime systems. In addition to execution model behavior, a runtime system may also perform support services such as
type checking,
debugging, or
code generation and
optimization.
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. • Some stand-alone versions of
Ventura Publisher (1986–1993),
Artline (1988–1991),
Timeworks Publisher (1988–1991) and
ViewMAX (1990–1992) contained special runtime versions of Digital Research's
GEM as their runtime environment. • In the late 1990s,
JP Software's command line processor
4DOS was optionally available in a special runtime version to be linked with
BATCOMP pre-compiled and encrypted
batch jobs in order to create unmodifiable
executables from batch scripts and run them on systems without 4DOS installed. ==Examples==