HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
dlang
dmd
D2011–2026
dlang / dmd

dmd

dmd D Programming Language compiler

33Distinct people
93Mentions
2Explicit recommenders
3.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

dmd D Programming Language compiler

GitHub

Where it is used

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

What people are saying

Here's one of my favorite uses for it. I used to write a separate program to generate static tables. With compile time function execution, this was no longer necessary. Here's…

WalterBright used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

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

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 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 year93 dated mentions

Observed mentions: 2011-06-15 09:08:48 UTC to 2026-08-23 10:26:49 UTC.

0510152011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20112012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 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): 2 mentions; 0 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 17 mentions; 2 submissions, 15 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 12 mentions; 2 submissions, 10 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 14 mentions; 1 submissions, 13 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 11 mentions; 1 submissions, 10 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

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
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC101
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 UTC202
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC514
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 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC303
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC505
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC606
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC17215
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC12210
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC14113
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC11110
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC624
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC505

What Hacker News says

93 sources
> It supports x86, too Well I assumed so because amd64 is a superset of x86. But nice to know you're working on arm64 too. Regarding Intel-syntax, I think there is a little miscommunication here since I try to explain what I mean in the article. Intel-ordering is a good idea, but using nothing but the Intel-syntax wholesale is not universal enough, and needs modifying, especially for AMD64 and other ISAs. Odin's is Intel-like too, but fully Intel by design. > That's so the source code can be tokenized and parsed without needing special behavior inside the asm { ... }. This is why Odin's asm templates have their own universalized syntax. Thus the entire article. > Not sure what you mean. RAX means register RAX. %RAX is not accepted. This: https://github.com/dlang/dmd/blob/master/druntime/src/core/i... It's why I referred to your "trick", w
Read the rest
hich is something I wanted to need in the first place. > That just makes it easier to parse! For Odin's asm template syntax, it's not about being easier to parser, it's about having a context free grammar that is the same across ISAs. If I was to allow for prefixes directly in the grammar, either prefixes would have to have their special syntax or you'd need to have a context-sensitive grammar.
In Everyone says assembly is untyped—everyone is wrong
I use them all the time. It's one of the nicest and cleanest features of D. It's an elegant way of: 1. grouping together strongly related functions that are implicitly private to the enclosing function 2. obviating the need to create a struct in order to pass common context to multiple functions For an example, here's a tree walking function that uses a nested function for the recursion: private void unrollWalker(elem* e, uint defnum, Symbol* v, targ_llong increment, int unrolls) nothrow { int state = 0; /*********************************** * Walk e in execution order, fixing it according to state. * state == 0..unrolls-1: when eincrement is found, remove it, advance to next state * state == 1..unrolls-1: replacing instances of v with v+(state*increment), * state == unrolls-1: l
Read the rest
eave eincrement alone, advance to next state * state == unrolls: done */ void walker(elem* e) @trusted { assert(e); const op = e.Eoper; if (ERTOL(e)) { if (e.Edef != defnum) { walker(e.E2); // this function is @trusted because of this union access walker(e.E1); } } else if (OTbinary(op)) { if (e.Edef != defnum) { walker(e.E1); walker(e.E2); } } else if (OTunary(op)) { assert(e.Edef != defnum); walker(e.E1); } else if (op == OPvar && state && e.Vsym == v) { // overwrite e with (v+increment) elem* e1 = el_calloc(); el_copy(e1,e); e.Eoper = OPadd; e.E1 = e1; e.E2 = el_long(e.Ety, increment * state); } if (OTdef(op) && e.Edef == defnum) { // found the increment elem; neuter all but the last one if (state + 1 < unrolls) { el_free(e.E1); el_free(e.E2); e.Eoper = OPconst; e.Vllong = 0; } ++state; } } walker(e); assert(state == unrolls); } Only one argument needs to be passed to walker(), because the other context data is accessible from the enclosing function. https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ba...
In Using GCC's Nested Functions with Wide Pointers and No Trampolines II
I use: https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ba... It's pretty minimalist on purpose. I don't much care for kitchen sink types. The BetterC is the no-gc version. Use the -betterC switch on the compiler. Or, if you want a string result, import core.stdc.stdlib; string concat(string s1, string s2) { const length = s1.length + s2.length; char* p = cast(char*)malloc(length); assert(p); p[0 .. s1.length] = s1; p[s1.length .. s1.length + s2.length] = s2; return cast(string)p[0 .. length]; } I tend to not use this sort of function because it doesn't manage its own memory. I use barray instead because it manages its memory using RAII. D provides enormous flexibility in managing memory. Or, you can just leave it to the gc to do it for you.
In Features of D That I Love
WalterBright·Jan 7, 2025Recommendation phrase
Here's one of my favorite uses for it. I used to write a separate program to generate static tables. With compile time function execution, this was no longer necessary. Here's an example: __gshared uint[256] tytab = tytab_init; extern (D) private enum tytab_init = () { uint[256] tab; foreach (i; TXptr) { tab[i] |= TYFLptr; } foreach (i; TXptr_nflat) { tab[i] |= TYFLptr; } foreach (i; TXreal) { tab[i] |= TYFLreal; } /* more lines removed for brevity */ return tab; } (); The initializer for the array `tytab` is returned by a lambda that computes the array and then returns it. A link to the full glory of it: https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ba... Another common use for CTFE is to use it to create a DSL.
In Zig's comptime is bonkers good
> you've written an an ARM disassembler Here's my AArch64 disassembler work in progress: https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ba... I add to it in tandem with writing the code generator. It helps flush out bugs in both by doing this. I.e. generate the instruction, the disassemble it and compare with what I thought it should be. It's quite a bit more complicated than the corresponding x86 disassembler: https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ba...
In Things I learned while writing an x86 emulator (2023)

Showing the 15 most recent of 93 sources. Enable JavaScript to search and browse every indexed mention.

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.