A runtime environment (RE), also known as the execution environment or sequence environment, describes the prerequisites of a particular runtime system that are available and defined at the runtime of computer programs. This is defined by the elementary components of the programming language, such as the behavior of language constructs and other functions such as type checking, debugging, code generation and optimization. The runtime environment also includes the runtime library, standard libraries, programming interfaces, runtime variables, as well as on hardware and software components via operating system functions.
A runtime environment loads programs developed by application programmers and runs them on a platform for which the runtime environment was made. Thus, it itself represents a small “platform” on which programs can be based.
In some cases, a platform-agnostic, and therefore portable, virtual machine is part of a runtime environment. A well-known example of this is the Java programming language. The runtime environment of a Java program is called the Java Runtime Environment and combines the Java class libraries, which are used for input and output, for example, and the Java Virtual Machine, which is responsible for executing the Java bytecode.
Another example is Microsoft’s .Net Framework. The .NET Common Language Runtime (CLR) is the runtime environment for programs written in C#, Visual Basic, .NET, J#, JScript .NET, and C++/CLI (for newer Windows operating systems). In IBM’s mainframe operating system z/OS, the so-called “Language Environment” is the common runtime environment for programs, which can be programmed in COBOL, PL/I, C and Fortran, among others.
Examples of the basic or basic functions of a runtime environment are:
- Reading and Writing Files
- Transporting data across networks
- Controlling Input and Output Devices
- Manage data
- Sorting and searching
Examples where runtime environments allow programs to be platform-independent include:
- Java applets running by different web browsers on different operating systems
- Windows programs running with Wine on Unix environments
- Linux programs running on UNIX operating systems
- DOS programs running on OS/2, UNIX and Linux
- 16-bit Windows programs that run on 32-bit Windows