All Topics  
Standard library

 

   Email Print
   Bookmark   Link






 

Standard library



 
 
A standard library for a programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 is the library
Library (computer science)

In computer science, a library is a collection of subroutines or Class used to develop software. Libraries contain code and data that provide services to independent programs....
 that is conventionally made available in every implementation of that language. In some cases, the library is described directly in the programming language specification
Programming language specification

A programming language specification is an artifact that defines a programming language so that programmers and programming language implementation can agree on what programs in that language mean....
; in other cases, the contents of the standard library are determined by more informal social practices in the programming community.

Depending on the constructs made available by the host language, a standard library may include:

Most standard libraries include definitions for at least the following commonly used facilities:

osophies of standard library design vary widely.






Discussion
Ask a question about 'Standard library'
Start a new discussion about 'Standard library'
Answer questions from other users
Full Discussion Forum



Encyclopedia


A standard library for a programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 is the library
Library (computer science)

In computer science, a library is a collection of subroutines or Class used to develop software. Libraries contain code and data that provide services to independent programs....
 that is conventionally made available in every implementation of that language. In some cases, the library is described directly in the programming language specification
Programming language specification

A programming language specification is an artifact that defines a programming language so that programmers and programming language implementation can agree on what programs in that language mean....
; in other cases, the contents of the standard library are determined by more informal social practices in the programming community.

Depending on the constructs made available by the host language, a standard library may include:
  • 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
  • macro definitions
  • global variable
    Global variable

    In computer programming, a global variable is a variable that is accessible in every scope . Interaction mechanisms with global variables are called global environment mechanisms....
    s
  • class
    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....
     definitions
  • template
    Template (programming)

    Templates are a feature of the C++ programming language that allow functions and classes to operate with Generic programming. This allows a function or class to work on many different datatype without being rewritten for each one....
    s,


Most standard libraries include definitions for at least the following commonly used facilities:
  • algorithms (such as sorting algorithms)
  • data structures (such list
    List (computing)

    In computer science, a list is an ordered Multiset of entity/items.In the context of object-oriented programming languages, a list is defined as an instance of an abstract data type , formalizing the concept of an order theoryed Collection class of entity....
    s, trees
    Tree (data structure)

    In computer science, a tree is a widely-used data structure that emulates a hierarchical tree structure with a set of linked Vertex_. It is an acyclic connected graph where each node has a set of zero or more children nodes, and at most one parent node....
     and hash table
    Hash table

    In computer science, a hash table, or a hash map, is a data structure that associates Unique key with value .The primary operation that hash functions support efficiently is a lookup: given a key , find the corresponding value ....
    s)
  • interaction with the host platform, including input/output and operating system calls


Philosophies

Philosophies of standard library design vary widely. For example, Bjarne Stroustrup
Bjarne Stroustrup

Bjarne Stroustrup is a computer scientist at the College of Engineering Chair Professor of Computer Science at Texas A&M University. He is most notable for developing the C++ programming language....
, designer of 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....
, writes:
What ought to be in the standard C++ library? One ideal is for a programmer to be able to find every interesting, significant, and reasonably general class, function, template, etc., in a library. However, the question here is not, "What ought to be in some library?" but "What ought to be in the standard library?" The answer "Everything!" is a reasonable first approximation to an answer to the former question but not the latter. A standard library is something every implementer must supply so that every programmer can rely on it.
This suggests a relatively small standard library, containing only the constructs that "every programmer" might reasonably require when building a large collection of software. This is the philosophy that is used in the C
C (programming language)

C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
 and 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....
 standard libraries.

By contrast, Guido van Rossum, designer of Python
Python (programming language)

Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python's core syntax and semantics are Minimalism , while the standard library is large and comprehensive....
, has embraced a much more inclusive vision of the standard library; in the Python tutorial, he writes:
Python has a "batteries included" philosophy. This is best seen through the sophisticated and robust capabilities of its larger packages.
Van Rossum goes on to list libraries for processing XML, XML-RPC
XML-RPC

XML-RPC is a remote procedure call protocol which uses XML to encode its calls and [] as a transport mechanism. ...
, email messages, and localization, facilities that the C++ standard library omits. This other philosophy is often found in Scripting language
Scripting language

A scripting language, script language or extension language, is a programming language that allows some control of a single or many Application software....
s (as in Python
Python (programming language)

Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python's core syntax and semantics are Minimalism , while the standard library is large and comprehensive....
 or Ruby
Ruby (programming language)

Ruby is a dynamic programming language, reflection , general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features....
) or languages that use a Virtual machine
Virtual machine

In computer science, a virtual machine is a software implementation of a machine that executes programs like a real machine.Definitions...
, such as 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 ....
 or 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....
 languages.

Examples of standard libraries

  • 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 ....
    , for the C programming language
    C (programming language)

    C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
  • C++ standard library
    C++ standard library

    In C++, the Standard Library is a collection of class and subroutine, which are written in the core language. The Standard Library provides several generic containers, functions to utilise and manipulate these containers, function objects, generic strings and streams , support for some language features, and every day functions for tasks suc...
    , for the C++ programming language
    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....
  • Standard Template Library
    Standard Template Library

    The Standard Template Library is a Library partially included in the C++ C++ standard library. It provides Container s, iterators, algorithms, and Function objects....
     (or STL), a sub-part of the C++ standard library
    C++ standard library

    In C++, the Standard Library is a collection of class and subroutine, which are written in the core language. The Standard Library provides several generic containers, functions to utilise and manipulate these containers, function objects, generic strings and streams , support for some language features, and every day functions for tasks suc...
  • 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....
     (or JCL), for 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 ....
    , and Java Platform
  • 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....
     (or BCL), 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....