Runtime library

from Wikipedia, the free encyclopedia

The term runtime library ( English runtime library ) is in the computer science used. It refers to a special program library , a collection of software functions that is used to implement the functions built into a programming language within a computer program at the time the program is executed (runtime). These often include B. functions for input and output, memory management or mathematical functions.

If the source code of a computer program is translated by a compiler into the respective target language, it would lead to a hardly sustainable increase in the program code if the complete program code was generated in the target language for each instruction in the program and each call of a built-in function would have to be. Instead, the compiler often generates calls to compiler-specific auxiliary functions that are usually not directly available to the application programmer and whose implementations are located in the runtime library. At the discretion of the compiler manufacturer, the runtime library can often also contain parts of the standard library of the respective compiler or be combined with it.

Depending on the programming language and implementation, the runtime library can also perform runtime checks, e.g. B. limits of the array or dynamic type checking, exception handling and other functions for troubleshooting ( debugging ) included.

The runtime library normally implements many functions with access to the operating system . Many programming languages ​​have built-in functions that do not necessarily have to be implemented in the compiler, but can also be implemented in the runtime library. The boundary between compiler and runtime library is therefore at the discretion of the compiler manufacturer. For these reasons, the runtime library is always compiler -specific and platform-specific .

The concept of the runtime library must not be confused with that of a normal program library , as it is created by an application programmer or supplied to a third party, or a dynamic library , which refers to a program library linked at runtime . For example, the C programming language only requires a minimal runtime library , but prescribes the C standard library of functions that every C implementation must have.

Some more modern programming languages ​​like Java use a more complex runtime environment instead of a simple runtime library .