Lably
Skip to content

Standard library

Library provided with a programming language to provide common services

  • 3 min read
  • 3 chapters

Related on Lably

Through Computer programming, Library (computing) and Java (programming language)

Some languages define a core part of the standard library that must be made available in all implementations while allowing other parts to be implemented optionally.

In many languages, the standard library often has its own namespace. For example, C++, D, and Rust use std::* as the standard library namespace. C# uses System.*, while Java uses java.*, javax.* and jdk.*. However, in some like Python and Go, there is no "standard library namespace" or common prefix for modules belonging to the standard library.

As defined with the core language aspects, the line between the core language and its standard library is relatively subtle. A programmer may confuse the two aspects even though the language designers intentionally separate the two.

The line between the core language and its standard library is further blurred in some languages by defining core language constructs in terms of its standard library. For example, Java defines a string literal as an instance of the java.lang.String class. Smalltalk defines an anonymous function expression (a "block") as an instance of its library's BlockContext class. Scheme does not specify which portions must be implemented as core language vs. standard library.

Contents

Depending on the constructs available in the core language, a standard library may include:

Commonly provided functionality includes:

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication