How do people feel about putting source compiler directives inside rdmd?

bachmeier no at spam.net
Tue Dec 3 01:28:00 UTC 2019


On Monday, 2 December 2019 at 22:18:06 UTC, mipri wrote:

> A script is a file with source code in it that you can execute.
> The essential feature of scripts is that the source code is what
> you're executing.

If you include compiler directives inside the file, you're *not* 
executing the code, because you're adding code to tell the 
compiler what to do with the file. You lose portability once you 
add compilation information.

> In deployed systems, on servers, in other people's code, when
> you come across a binary that you have a problem with, it can be
> a long adventure to find the source of that binary, and then you
> may still have not found *the* source to *the* binary, but just
> *some* source that could create similar binaries. For example,
> if you find a repo link in a near by document, what commit to
> that repo was used to build the binary that you have?

You can add a comment explaining how to compile the code. The 
proposed change to rdmd would require a bunch of added 
complexity, and probably introduce bugs, all in the name of 
duplicating Makefile functionality. Let's leave currently working 
tools alone.


More information about the Digitalmars-d mailing list