D needs to be honest
Joakim
dlang at joakim.fea.st
Mon Oct 29 06:12:06 UTC 2018
On Monday, 29 October 2018 at 04:58:09 UTC, Jonathan Marler wrote:
> I filed this issue
> (https://issues.dlang.org/show_bug.cgi?id=18517) about 8 months
> ago. It provides a couple test cases that show that import
> order changes the semantics of D programs and the order in
> which modules are passed to the compiler also changes
> semantics. This behavior has existed long enough that it's
> probably time for D to remove and/or qualify some of its
> claims. Statements like:
>
> https://dlang.org/spec/module.html
>
>> The order in which ImportDeclarations occur has no
>> significance.
>
>> The order in which modules are imported does not affect the
>> semantics.
>
> The bugzilla issue above shows cases where these statements are
> demonstrated to be false, and I wouldn't characterize the issue
> as a bug, rather, a fundamental problem with the way D handles
> module imports. The language definition as it exists does not
> allow import order to be invariant. Note there are a number of
> ways to fix this issue (see PRs below) but note that they do
> require changes to the way D handles imports.
>
>> The semantics of a module are not affected by what imports it.
>
> The module name and or the namespace it exists in will change
> depending on how the module is imported. It can change
> depending on if it was passed in on the command line, or loaded
> from an import by another module, and the path from which it
> was loaded can change depending on which module loaded it first.
>
> Based on the response of my pull requests to fix these issues,
> its clear that these issues are low on the priority list. This
> is fine and maybe it's better that the maintainers focus on
> other things rather than this problem, however, I think it's
> been long enough that keeping these claims on the website and
> in the documentation is bordering on being deceptive and
> unethical. Everyone will have an opinion on where you draw the
> line, but in my opinion, it's time to come clean.
>
> I've included my pull requests related to these issues. Feel
> free to look into them if you want more information.
>
> Relevant Pull Requests:
>
> Fix module/import order invariance:
> https://github.com/dlang/dmd/pull/7900
> Interpret imports the same regardless of other modules passed
> on the command line: https://github.com/dlang/dmd/pull/7878
> Add broken import order invariance tests:
> https://github.com/dlang/dmd/pull/8165
> Deprecate import/module name mismatch (ALL CASES):
> https://github.com/dlang/dmd/pull/7778
Took a look at all four PRs, all of which were closed by you. I
don't know why you linked all of them, since dmd/7900 seems to be
the latest one with all the changes. Walter did review #7900
earlier this year, but you probably got frustrated when your
subsequent ping was not answered.
A better approach would have been to find other dmd reviewers
capable of understanding your pull and have them review it. I
understand it can be frustrating to have your work just sit
there, as I've had the same happen with my much smaller druntime
pulls before, but you have to understand that reviewer time is
stretched thin.
The fact that Walter took the time to review your pull suggests
there is demand for it, nothing is stopping you and other
reviewers from getting it in.
More information about the Digitalmars-d
mailing list