HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
dlang
phobos
D2012–2024
dlang / phobos

phobos

The standard library of the D programming language

12Distinct people
13Mentions
0Explicit recommenders
1.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The standard library of the D programming language

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year13 dated mentions

Observed mentions: 2012-08-30 19:53:16 UTC to 2024-10-18 13:52:51 UTC.

01232012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC101
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC000
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC303
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC303

What Hacker News says

13 sources
> Good documentation is good as far as it aids understanding. This might be a side effect of tests, but I don't think it's their goal. A good test will catch breaks in behaviour, I'd never trade completeness for readability in tests, in docs it's the reverse. The D language standard library uses both. When you generate the documentation from the comments attached to a declaration, the following unittests (they are identified using a special markup, (that is just triple slashes...) are also included. Example once rendered [0], in the source you see the examples are actually unit tests [1]. [0]: https://dlang.org/phobos/std_algorithm_searching.html#.all [1]: https://github.com/dlang/phobos/blob/master/std/algorithm/se...
In Unit tests as documentation
This is something I _really_ like about D. Unit-tests are built into the language, as is comment-based documentation—put those two together and you get unit-tests as documentation examples built into the language; all it takes is to put a documentation comment (which can be blank) right before a `unittest` block after a declaration. E.g. the examples for the D standard-library's `curry` function are just unit-tests: the docs: <https://dlang.org/phobos/std_functional.html#quickindex.curr...>; the code: <https://github.com/dlang/phobos/blob/42b8c65ccfd35c863f7cedf...>
In Non-code contributions to open source
I'd take a language that have built in support for tagged union over having to import a module and rely on templates I know of sumtype, and i think it is a mistake for D to rely on this for such important language feature I'm not a language dev, so i can't do much to help, using switch/union/enum is more natural, is cleaner, and is easier to add support for IDEs, everyone on the same page That's in areas like this where the language falls short, and i can see people instead choosing alternatives https://github.com/dlang/phobos/blob/master/std/sumtype.d a mess of templates and imports to std.traits using this will make your compile speed tank.. another reason to avoid it's very sad that people recommend this instead of asking for built-in version, makes me sometimes reconsider my choice to use the language if they expect language improveme
Read the rest
nts to be templates, what atrocity will be added next? this is on the same level as std::bool from C++
In Adding Modules to C in 10 Lines of Code [pdf]
I usually refer to LLVM documentation. You can look at this [1] to begin with. For sample code, etc, I would recommend to read D's atomic primitive implementations [2] instead of C++. C++ standard library is an unreadable monster. Fundamentally C++ atomic types are a flaw as std::atomic<int> is a type by itself, whereas in reality the operations has to be atomic. Also you can't get the value type for the type underneath the std::atomic template. Whereas in D, the operations are atomic and you can operate them on the primitive types. You can see numerous examples in D's standard library implementation (which is readable than C++'s) [3][4] [1] https://llvm.org/docs/Atomics.html [2] https://github.com/dlang/druntime/blob/master/src/core/atomi... [3] https://github.com/dlang/phobos/blob/master/std/concurrency.... [4] https://github.com/dlang/
Read the rest
In Ask HN: How to learn advanced C++ (atomics, memory ordering, etc.)
$ git init Initialized empty Git repository in /tmp/phobos/.git/ $ git remote add origin https://github.com/dlang/phobos.git $ git fetch --depth=1 origin 6e5cdacfa6ac018c6ef42aa9679893676f293f21 error: no such remote ref 6e5cdacfa6ac018c6ef42aa9679893676f293f21 However, the commit exists: $ git fetch --depth=1000 [... a long time after ...] $ git checkout 6e5cdacfa6ac018c6ef42aa9679893676f293f21 Note: checking out '6e5cdacfa6ac018c6ef42aa9679893676f293f21'. [...] HEAD is now at 6e5cdacf... phobos 0.2
In Inkscape Moves to GitLab
Check out https://github.com/D-Programming-Language/phobos/blob/master... at line 33 and on. You'll see: version (Windows) { ... } etc. For the specification on how this works: http://dlang.org/version.html The salient point is that conditional compilation in D is not text based, it is AST based. Furthermore, for 'static if', the conditional expression has access to the full symbol table and power of the D language - it is not a separate preprocessor language with its own rules and separate symbol table.
In How does D improve on C++17?
What a hilarious coincidence. :) I'm guessing you can't go giving out concrete legal advice for free, but could you point us towards languages that are fixing this? I see that Julia's stdlib uses MIT for non-external libraries,[1] and Go uses a BSD-style license that explicitly requires distributing the license with binaries,[2] so they're both in the same boat we are. AFAICT D's stdlib uses the Boost license[3] which explicitly allows one to forgo distributing the license with compiled artifacts, but I don't know if solving this issue entirely would require the entire compiler to be licensed under Boost as well. Presuming that interpreted languages can gracefully ignore this issue, I don't know which other "new" languages we could look at for inspiration. [1] https://github.com/JuliaLang/julia/blob/master/LICENSE.md [2] https://github.co
Read the rest
In Golang on GitHub
The standard library (Phobos) is open source. You can find the implementation of memoize at https://github.com/D-Programming-Language/phobos/blob/6cd2e4... memoize is a template (http://dlang.org/template.html). In this case, a template is used to create a "version" of "memoize" with the right parameters and return value (i.e., `fn` and `memoize!fn` are the same type). Each of these "versions" has a hash table from argument tuples to results. I believe the hash is computed by calling a toHash function for each item in the tuple. Tuples and type tuples (http://dlang.org/tuple.html) in D are really quite powerful.
In Hidden treasure in the D standard library
Mixins, at least in D, can be very useful when you want to do some meta-programming (at compile-time, of course). They basically allow you to generate code at compile time. Mixins, together with some other cool D features, like CTFE (compile-time function execution), templates and ability to load external file at compile-time can be used to create DSL compiler which compiles to native code (first to D, than to native, of course). For example, ctRegex from std.regex [1] (standard library regular expressions module) uses mixins to generate D code in compile-time out of regular expression (and D compiler outputs native code for regular expression matching). There is also a PEG parser that works at compile-time (reads external PEG grammar and generates parser code) but I cannot find a link at the moment. Of course, creating DSL parsers is not
Read the rest
the only thing you can do with mixins, but they are surly the first to come to mind.. [1] https://github.com/D-Programming-Language/phobos/blob/master...
In D-style Mixins in C#

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.