- Standard library
A standard library for a
programming language is the library that is conventionally made available in every implementation of that language. In some cases, the library is described directly in theprogramming language specification ; 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 s
*macro definitions
*global variable s
*class definitions
*templates,Most standard libraries include definitions for at least the following commonly used facilities:
*algorithms (such assorting algorithms )
*data structures (such lists, trees andhash table s)
*interaction with the host platform, including input/output and operating system callsPhilosophies
Philosophies of standard library design vary widely. For example,
Bjarne Stroustrup , designer ofC++ , 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." [Bjarne Stroustrup. "The C++ Programming Language". 3rd Ed. Addison-Wesley, 1997] 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 andC++ standard libraries.By contrast, Guido van Rossum, designer of Python, 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. [Guido van Rossum. [http://docs.python.org/tut/node12.html#SECTION00121200000000000000000 Python Tutorial] ."] Van Rossum goes on to list libraries for processing
XML ,XML-RPC , email messages, and localization, facilities that the C++ standard library omits. This other philosophy is often found inScripting language s (as in Python or Ruby) or languages that use aVirtual machine , such as Java or the.NET Framework languages.Examples of standard libraries
*
C standard library , for the C programming language
*C++ standard library , for the C++ programming language
*Standard Template Library (or STL), a sub-part of theC++ standard library
*Java Class Library (or JCL), for the Java programming language, andJava Platform
*Base Class Library (or BCL), for the.NET Framework References
Wikimedia Foundation. 2010.