DIP 1006 - Preliminary Review Round 1

Nicholas Wilson iamthewilsonator at hotmail.com
Sun Mar 4 07:39:28 UTC 2018


On Sunday, 4 March 2018 at 04:30:31 UTC, Walter Bright wrote:
> It's not trivial. First, it's 100 lines of code (with no 
> comments) just for that, and there are templates and behaviors 
> with memory allocation. Moving along that path, we're gradually 
> reinventing std.getopt which is 1814 lines (with comments).

I disagree, it is 100 (slightly less) lines of modular code and 
can be used for -i,-I,-J,-check and possibly a whole lot more.
Yes there are no comments but it's not exactly difficult to 
follow.
You get that from modular code.

parseCommandLine is 746! and is much more complicated.
I'm very glad that in LDC we have access to LLVM command line 
arguments
which are purely declarative.

> Generally, people will be driving dmd with a makefile, 
> dmd.conf, or other response file.

You still have to write those.

>It's complicated enough already, and gets constantly worse.

And it won't get simpler unless anything is done about it!

> Once in, we're stuck with it forever.

We can (and do) deprecate things.

> I just don't feel it is worthwhile spending time on this.

Then the situation will not improve. It is a shame to lose this 
excellent work.

>> I think aggregation is a good idea. So is phrasing in the 
>> positive sense, except for it looks like xxx and yyy are _off_ 
>> by default, where surely we want all checks _on_ by default.
>
> The default is that they're all on.

Good.

> So to just have one on, first turn them all off then turn on 
> the desired ones.

Not so good. That is the opposite pattern of use I would expect. 
I would much rather turn them off individually, because I might 
forget one or a new release might add more and then it is off by 
default. Not to mention it result in way more args and the 
intention is much less clear .
Looking at a command line invocation of DMD could you figure out 
which checks are off by looking at:
` -checks=off -checks=boundscheck -checks=in -checks=out 
-checks=unittest`
don't forget they could be interspersed between other args _and_ 
be in the conf file. The types of checks are a closed set, it 
makes sense to specify them all at once.


More information about the Digitalmars-d mailing list