cover image

Library (computing)

Collection of resources used to develop a computer program / From Wikipedia, the free encyclopedia

Dear Wikiwand AI, let's keep it short by simply answering these key questions:

Can you list the top facts and stats about Library (computing)?

Summarize this article for a 10 year old

SHOW ALL QUESTIONS

In computer science, a library is a collection of resources that is leveraged during software development to implement a computer program.

Ogg_vorbis_libs_and_application_dia.svg
Illustration of an application which uses libvorbisfile to play an Ogg Vorbis file

Resources may include configuration data, documentation, help data, message templates, source code or pre-compiled functions and classes, values or type specifications.

In IBM's OS/360 and its successors this is called a partitioned data set.

A library of functions has a well-defined interface by which the functions are invoked. For instance, a program could use a library to indirectly make system calls instead of making those system calls directly in the program. In addition, the functions are exposed by the library for reuse by multiple, independent programs.

A program invokes the library functions via a well-defined mechanism. For example, in C, a library function is invoked by using C's normal function call. The linker generates code to call a function via the library mechanism if the function is available from a library instead of from the program itself.[1]

Library functions are available to be used by multiple, unrelated programs, whereas a function defined in a program can only be used by that program. This distinction can gain a hierarchical notion when a program grows large. In that case, there may be internal libraries that are reused by independent sub-portions of the large program.

A distinguishing feature of a library that it can be used by multiple, independent programs, and the programmer only needs to know the interface -- not the internal details of the library.

The value of a library lies in the reuse of standardized program elements. When a program invokes a library, it gains the behavior implemented inside the library without having to implement that behavior itself. Libraries encourage the sharing of code in a modular fashion and ease the distribution of the code.

The functions of a library can be connected to the invoking program at different program lifecycle phases. If the code of the library is accessed during the build of the invoking program, then the library is called a static library.[2] An alternative is to build the program executable to be separate from the library file. The library functions are connected after the executable is started, either at load-time or runtime. In this case, the library is called a dynamic library.

Most compiled languages have a standard library, although programmers can also create their own custom libraries. Most modern software systems provide libraries that implement the majority of the system services. Such libraries have organized the services which a modern application requires. As such, most code used by modern applications is provided in these system libraries.

Oops something went wrong: