Report a bug If you spot a problem with this page, click here to create a Bugzilla issue. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Phobos Runtime Library

Phobos is the standard runtime library that comes with the D language compiler.

Generally, the std namespace is used for the main modules in the Phobos standard library. The etc namespace is used for external C/C++ library bindings. The core namespace is used for low-level D runtime functions.

The following table is a quick reference guide for which Phobos modules to use for a given category of functionality. Note that some modules may appear in more than one category, as some Phobos modules are quite generic and can be applied in a variety of situations.

Modules Description
    Algorithms & ranges
Generic algorithms that work with ranges of any type, including strings, arrays, and other kinds of sequentially-accessed data. Algorithms include searching, comparison, iteration, sorting, set operations, and mutation.
    Array manipulation
Convenient operations commonly used with built-in arrays. Note that many common array operations are subsets of more generic algorithms that work with arbitrary ranges, so they are found in std.algorithm.
See std.container.* for an overview.
    Data formats
std.base64 Encoding / decoding Base64 format.
std.csv Read Comma Separated Values and its variants from an input range of dchar.
std.json Read/write data in JSON format.
std.xml Read/write data in XML format. Read/write data in the ZIP archive format.
std.zlib Compress/decompress data using the zlib library.
    Data integrity
std.digest.crc Cyclic Redundancy Check (32-bit) implementation.
std.digest.digest Compute digests such as md5, sha1 and crc32.
std.digest.hmac Compute HMAC digests of arbitrary data. Compute MD5 hash of arbitrary data.
std.digest.ripemd Compute RIPEMD-160 hash of arbitrary data.
std.digest.sha Compute SHA1 and SHA2 hashes of arbitrary data.
    Date & time
std.datetime Provides convenient access to date and time representations.
core.time Implements low-level time primitives.
    Exception handling
std.exception Implements routines related to exceptions.
core.exception Defines built-in exception types and low-level language hooks required by the compiler.
    External library bindings
etc.c.curl Interface to libcurl C library.
etc.c.odbc.sql Interface to ODBC C library.
etc.c.sqlite3 Interface to SQLite C library.
etc.c.zlib Interface to zlib C library.
    I/O & File system
std.file Manipulate files and directories.
std.path Manipulate strings that represent filesystem paths.
std.stdio Perform buffered I/O.
D bindings for standard C headers.

These are mostly undocumented, as documentation for the functions these declarations provide bindings to can be found on external resources.
    Memory management
core.memory Control the built-in garbage collector.
std.typecons Build scoped variables and reference-counted types.
core.attribute Definitions of special attributes recognized by the compiler.
core.demangle Convert mangled D symbol identifiers to source representation.
std.demangle A simple wrapper around core.demangle.
std.meta Construct and manipulate template argument lists (aka type lists).
std.traits Extract information about types and symbols at compile time.
std.typecons Construct new, useful general purpose types.
std.concurrency Low level messaging API for threads.
std.parallelism High level primitives for SMP parallelism.
std.process Starting and manipulating processes.
core.atomic Basic support for lock-free concurrent programming.
core.sync.barrier Synchronize the progress of a group of threads.
core.sync.condition Synchronized condition checking.
core.sync.exception Base class for synchronization exceptions.
core.sync.mutex Mutex for mutually exclusive access.
core.sync.rwmutex Shared read access and mutually exclusive write access.
core.sync.semaphore General use synchronization semaphore.
core.thread Thread creation and management.
std.socket Socket primitives. Networking client functionality as provided by libcurl. Validates an email address according to RFCs 5321, 5322 and others.
std.uri Encode and decode Uniform Resource Identifiers (URIs).
std.uuid Universally-unique identifiers for resources in distributed systems.
std.bigint An arbitrary-precision integer type.
std.complex A complex number type.
std.math Elementary mathematical functions (powers, roots, trigonometry).
std.mathspecial Families of transcendental functions.
std.numeric Floating point numerics functions.
std.random Pseudo-random number generators.
core.checkedint Range-checking integral arithmetic primitives.
core.math Built-in mathematical intrinsics.
std.functional Functions that manipulate other functions.
std.algorithm Generic algorithms for processing sequences.
std.signals Signal-and-slots framework for event-driven programming.
    Runtime utilities
object Core language definitions. Automatically imported.
std.getopt Parsing of command-line arguments.
std.compiler Host compiler vendor string and language version.
std.system Runtime environment, such as OS type and endianness.
core.cpuid Capabilities of the CPU the program is running on.
core.memory Control the built-in garbage collector.
core.runtime Control and configure the D runtime.
    String manipulation
std.string Algorithms that work specifically with strings.
std.array Manipulate builtin arrays.
std.algorithm Generic algorithms for processing sequences.
std.uni Fundamental Unicode algorithms and data structures.
std.utf Encode and decode UTF-8, UTF-16 and UTF-32 strings.
std.format Format data into strings.
std.path Manipulate strings that represent filesystem paths.
std.regex Regular expressions.
std.ascii Routines specific to the ASCII subset of Unicode.
std.encoding Handle and transcode between various text encodings. Windows specific character set support.
std.outbuffer Serialize data to ubyte arrays.
    Type manipulations
std.conv Convert types from one type to another.
std.typecons Type constructors for scoped variables, ref counted types, etc.
std.bitmanip High level bit level manipulation, bit arrays, bit fields.
std.variant Discriminated unions and algebraic types.
core.bitop Low level bit manipulation.
    Vector programming
core.simd SIMD intrinsics