What’s a std library?

Print anything with Printful



A standard library is a set of functions and language definitions included in a compiler package, providing basic programming abilities and interaction with the operating system. Libraries are collections of program elements grouped by functionality, with some relying on others. A balance must be struck between including necessary functionality and avoiding a bloated library. Different languages have different philosophies on what should be included in a standard library, with interpreted languages having larger collections and low-level languages having fewer.

In computer programming, a standard library is a set of functions, constants, and other language definitions included as part of the main compiler package. The standard library provides a programmer with the basic ability to create simple programs and manipulate basic data. It also provides the ability to somehow interact with the host operating system so that information processing does not become a trivial task. All implementations of a given language compiler include the standard library and it is generally backward compatible with the library, so the core language functionality is preserved as it evolves over time.

A library, broadly speaking, is a collection of procedures, functions, classes, or other elements of a computer program at the disposal of a programmer. These elements are usually grouped into categories that define their functionality, such as inputs, outputs and process management. Some libraries rely on other libraries to function properly, a concept called dependency. Important variables, such as the maximum value of an integer data type or the numeric definition of a null character, can be stored in a library. They are also usually pre-compiled pieces of computer code, which prevent malicious modification and protect proprietary programming code.

A standard library strives to include all the basic and necessary functionality that a wide range of programs will require to run in one way or another. This has to be balanced with including too many libraries. A large standard library means that, in some languages, the distribution size of a completed program could be incredibly large and bloated with libraries that are never used. Including too many files in a standard library can also lead to problems with language development, because features that are infrequently used need to be updated with every language or compiler change, increasing the amount of work required for a new version.

Conversely, a standard library that has little functionality can lead every programmer to install custom external libraries and specifically include them in program releases. This can lead to a type of secondary, community-driven maintenance of a standard that is not controlled by the main language development team. Some languages ​​adapt to such situations by including commonly used libraries in the standards set when the community has made clear the need.

Different languages ​​have different design philosophies about what should be in the standard library. Additionally, the mechanisms behind how the compiler creates an executable program can also determine the parameters for the library. Interpreted languages ​​tend to have a larger collection of libraries in their standard set, while low-level languages ​​often have very few.




Protect your devices with Threat Protection by NordVPN


Skip to content