type variables

Bruce Carneal bcarneal at gmail.com
Sun Aug 2 22:25:12 UTC 2020


On Sunday, 2 August 2020 at 20:42:35 UTC, Paul Backus wrote:
> On Sunday, 2 August 2020 at 20:27:53 UTC, Bruce Carneal wrote:
>>
>> I think it's all about readability given the performance 
>> constraints.
>>
>> Your type function example earlier in this thread employs 
>> iteration and is dead simple.  Not much to improve there.
>
> You're conflating two separate issues. The existing alternative 
> to using a TypeBuilder + iteration is `static foreach`--which 
> is also iterative.
>
> The question you should answer, if you want to convince people 
> that TypeBuilder (or something like it) is worth adding, is 
> "how is this better than `static foreach` and `static if`?"

The "conflation" was my attempt to fold in the OT recursion 
sub-thread that I, unfortunately, engendered early on when I 
misspoke.


How is this better than static foreach and friends?  WRT types it 
should be more efficient, more readable, and more general.

The readability and generality claims can be examined via 
speculative coding,  additional examples to go with your 
inaugural type function.

The performance claim verification would have to wait for a 
prototype but in the mean time we have informed opinion from the 
front-end experts.

My main objective here is to raise the possibility of a broadly 
applicable meta programming advance that could roll up a bunch of 
special cases now and expand the reach of "mere mortal" 
metaprogrammers in the future.

I'm exploring here, not crusading.  If there is interest now, 
great.  If not, well, that's information too.  Something like 
what has been sketched in this thread may be a bridge too far.  
It may be much better suited to an sdc revival or some other 
front-end development effort.  It may need to go in to the D3 
basket.  It may follow many other ideas in to the dust bin.  
We'll see.











More information about the Digitalmars-d mailing list