Make DMD emit C++ .h files same as .di files

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Wed Feb 27 18:48:06 UTC 2019


On 2/25/19 2:28 PM, H. S. Teoh wrote:
> On Mon, Feb 25, 2019 at 11:04:56AM -0800, Manu via Digitalmars-d wrote:
>> On Mon, Feb 25, 2019 at 10:10 AM Andrei Alexandrescu via Digitalmars-d
>> <digitalmars-d at puremagic.com> wrote:
> [...]
>>> Indeed so. There's also the network effect of tooling. Integrating
>>> within the compiler would be like the proverbial "giving someone a
>>> fish", whereas framing it as a tool that can be the first inspiring
>>> many others is akin to "teaching fishing".
>>
>> That sounds nice, but it's bollocks though; give me dtoh, i'm about
>> 95% less likely to use it. It's easy to add a flag to the command line
>> of our hyper-complex build, but reworking custom tooling into it, not
>> so much.
>> I'm not a build engineer, and I have no idea how I'd wire a second
>> pass to each source compile if I wanted to. Tell me how to wire that
>> into VS? How do I wite that into XCode? How do I express that in the
>> scripts that emit those project formats, and also makefiles and ninja?
>> How do I express that the outputs (which are .h files) are correctly
>> expressed as inputs of dependent .cpp compile steps?
> [...]
> 
> <off-topic rant>
> This is a perfect example of what has gone completely wrong in the world
> of build systems. Too many assumptions and poor designs over an
> extremely simple and straightforward dependency graph walk algorithm,
> that turn something that ought to be trivial to implement into a
> gargantuan task that requires a dedicated job title like "build
> engineer".  It's completely insane, yet people accept it as a fact of
> life. It boggles the mind.
> </off-topic rant>
> 

Hear, hear. When adding another step to a build process ISN'T a simple 
"add a line to the script", then something has gone very, VERY wrong.

(Incidentally, this is part of why I've long since lost all patience for 
trying to use IDEs like VS, Eclipse, XCode, and whatnot. Life's too 
short to tolerate all that mess of complexity they turn a basic build 
into. I still *HATE* with a passion, the fact I have to put up will all 
that black-box-build bullshit when I use Unity3D - and don't even get me 
started on the complete and utter garbage that is MSBuild (used by 
Unity, naturally)).

HOWEVER:

All that said, when a single build needs to make multiple passes of *the 
same sources* through the compiler, that's clearly an architectural 
failure on the part of the tooling. We can argue all we want about how 
separate tools is technically superior, but if means adding duplicate 
passes *and* extra complications to the user's buildsystem, then it 
clearly ISN'T "technically superior", it's just a different set of 
tradeoffs and yet another example of D letting perfect be the enemy of good.


More information about the Digitalmars-d mailing list