All Topics  
Library (computer science)

 

   Email Print
   Bookmark   Link






 

Library (computer science)



 
 
In computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
, a library is a collection of subroutine
Subroutine

In computer science, a subroutine or subprogram is a portion of computer code within a larger computer program, which performs a specific task and is relatively independent of the remaining code....
s or classes
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
 used to develop software. Libraries contain code and data that provide services to independent programs. This allows code and data to be shared and changed in a modular fashion. Some executable
Executable

In computing, an executable causes a computer "to perform indicated tasks according to encoded instruction ," as opposed to a file that only contains data ....
s are both standalone programs and libraries, but most libraries are not executables. Executables and libraries make references known as links to each other through the process known as linking, which is typically done by a linker
Linker

In computer science, a linker or link editor is a computer program that takes one ormore object file generated by a compiler and combines them into a single executable program....
.

Most modern operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
s (OS) provide libraries that implement the majority of system services.






Discussion
Ask a question about 'Library (computer science)'
Start a new discussion about 'Library (computer science)'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
, a library is a collection of subroutine
Subroutine

In computer science, a subroutine or subprogram is a portion of computer code within a larger computer program, which performs a specific task and is relatively independent of the remaining code....
s or classes
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
 used to develop software. Libraries contain code and data that provide services to independent programs. This allows code and data to be shared and changed in a modular fashion. Some executable
Executable

In computing, an executable causes a computer "to perform indicated tasks according to encoded instruction ," as opposed to a file that only contains data ....
s are both standalone programs and libraries, but most libraries are not executables. Executables and libraries make references known as links to each other through the process known as linking, which is typically done by a linker
Linker

In computer science, a linker or link editor is a computer program that takes one ormore object file generated by a compiler and combines them into a single executable program....
.

Most modern operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
s (OS) provide libraries that implement the majority of system services. Such libraries have commoditized the services a modern application expects an OS to provide. As such, most code used by modern applications is provided in these libraries.

History

The earliest programming concepts analogous to libraries were intended to separate data
DATA

Debt, AIDS, Trade in Africa is a multinational Non-governmental organization founded in January 2002 in London by U2's Bono along with Robert Sargent Shriver III and activists from the Jubilee 2000 Drop the Debt campaign....
 definitions from the program implementation
Implementation

Implementation is the realization of an application, or execution of a plan, idea, model, design, specification, Standardization, algorithm, or policy....
. The COMPOOL (Communication Pool) concept was brought to popular attention by JOVIAL
JOVIAL

JOVIAL is a high-order computer programming language similar to ALGOL, but specialized for the development of embedded systems.JOVIAL is an acronym for "Jules Own Version of the International Algorithmic Language." The "International Algorithmic Language" part of the name is from ALGOL, which was original...
 in 1959, although it borrowed the idea from the large-system SAGE
Semi Automatic Ground Environment

The Semi-Automatic Ground Environment was an automated control system for tracking and intercepting enemy bomber aircraft used by North American Aerospace Defense Command from the late 1950s into the 1980s....
 software. Following the computer science principles of Separation of Concerns
Separation of concerns

In computer science, separation of concerns is the process of breaking a computer program into distinct features that overlap in functionality as little as possible....
 and Information Hiding
Information hiding

Information hiding in computer science is the principle of hiding of design decisions in a computer program that are most likely to change, thus protecting other parts of the program from change if the design decision is changed....
, "Comm Pool's purpose was to permit the sharing of System Data among many programs by providing a centralized data description." (Wexelblat 1981:369)

COBOL
COBOL

COBOL is one of the oldest programming languages still in active use. Its name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments....
 also included "primitive capabilities for a library system" in 1959 (Wexelblat 1981:274), but Jean Sammet
Jean E. Sammet

Jean E. Sammet is an United States computer scientist who developed the FORMAC programming language in 1962.She received her B.A. in Math from Mount Holyoke College in 1948 and her M.A....
 described them as "inadequate library facilities" in retrospect. (Wexelblat 1981:258)

Another major contributor to the modern library concept was the subprogram innovation of FORTRAN
Fortran

Fortran is a general-purpose programming language, procedural programming language, imperative programming language programming language that is especially suited to numerical analysis and scientific computing....
. FORTRAN subprograms can be compiled independently of each other, but the compiler lacks a linker
Linker

In computer science, a linker or link editor is a computer program that takes one ormore object file generated by a compiler and combines them into a single executable program....
, so type checking between subprograms is impossible. (Wilson et al. 1988:126)

Finally, the influential Simula 67 cannot be overlooked. Simula was the first object-oriented programming
Object-oriented programming

Object-oriented programming is a programming paradigm that uses "Object_" and their interactions to design applications and computer programs....
 language, and its classes
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
 are nearly identical to the modern concept as used in Java
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
, C++
C++

C++ is a general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level programming language and low-level programming language language features....
, and C#. The class concept of Simula was also a progenitor of the package in Ada
Ada (programming language)

Ada is a structured programming, statically typed, Imperative programming, and Object-oriented programming high-level language computer programming programming language, extended from Pascal and other languages....
 and the module of Modula-2
Modula-2

Modula-2 is a computer programming language invented by Niklaus Wirth at ETH, around 1978, as a successor to his intermediate language Modula. Modula-2 was implemented in 1980 for the Lilith computer, which was commercialized in 1982 by startup company DISER as MC1 and MC2....
. (Wilson et al. 1988:52) Even when originally developed in 1965, Simula classes could be included in library files and added at compile time. (Wexelblat 1981:716)

Types


Static libraries


Historically, libraries could only be static. A static library, also known as an archive, consists of a set of routines
Subroutine

In computer science, a subroutine or subprogram is a portion of computer code within a larger computer program, which performs a specific task and is relatively independent of the remaining code....
 which are copied into a target application by the compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
, linker
Linker

In computer science, a linker or link editor is a computer program that takes one ormore object file generated by a compiler and combines them into a single executable program....
, or binder, producing object file
Object file

In computer science, object code, or an object file, is the representation of code that a compiler or assembler generates by processing a source code file....
s and a stand-alone executable file. This process, and the stand-alone executable file, are known as a static build
Static build

A static build is a compiler version of a program which has been statically linked against libraries.In computer science, linker means taking one or more object code generated by compilers and assemble them into a single executable program....
 of the target application. Actual addresses for jumps and other routine calls are stored in a relative or symbolic form which cannot be resolved until all code and libraries are assigned final static addresses.

The linker resolves all of the unresolved addresses into fixed or relocatable addresses (from a common base) by loading all code and libraries into actual runtime memory locations. This linking process can take as much, or more time than the compilation process, and must be performed when any of the modules is recompiled. Most compiled languages have a standard library (for example, the C standard library
C standard library

The C standard library consists of a set of sections of the ISO C standard which describe a collection of header files and library routines used to implement common operations, such as input/output and character string handling, in the C ....
) but programmers can also create their own custom libraries. Commercial compiler publishers provide both standard and custom libraries with their compiler products.

A linker
Linker

In computer science, a linker or link editor is a computer program that takes one ormore object file generated by a compiler and combines them into a single executable program....
 may work on specific types of object files, and thus require specific (compatible) types of libraries. Collecting object files into a static library may ease their distribution and use. A client, either a program or a library subroutine, accesses a library object by referencing just its name. The linking process resolves references by searching the libraries in the order given. Usually, it is not considered an error if a name can be found multiple times in a given set of libraries.

In some programming languages, a feature called "smart linking" may be used where the linker is aware of or integrated with the compiler, such that the linker understands how external references are used, and code in a library that is never actually used, even though internally referenced, can be deleted from the compiled application. For example, a program that only uses integers for arithmetic, or does no arithmetic operations at all, can exclude the floating-point library routines. This smart-linking feature can lead to smaller application file sizes and reduced memory usage.

Dynamic linking


Dynamic linking means that the subroutines of a library are loaded into an application program at runtime
Runtime

In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination ....
, rather than being linked in at compile time
Compile time

In computer science, compile time refers to either the operations performed by a compiler , programming language requirements that must be met by source code for it to be successfully compiled , or properties of the program that can be reasoned about at compile time....
, and remain as separate files
Computer file

A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable computer storage....
 on disk
Disk storage

Disk storage is a general category of a computer storage mechanisms, in which data is recorded on planar, round and rotating surfaces . A disk drive is a peripheral device used to record and retrieve information....
. Only a minimum amount of work is done at compile time by the linker
Linker

In computer science, a linker or link editor is a computer program that takes one ormore object file generated by a compiler and combines them into a single executable program....
; it only records what library routines the program needs and the index names or numbers of the routines in the library. The majority of the work of linking is done at the time the application is loaded (loadtime) or during execution (runtime). The necessary linking code, called a loader
Loader (computing)

In computing, a loader is the part of an operating system that is responsible for loading programs from executables into memory, preparing them for execution and then executing them....
, is actually part of the underlying operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
. At the appropriate time the loader finds the relevant libraries on disk and adds the relevant data from the libraries to the process's
Process (computing)

In computing, a process is an Object of a computer program that is being sequentially executed by a computer system that has the ability to run several computer programs Concurrency ....
 memory space.

Some operating systems can only link in a library at loadtime, before the process starts executing; others may be able to wait until after the process has started to execute and link in the library just when it is actually referenced (i.e., during runtime
Runtime

In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination ....
). The latter is often called "delay loading" or "deferred loading". In either case, such a library is called a dynamically linked library.

The nature of dynamic linking makes it a common boundary in software licenses.

Plugin
Plugin

In computing, a plug-in consists of a computer program that interacts with a host application software to provide a certain, usually very specific, function "on demand"....
s are one common usage of dynamically linked libraries, which is especially useful when the libraries can be replaced by other libraries with a similar interface, but different functionality. Software may be said to have a "plugin architecture" if it uses libraries for core functionality with the intention that they can be replaced. Note, however, that the use of dynamically linked libraries in an application's architecture does not necessarily mean that they may be replaced.

Dynamic linking was originally developed in the Multics
Multics

Multics was an extremely influential early time-sharing operating system. The project was started in 1964. The last known running Multics installation was shut down on October 30, 2000....
 operating system, starting in 1964. It was also a feature of MTS (the Michigan Terminal System
Michigan Terminal System

Michigan Terminal System is an operating system for the IBM System/360 and its successors that was developed jointly by the following institutions:...
), built in the late 1960s. In Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
, dynamically-linked libraries are called dynamic-link libraries
Dynamic-link library

Dynamic-link library , or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems....
 or "DLLs".

Relocation
One wrinkle that the loader must handle is that the actual location in memory of the library data cannot be known until after the executable and all dynamically linked libraries have been loaded into memory. This is because the memory locations used depend on which specific dynamic libraries have been loaded. It is not possible to depend on the absolute location of the data in the executable, nor even in the library, since conflicts between different libraries would result: if two of them specified the same or overlapping addresses, it would be impossible to use both in the same program.

However, in practice, the shared libraries on most systems do not change often. Therefore, it is possible to compute a likely load address for every shared library on the system before it is needed, and store that information in the libraries and executables. If every shared library that is loaded has undergone this process, then each will load at their predetermined addresses, which speeds up the process of dynamic linking. This optimization is known as prebinding
Prebinding

Prebinding is a method for reducing the time it takes to launch executables in the Mach-O file format. For example, this is what Mac OS X is doing when in the "Optimizing" stage of installing system software or certain applications....
 in Mac OS X and prelinking in Linux. Disadvantages of this technique include the time required to precompute these addresses every time the shared libraries change, the inability to use address space layout randomization
Address space layout randomization

Address space layout randomization is a Computer insecurity technique which involves randomly arranging the positions of key data areas, usually including the base of the executable and position of Library , Dynamic memory allocation, and Stack-based memory allocation, in a Process 's address space....
, and the requirement of sufficient virtual address space for use (a problem that will be alleviated by the adoption of 64-bit
64-bit

64-bit CPUs have existed in supercomputers since the 1960s and in RISC-based computer workstation and Server s since the early 1990s. In 2003 they were introduced to the mainstream personal computer arena, in the form of the x86-64 and 64-bit PowerPC processor architectures....
 architectures, at least for the time being).

The library itself contains a jump table of all the methods within it, known as entry points. Calls into the library "jump through" this table, looking up the location of the code in memory, then calling it. This introduces overhead in calling into the library, but the delay is usually so small as to be negligible.

Locating libraries at runtime
Dynamic linkers/loaders vary widely in functionality. Some depend on explicit paths to the libraries being stored in the executable. Any change to the library naming or layout of the filesystem will cause these systems to fail. More commonly, only the name of the library (and not the path) is stored in the executable, with the operating system supplying a system to find the library on-disk based on some algorithm.

One of the biggest disadvantages of dynamic linking is that the executables depend on the separately stored libraries in order to function properly. If the library is deleted, moved, or renamed, or if an incompatible version of the DLL is copied to a place that is earlier in the search, the executable would fail to load. On Windows this is commonly known as DLL hell
DLL hell

In computing, DLL hell is a colloquial term for the complications that arise when working with dynamic link library used with Microsoft Windows operating systems, particularly legacy 16-bit editions....
.

Unix-like systems
Most Unix-like
Unix-like

A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
 systems have a "search path" specifying file system directories
Directory (file systems)

In computing, a directory, folder, catalog, or drawer is a virtual container within a digital file system, in which groups of files and other directories can be kept and organized....
 in which to look for dynamic libraries. On some systems, the default path is specified in a configuration file
Configuration file

In computing, configuration Computer files, or config files, are used to configure the initial settings for some computer programs. They are used for user application software, Server and operating system settings....
; in others, it is hard coded into the dynamic loader. Some executable file
Executable

In computing, an executable causes a computer "to perform indicated tasks according to encoded instruction ," as opposed to a file that only contains data ....
 formats can specify additional directories in which to search for libraries for a particular program. This can usually be overridden with an environment variable
Environment variable

Environment variables are a set of dynamic named Value s that can affect the way running computer process will behave on a computer....
, although it is disabled for setuid
Setuid

setuid and setgid are Unix access rights flags that allow users to run an executable with the permissions of the executable's owner or group....
 and setgid programs, so that a user can't force such a program to run arbitrary code. Developers of libraries are encouraged to place their dynamic libraries in places in the default search path. On the downside, this can make installation of new libraries problematic, and these "known" locations quickly become home to an increasing number of library files, making management more complex.
Microsoft Windows
Microsoft Windows will check the registry
Windows registry

The Windows Registry is a directory which stores settings and options for Microsoft Windows operating systems. It contains information and settings for all the hardware, operating system software, most non-operating system software, and per-user settings....
 to determine the proper place to find an ActiveX
ActiveX

ActiveX is a component Object Model developed by Microsoft for Microsoft Windows. By using the Component Object Model runtime, developers can create Component-based software engineering that perform a particular function or a set of functions....
 DLL, but for other DLLs it will check the directory that the program was loaded from; the current working directory; any directories set by calling the SetDllDirectory function; the System32, System, and Windows directories; and finally the directories specified by the PATH environment variable
Environment variable

Environment variables are a set of dynamic named Value s that can affect the way running computer process will behave on a computer....
. Applications written for the .NET Framework
.NET Framework

The Microsoft .NET Framework is a software framework that is available with several Microsoft Windows operating systems. It includes a large Library of coded solutions to prevent common programming problems and a virtual machine that manages the execution of programs written specifically for the Software framework....
 framework (since 2002), also check the Global Assembly Cache
Global Assembly Cache

The Global Assembly Cache or GAC is a machine-wide .NET assemblies cache for Microsoft's Common Language Runtime Platform . The approach of having a specially controlled central repository addresses the shared library concept and helps to avoid pitfalls of other solutions that lead to drawbacks like DLL hell....
 as the primary store of shared dll files to remove the issue of DLL hell
DLL hell

In computing, DLL hell is a colloquial term for the complications that arise when working with dynamic link library used with Microsoft Windows operating systems, particularly legacy 16-bit editions....
.

OpenStep
OpenStep
OpenStep

OpenStep is an object-oriented application programming interface specification for an object-oriented operating system that uses any modern operating system as its core, principally developed by NeXT with Sun Microsystems....
 used a more flexible system, collecting a list of libraries from a number of known locations (similar to the PATH concept) when the system first starts. Moving libraries around causes no problems at all, although there is a time cost when first starting the system.
AmigaOS
Under AmigaOS
AmigaOS

AmigaOS is the default native operating system of the Amiga personal computer. It was developed first by Commodore International, and initially introduced in 1985 with the Amiga 1000....
 generic system libraries are stored in a directory defined by the LIBS: path assignment and application-specific libraries can be stored in the same directory as the application's executable. AmigaOS will search these locations when an executable attempts to launch a shared library. An application may also supply an explicit path when attempting to launch a library.

Shared libraries
In addition to being loaded statically or dynamically, libraries are also often classified according to how they are shared among programs. Dynamic libraries almost always offer some form of sharing, allowing the same library to be used by multiple programs at the same time. Static libraries, by definition, cannot be shared. The term "linker" comes from the process of copying procedures or subroutines which may come from "relocatable" libraries and adjusting or "linking" the machine address to the final locations of each module.

The shared library term is slightly ambiguous, because it covers at least two different concepts. First, it is the sharing of code located on disk by unrelated programs. The second concept is the sharing of code in memory, when programs execute the same physical page of RAM, mapped into different address spaces. It would seem that the latter would be preferable, and indeed it has a number of advantages. For instance on the OpenStep
OpenStep

OpenStep is an object-oriented application programming interface specification for an object-oriented operating system that uses any modern operating system as its core, principally developed by NeXT with Sun Microsystems....
 system, applications were often only a few hundred kilobytes in size and loaded almost instantly; the vast majority of their code was located in libraries that had already been loaded for other purposes by the operating system. There is a cost, however; shared code must be specifically written to run in a multitasking environment. In some older environments such as 16 bit Windows or MPE for the HP 3000, only stack based data (local) was allowed, or other significant restrictions were placed on writing a DLL.

RAM sharing can be accomplished by using position independent code as in Unix
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
, which leads to a complex but flexible architecture, or by using position dependent code as in Windows and OS/2
OS/2

OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "IBM Personal System/2 " line of second-generation personal computers....
. These systems make sure, by various tricks like pre-mapping the address space and reserving slots for each DLL, that code has a great probability of being shared. Windows DLLs are not shared libraries in the Unix sense. The rest of this section concentrates on aspects common to both variants.

In most modern operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
s, shared libraries can be of the same format as the "regular" executables. This allows two main advantages: first, it requires making only one loader for both of them, rather than two (having the single loader is considered well worth its added complexity). Secondly, it allows the executables also to be used as DLLs, if they have a symbol table. Typical executable/DLL formats are ELF
Executable and Linkable Format

In computing, the Executable and Linking Format is a common standard file format for executables, object code, shared libraries, and core dumps....
 and Mach-O
Mach-O

Mach-O, short for Mach kernel object code file format, is a file format for executables, object code, shared libraries, dynamically-loaded code, and core dumps....
 (both in Unix) and PE
Portable Executable

The Portable Executable format is a file format for executables, object file, and Dynamic-link librarys, used in 32-bit and 64-bit versions of Microsoft Windows operating systems....
 (Windows). In Windows, the concept was taken one step further, with even system resources such as fonts being bundled in the DLL file format. The same is true under OpenStep, where the universal "bundle" format is used for almost all system resources.

The term DLL is mostly used on Windows and OS/2
OS/2

OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "IBM Personal System/2 " line of second-generation personal computers....
 products. On Unix and Unix-like
Unix-like

A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
 platforms, the term shared library or shared object is more commonly used; consequently, the most common filename extension
Filename extension

A filename extension is a substring to the filename of a computer file applied to indicate the encoding convention of its contents.In some operating systems it is optional, while in some others it is a requirement....
 for shared library files is .so, usually followed by another dot and a version number. This is technically justified in view of the different semantics. More explanations are available in the position independent code article.

In some cases, an operating system can become overloaded with different versions of DLLs, which impedes its performance and stability. Such a scenario is known as DLL hell
DLL hell

In computing, DLL hell is a colloquial term for the complications that arise when working with dynamic link library used with Microsoft Windows operating systems, particularly legacy 16-bit editions....
. Most modern operating systems, after 2001, have clean-up methods to eliminate such situations.

Dynamic loading
Dynamic loading is a subset of dynamic linking where a dynamically linked library loads and unloads at run-time on request. Such a request may be made implicitly at compile-time or explicitly at run-time. Implicit requests are made at compile-time when a linker adds library references that include file paths or simply file names. Explicit requests are made when applications make direct calls to an operating system's API at runtime.

Most operating systems that support dynamically linked libraries also support dynamically loading such libraries via a run-time linker API. For instance, Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 uses the API functions LoadLibrary, LoadLibraryEx, FreeLibrary and GetProcAddress with Microsoft Dynamic Link Libraries; POSIX
POSIX

POSIX or "Portable Operating System Interface" is the collective name of a family of related standardizations specified by the Institute of Electrical and Electronics Engineers to define the application programming interface , along with shell and utilities interfaces for software compatible with variants of the Unix operating system, altho...
 based systems, including most UNIX and UNIX-like systems, use dlopen, dlclose and dlsym. Some development systems automate this process.

Remote libraries

Another solution to the library issue is to use completely separate executables (often in some lightweight form) and call them using a remote procedure call
Remote procedure call

Remote procedure call is an Inter-process communication technology that allows a computer program to cause a subroutine or procedure to execute in another address space without the programmer explicitly coding the details for this remote interaction....
 (RPC) over a network to another computer. This approach maximizes operating system re-use: the code needed to support the library is the same code being used to provide application support and security for every other program. Additionally, such systems do not require the library to exist on the same machine, but can forward the requests over the network.

The downside to such an approach is that every library call requires a considerable amount of overhead. RPC calls are much more expensive than calling a shared library which has already been loaded on the same machine. This approach is commonly used in a distributed architecture which makes heavy use of such remote calls, notably client-server systems and application server
Application server

An application server, in an Multitier architecture, is a server that hosts an Application programming interface to expose business logic and business processes for use by third-party Business software....
s such as Enterprise JavaBean
Enterprise JavaBean

Enterprise JavaBeans is a managed, server-side component architecture for modular construction of enterprise applications.The EJB specification is one of several Java platform Application programming interfaces in the Java Platform, Enterprise Edition....
s.

Object Libraries

Although dynamic linking was originally developed in the 1960s, it did not reach consumer operating systems until the late 1980s; it was generally available in some form in most operating systems by the early 1990s. It was during this same period that object-oriented programming
Object-oriented programming

Object-oriented programming is a programming paradigm that uses "Object_" and their interactions to design applications and computer programs....
 (OOP) was becoming a significant part of the programming landscape. OOP with runtime binding requires additional information that traditional libraries don't supply; in addition to the names and entry points of the code located within, they also require a list of the objects on which they depend. This is a side-effect of one of OOP's main advantages, inheritance, which means that the complete definition of any method may be defined in a number of places. This is more than simply listing that one library requires the services of another; in a true OOP system, the libraries themselves may not be known at compile time
Compile time

In computer science, compile time refers to either the operations performed by a compiler , programming language requirements that must be met by source code for it to be successfully compiled , or properties of the program that can be reasoned about at compile time....
, and vary from system to system.

At the same time another common area for development was the idea of multi-tier programs, in which a "display" running on a desktop computer would use the services of a mainframe
Mainframe computer

Mainframes are computers used mainly by large organizations for critical applications, typically bulk data processing such as census, industry and consumer statistics, Enterprise Resource Planning, and financial transaction processing....
 or minicomputer
Minicomputer

A minicomputer is a class of multi-user computers that lies in the middle range of the computing spectrum, in between the largest multi-user systems and the smallest single-user systems ....
 for data storage or processing. For instance, a program on a GUI-based computer would send messages to a minicomputer to return small samples of a huge dataset for display. Remote procedure calls already handled these tasks, but there was no standard RPC system
Remote procedure call

Remote procedure call is an Inter-process communication technology that allows a computer program to cause a subroutine or procedure to execute in another address space without the programmer explicitly coding the details for this remote interaction....
.

It was not long before the majority of the minicomputer and mainframe vendors were working on projects to combine the two, producing an OOP library format that could be used anywhere. Such systems were known as object libraries, or distributed objects if they supported remote access (not all did). Microsoft's COM is an example of such a system for local use, DCOM a modified version that support remote access.

For some time object libraries were the "next big thing" in the programming world. There were a number of efforts to create systems that would run across platforms, and companies competed to try to get developers locked into their own system. Examples include IBM
IBM

International Business Machines Corporation, abbreviated IBM and nicknamed "Big Blue" , is a multinational corporation computer technology and consulting corporation headquartered in Armonk, New York, New York, United States....
's System Object Model
System Object Model

In computing, the System Object Model is an object-oriented shared library system developed by IBM. A distributed version based on CORBA, DSOM, allowed objects on different computers to communicate....
 (SOM/DSOM), Sun Microsystems
Sun Microsystems

Sun Microsystems, Inc. is a multinational corporation vendor of computers, computer components, computer software, and information technology services, founded on February 24, 1982....
' Distributed Objects Everywhere
Distributed Objects Everywhere

Distributed Objects Everywhere was a long-running Sun Microsystems project to build a distributed computing environment based on the CORBA system in the 'back end' and OpenStep as the user interface....
 (DOE), NeXT
NeXT

NeXT, Inc. was an American computer company headquartered in Redwood City, California, California, that developed and manufactured a series of computer workstations intended for the higher education and business markets....
's Portable Distributed Objects
Portable Distributed Objects

Portable Distributed Objects, or PDO, is a programming Application programming interface for creating object-oriented code that can be executed remotely on a computer network of computers....
 (PDO), Digital
Digital

A digital system uses discrete values, usually but not always symbolized numerically to represent information for input, processing, transmission, storage, etc....
's ObjectBroker
ObjectBroker

ObjectBroker is A distributed object system from Digital Equipment Corporation based on the CORBA standard....
, Microsoft's Component Object Model
Component Object Model

Component Object Model is an interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages....
 (COM/DCOM), and any number of CORBA
Çorba

Chorba , shurpa , sorpa , or shorpo is one of various kinds of soup or stew found in national cuisines across Eurasia. The term is likely of Persian language or Turkic languages origin....
-based systems.

In the end, it turned out that OOP libraries were not the next big thing. With the exception of Microsoft's COM and NeXT's (now Apple Computer
Apple Computer

Apple Inc., formerly Apple Computer Inc., is an United States multinational corporation which designs and manufactures consumer electronics and software products....
) PDO, all of these efforts have since ended.

The JAR file format
JAR (file format)

In computing, a JAR file aggregates many files into one. Software developers generally use .jar files to distribute Java platform class and associated metadata....
 is mainly used for object libraries in the Java programming language
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
. It consists of (sometimes compressed) classes in bytecode format and is loaded by a java virtual machine or special class loaders.

Naming

  • AmigaOS
    AmigaOS

    AmigaOS is the default native operating system of the Amiga personal computer. It was developed first by Commodore International, and initially introduced in 1985 with the Amiga 1000....
     libraries are named ".library" (exp.: mathieeedoubtrans.library). These are separate files (shared libraries) that are invoked by the program that is running, and are dynamically-loaded but are not dynamically linked. Once the library has been invoked usually it not could deallocate memory and resources it asked for. User can force a "flushlibs" option by using AmigaDOS command Avail (that checks free memory in the system and has the option Avail flush that frees memory from libraries remaining open by programs). Since AmigaOS 4.0 July 2007 First Update, support for shared objects and dynamic linking has been introduced. Now also in Amiga can exist ".so" objects, together with ".library files".


  • GNU
    GNU

    GNU is a computer operating system composed entirely of free software. Its name is a recursive acronym for GNU's Not Unix; it was chosen because its design is Unix-like, but differs from Unix by being free software and containing no Unix code....
    /Linux
    Linux

    Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license...
    , Solaris and other System V Release 4 derivatives, and BSD variants
libfoo.a and libfoo.so files are placed in directories like /lib, /usr/lib or /usr/local/lib. The filenames always start with lib, and end with .a (archive, static library) or .so (shared object, dynamically linked library), with an optional interface number. For example libfoo.so.2 is the second major interface revision of the dynamically linked library libfoo. Old Unix
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 versions would use major and minor library revision numbers (libfoo.so.1.2) while contemporary Unixes will only use major revision numbers (libfoo.so.1). Dynamically loaded libraries are placed in /usr/libexec and similar directories. The .la files sometimes found in the library directories are libtool
Libtool

GNU Libtool is a GNU programming tool from the GNU build system used for creating portable library . To quote the introduction in the :In the past, if a source code package developer wanted to take advantage of the power of shared libraries, it was necessary to write custom support code for each platform on which the package ran....
 archives, not usable by the system as such.
  • Mac OS X
    Mac OS X

    Mac OS X is a line of computer operating systems developed, marketed, and sold by Apple Inc., and since 2002 has been included with all new Macintosh computer systems....
     and upwards
The system inherits static library conventions from BSD, with the library being in a .a file, and can use .so-style dynamically-linked libraries (with the .dylib suffix instead). Most libraries in Mac OS X, however, are "frameworks", placed inside of special directories called "bundles
Bundle (NEXTSTEP)

Under NEXTSTEP, Mac OS X and GNUstep, a bundle is a directory that allows related resources such as software object file to be grouped together....
", which wrap the library's required files and metadata. For example a library called "My Neat Library" would be implemented in a bundle called "My Neat Library.framework".
  • Microsoft Windows
    Microsoft Windows

    Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
*.DLL
Dynamic-link library

Dynamic-link library , or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems....
files are dynamically linkable libraries
Dynamic-link library

Dynamic-link library , or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems....
. Other file name patterns may be used for specific purpose DLLs, e.g. *.OCX for OCX control libraries. The interface revisions are either encoded in the files, or abstracted away using COM-object
Component Object Model

Component Object Model is an interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages....
 interfaces. Depending on how they are compiled, *.LIB files can be either static libraries or representations of dynamically linkable libraries needed only during compilation, known as "Import Libraries". Unlike in the UNIX
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 world, where different file extensions are used, when linking against .LIB file in Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 one must first know if it is a regular static library or an import library. In the latter case, a .DLL
Dynamic-link library

Dynamic-link library , or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems....
file must be present at runtime.


See also

  • Code reuse
    Code reuse

    Code reuse, also called software reuse, is the use of existing software, or software knowledge, to build new software....
  • Linker
    Linker

    In computer science, a linker or link editor is a computer program that takes one ormore object file generated by a compiler and combines them into a single executable program....
  • Loader (computing)
    Loader (computing)

    In computing, a loader is the part of an operating system that is responsible for loading programs from executables into memory, preparing them for execution and then executing them....
  • Microsoft Dynamic Link Library
  • Object file
    Object file

    In computer science, object code, or an object file, is the representation of code that a compiler or assembler generates by processing a source code file....
  • Plugin
    Plugin

    In computing, a plug-in consists of a computer program that interacts with a host application software to provide a certain, usually very specific, function "on demand"....
  • Prebinding
    Prebinding

    Prebinding is a method for reducing the time it takes to launch executables in the Mach-O file format. For example, this is what Mac OS X is doing when in the "Optimizing" stage of installing system software or certain applications....
  • Static library
    Static library

    In computer science, a static library or statically-linked library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable file....
  • Runtime library
    Runtime library

    In computer programming, a runtime library is a special program library used by a compiler, to implement functions built into a programming language, during the runtime of a computer program....
  • Visual Component Library
    Visual Component Library

    VCL is a visual software component-based framework for developing Microsoft Windows applications, developed by Borland for use in its Delphi programming language and C++ Builder software development environment....
     (VCL)
  • Component Library for Cross Platform
    Component Library for Cross Platform

    Component Library for Cross Platform , is a cross-platform visual component-based framework for developing Microsoft Windows and Linux applications....
     (CLX)
  • Free Component Library (FCL, Free Pascal's
    Free Pascal

    Free Pascal is a free software, Portability , open source, Pascal programming language and Object Pascal compiler. The 32/64-bit multi-CPU architecture and cross-platform compiler implements the Borland Pascal programming language dialects as well as some MacPascal constructs, and is available for...
     equivalent of VCL)
  • Lazarus Component Library
    Lazarus (software)

    Lazarus is a cross platform Visual programming Integrated development environment which provides a Delphi programming language Clone for Pascal programming language and Object Pascal developers....
     (LCL)
  • C standard library
    C standard library

    The C standard library consists of a set of sections of the ISO C standard which describe a collection of header files and library routines used to implement common operations, such as input/output and character string handling, in the C ....
  • Java Class Library
    Java Class Library

    The Java Class Library is a set of Library #Dynamic linking that Java applications can call at runtime. Because the Java Platform is not dependent on any specific operating system, applications cannot rely on any of the existing libraries....
  • Base Class Library
    Base Class Library

    The Base Class Library is a standard library available to all languages using the .NET Framework. .NET includes the BCL in order to encapsulate a large number of common functions, such as file reading and writing, graphic rendering, database interaction, and XML document manipulation, which makes the programmer's job easier....


Footnotes


Notations



External links

  • Article by Léon Bottou and John Ryland
  • by Baris Simsek
  • - the Binary File Descriptor Library