www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Multiple alias this redux

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Following the approval of his DIP66, Igor Stepanov proceeded with an 
implementation at https://github.com/D-Programming-Language/dmd/pull/3998.

Walter and I objected that the implementation is overly complex. My 
opinion is much weaker than his; I'm not deeply familiar with the dmd 
internals. Iain Buclaw seems to agree with Walter. and Igor has replied 
with additional explanations for the added complexity.

As a result:

* We have no alias this

* The compiler is 2 KLOC smaller/simpler

* The PR has bitrotten

* Igor is probably frustrated

So this is a stalemate that I'd like to see broken. The best solution I 
see with this is a core compiler contributor reviewing Igor's code and 
either:

(a) Assuming Igor is still interested, give concrete, actionable 
guidance to Igor so he can simplify the PR and follow through 
shepherding the PR into dmd;

(b) If Igor is no longer interested, either take over the PR and modify 
it for approval, or implement DIP66 from first principles;

(c) Review the code and discussion, and reach the conclusion the 
proposed implementation is appropriate and no radical simplifications 
are within reach.

Please chime in if you'd like to take this over.


Thanks,

Andrei
Oct 02 2015
parent reply deadalnix <deadalnix gmail.com> writes:
Anything, but please make this happen. Considering how alias this 
is implemented in the first place, I really doubt a simple 
implementation exists. Maybe a simpler one, I'm not familiar 
enough with the codebase to judge, but certainly not a simple one 
(dug into the alias this code not so long ago).

Considering this, I do think this is reasonable to accept some 
level a complexity in the PR that may not seems strictly required 
at first glance.

alias this, is a complex feature as it interact with identifier 
resolution, casting, choosing overload when calling and some 
more. This is the nature of the beast.
Oct 02 2015
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 10/03/2015 02:17 AM, deadalnix wrote:
 Anything, but please make this happen. Considering how alias this is
 implemented in the first place, I really doubt a simple implementation
 exists. Maybe a simpler one, I'm not familiar enough with the codebase
 to judge, but certainly not a simple one (dug into the alias this code
 not so long ago).

 Considering this, I do think this is reasonable to accept some level a
 complexity in the PR that may not seems strictly required at first glance.

 alias this, is a complex feature as it interact with identifier
 resolution, casting, choosing overload when calling and some more. This
 is the nature of the beast.
Igor wrote this on the pull request: " andralex Hello. I was out and will nd I will be absent for some time becauseI'm busy with graduate work at the university and is very busy at the job. I'll return to this work and other D works after a couple of months. Sorry. BTW, I have some ideas about this implementation." He also wrote me email. I'm sure he wouldn't mind if somebody else would take implementation over. Andrei
Oct 03 2015